Skip to content

Audio to Text

Audio to Text tasks transcribe spoken audio CAPTCHAs into text. Send a base64-encoded audio file and receive the transcribed content. This is commonly used for accessibility-oriented CAPTCHA challenges that read out letters, numbers, or words.

TypeDescription
AudioToTextTaskTranscribe audio CAPTCHA to text
ParameterTypeRequiredDescription
typestringYesAudioToTextTask
bodystringYesBase64-encoded audio file (MP3, WAV, OGG)
langstringNoLanguage code (e.g., en, ru, de)
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "AudioToTextTask",
"body": "SUQzBAAAAAAAI1RTU0UAAAA...",
"lang": "en"
}
}
{
"errorId": 0,
"status": "ready",
"solution": {
"text": "seven four two"
}
}
{
"text": "seven four two"
}
FieldTypeDescription
textstringThe transcribed text from the audio CAPTCHA
import requests
import base64
API_KEY = "YOUR_API_KEY"
# Encode the audio file to base64
with open("captcha.mp3", "rb") as f:
audio_data = base64.b64encode(f.read()).decode()
# Create task
response = requests.post("https://api.ucaptcha.net/createTask", json={
"clientKey": API_KEY,
"task": {
"type": "AudioToTextTask",
"body": audio_data,
"lang": "en"
}
}).json()
if response.get("status") == "ready":
print("Transcription:", response["solution"]["text"])
else:
import time
task_id = response["taskId"]
while True:
result = requests.post("https://api.ucaptcha.net/getTaskResult", json={
"clientKey": API_KEY,
"taskId": task_id
}).json()
if result["status"] == "ready":
print("Transcription:", result["solution"]["text"])
break
elif result["status"] == "failed":
print("Error:", result.get("errorDescription"))
break
time.sleep(5)
import { readFileSync } from "fs";
const API_KEY = "YOUR_API_KEY";
// Encode the audio file to base64
const audioData = readFileSync("captcha.mp3").toString("base64");
const response = await fetch("https://api.ucaptcha.net/createTask", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
clientKey: API_KEY,
task: {
type: "AudioToTextTask",
body: audioData,
lang: "en"
}
})
}).then(r => r.json());
if (response.status === "ready") {
console.log("Transcription:", response.solution.text);
} else {
const taskId = response.taskId;
while (true) {
const result = await fetch("https://api.ucaptcha.net/getTaskResult", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ clientKey: API_KEY, taskId })
}).then(r => r.json());
if (result.status === "ready") {
console.log("Transcription:", result.solution.text);
break;
} else if (result.status === "failed") {
console.error("Error:", result.errorDescription);
break;
}
await new Promise(r => setTimeout(r, 5000));
}
}
Terminal window
# Encode audio to base64
AUDIO_BASE64=$(base64 -w 0 captcha.mp3)
# Create task
curl -X POST https://api.ucaptcha.net/createTask \
-H "Content-Type: application/json" \
-d "{
\"clientKey\": \"YOUR_API_KEY\",
\"task\": {
\"type\": \"AudioToTextTask\",
\"body\": \"$AUDIO_BASE64\",
\"lang\": \"en\"
}
}"
# Poll for result if not immediately ready (replace TASK_ID)
curl -X POST https://api.ucaptcha.net/getTaskResult \
-H "Content-Type: application/json" \
-d '{
"clientKey": "YOUR_API_KEY",
"taskId": "TASK_ID"
}'
  • 2Captcha

The following legacy type name is also accepted for backward compatibility:

  • AudioTask