Text Captcha
Text Captcha tasks solve text-based CAPTCHA questions that require a written answer rather than image or audio processing. These are knowledge-based challenges such as “What color is the sky?” or “What is 2 + 3?”.
Task Type
Section titled “Task Type”| Type | Description |
|---|---|
TextCaptchaTask | Answer a text-based CAPTCHA question |
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | Yes | TextCaptchaTask |
comment | string | Yes | The question to answer (e.g., “What color is the sky?”) |
Create Task
Section titled “Create Task”Request
Section titled “Request”{ "clientKey": "YOUR_API_KEY", "task": { "type": "TextCaptchaTask", "comment": "What color is the sky?" }}Response
Section titled “Response”{ "errorId": 0, "status": "ready", "solution": { "text": "blue" }}Solution Object
Section titled “Solution Object”{ "text": "blue"}| Field | Type | Description |
|---|---|---|
text | string | The answer to the text-based question |
Code Examples
Section titled “Code Examples”Python
Section titled “Python”import requests
API_KEY = "YOUR_API_KEY"
response = requests.post("https://api.ucaptcha.net/createTask", json={ "clientKey": API_KEY, "task": { "type": "TextCaptchaTask", "comment": "What color is the sky?" }}).json()
if response.get("status") == "ready": print("Answer:", 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("Answer:", result["solution"]["text"]) break elif result["status"] == "failed": print("Error:", result.get("errorDescription")) break
time.sleep(5)JavaScript
Section titled “JavaScript”const API_KEY = "YOUR_API_KEY";
const response = await fetch("https://api.ucaptcha.net/createTask", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ clientKey: API_KEY, task: { type: "TextCaptchaTask", comment: "What color is the sky?" } })}).then(r => r.json());
if (response.status === "ready") { console.log("Answer:", 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("Answer:", result.solution.text); break; } else if (result.status === "failed") { console.error("Error:", result.errorDescription); break; }
await new Promise(r => setTimeout(r, 5000)); }}# Create taskcurl -X POST https://api.ucaptcha.net/createTask \ -H "Content-Type: application/json" \ -d '{ "clientKey": "YOUR_API_KEY", "task": { "type": "TextCaptchaTask", "comment": "What color is the sky?" } }'
# 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" }'Provider Coverage
Section titled “Provider Coverage”- 2Captcha