Skip to content

Image to Text

Image to Text is the most common recognition task. Send a base64-encoded image of a CAPTCHA and receive the text content. This task type processes images directly on the provider side — no proxy variants are needed.

Recognition tasks typically return results synchronously with the createTask response. If the result is not immediately available, poll with getTaskResult as usual.

TypeDescription
ImageToTextTaskRecognize text from a CAPTCHA image
ParameterTypeRequiredDescription
typestringYesImageToTextTask
bodystringYesBase64-encoded image (PNG, JPG, GIF)
casebooleanNotrue if the answer is case-sensitive
numericintegerNo1 = digits only, 2 = letters only, 0 = any
minLengthintegerNoMinimum answer length
maxLengthintegerNoMaximum answer length
phrasebooleanNotrue if the answer contains a space
mathbooleanNotrue if the answer is a math result
commentstringNoInstructions for the solver
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "ImageToTextTask",
"body": "iVBORw0KGgoAAAANSUhEUg...",
"numeric": 1,
"minLength": 4,
"maxLength": 6
}
}
{
"errorId": 0,
"status": "ready",
"solution": {
"text": "abc123"
}
}
{
"text": "abc123"
}
FieldTypeDescription
textstringThe recognized text from the CAPTCHA image
import requests
import base64
API_KEY = "YOUR_API_KEY"
# Encode the CAPTCHA image to base64
with open("captcha.png", "rb") as f:
image_data = base64.b64encode(f.read()).decode()
# Create task
response = requests.post("https://api.ucaptcha.net/createTask", json={
"clientKey": API_KEY,
"task": {
"type": "ImageToTextTask",
"body": image_data,
"numeric": 0,
"minLength": 4,
"maxLength": 8
}
}).json()
if response.get("status") == "ready":
print("Solution:", response["solution"]["text"])
else:
# Poll if not immediately ready
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("Solution:", 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 CAPTCHA image to base64
const imageData = readFileSync("captcha.png").toString("base64");
// Create task
const response = await fetch("https://api.ucaptcha.net/createTask", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
clientKey: API_KEY,
task: {
type: "ImageToTextTask",
body: imageData,
numeric: 0,
minLength: 4,
maxLength: 8
}
})
}).then(r => r.json());
if (response.status === "ready") {
console.log("Solution:", response.solution.text);
} else {
// Poll if not immediately ready
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("Solution:", 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 image to base64
IMAGE_BASE64=$(base64 -w 0 captcha.png)
# Create task
curl -X POST https://api.ucaptcha.net/createTask \
-H "Content-Type: application/json" \
-d "{
\"clientKey\": \"YOUR_API_KEY\",
\"task\": {
\"type\": \"ImageToTextTask\",
\"body\": \"$IMAGE_BASE64\",
\"numeric\": 0,
\"minLength\": 4,
\"maxLength\": 8
}
}"
# 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
  • CapSolver
  • Anti-Captcha
  • CapMonster
  • DeathByCaptcha
  • 2Crawler
  • Multibot