Skip to content

createTask

Submit a CAPTCHA solving task to uCaptcha. The API selects the optimal provider based on your routing settings and returns a task ID for polling.

POST https://api.ucaptcha.net/createTask
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "RecaptchaV2TaskProxyless",
"websiteURL": "https://example.com",
"websiteKey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-"
},
"callbackUrl": "https://your-server.com/callback",
"selectionMode": "autoFastest",
"provider": "capsolver"
}
ParameterTypeRequiredDescription
clientKeystringYesYour API key
taskobjectYesTask configuration object
task.typestringYesTask type identifier (see Task Types in the sidebar)
callbackUrlstringNoURL to receive the result via webhook when the task completes
selectionModestringNoOverride routing for this request (see below)
providerstringNoForce a specific provider (e.g., capsolver, 2captcha)

The task object requires different fields depending on the task type. At minimum, most token-based tasks require type, websiteURL, and websiteKey. See the individual task type pages for full parameter details.

The selectionMode parameter lets you override your API key’s default routing settings for a single request.

ValueDescription
autoCheapestRoutes to the cheapest available provider. Equivalent to setting speedWeight to 10.
autoFastestRoutes to the fastest available provider. Equivalent to setting speedWeight to 90.
autoMostReliableBalances cost and speed with emphasis on reliability. Equivalent to setting speedWeight to 50.
prioritySame behavior as autoMostReliable. This is the default if no mode is specified.

Most tasks are solved asynchronously. The response includes a taskId that you use to poll for results.

{
"errorId": 0,
"taskId": "550e8400-e29b-41d4-a716-446655440000",
"status": "processing"
}

Some task types such as ImageToTextTask may return the solution immediately without requiring polling.

{
"errorId": 0,
"taskId": "550e8400-e29b-41d4-a716-446655440000",
"status": "ready",
"solution": {
"text": "abc123"
}
}
FieldTypeDescription
errorIdnumber0 for success, 1 for error
taskIdstringUnique task identifier (UUID)
statusstringprocessing for async tasks, ready for sync tasks that solved immediately
solutionobjectSolution object (only present when status is ready)
errorCodestringError code (only present when errorId is 1)
errorDescriptionstringHuman-readable error message (only present when errorId is 1)
Terminal window
curl -X POST https://api.ucaptcha.net/createTask \
-H "Content-Type: application/json" \
-d '{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "RecaptchaV2TaskProxyless",
"websiteURL": "https://example.com",
"websiteKey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-"
}
}'
import requests
response = requests.post("https://api.ucaptcha.net/createTask", json={
"clientKey": "YOUR_API_KEY",
"task": {
"type": "RecaptchaV2TaskProxyless",
"websiteURL": "https://example.com",
"websiteKey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-"
}
})
data = response.json()
if data["errorId"] == 0:
task_id = data["taskId"]
print(f"Task created: {task_id}")
else:
print(f"Error: {data['errorCode']} - {data['errorDescription']}")
const response = await fetch("https://api.ucaptcha.net/createTask", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
clientKey: "YOUR_API_KEY",
task: {
type: "RecaptchaV2TaskProxyless",
websiteURL: "https://example.com",
websiteKey: "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-",
},
}),
});
const data = await response.json();
if (data.errorId === 0) {
console.log(`Task created: ${data.taskId}`);
} else {
console.error(`Error: ${data.errorCode} - ${data.errorDescription}`);
}