curl -X POST "$BASE_URL/captcha/tasks" \
-H "x-captcha-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 6f1c2a52-0b0e-4a4e-9a57-3d1f6f0f9a10" \
-d '{
"type": "hcaptcha",
"siteUrl": "https://discord.com/register",
"sitekey": "a9b5fb07-92ff-493f-86fe-352a2803b3df",
"proxy": "http://user:pass@host:port",
"rqdata": "optional-rqdata"
}'
{
"success": true,
"code": 201,
"message": "Captcha task is pending solver",
"data": {
"taskId": "k3Jd9sLq2Xv7mTn8WbRz4YpC1HeA5GuF",
"taskType": "hcaptcha",
"status": "pending",
"cost": 0.01
},
"idempotent": false
}
{
"success": false,
"code": 402,
"errorCode": "INSUFFICIENT_CAPTCHA_CREDITS",
"message": "Insufficient Captcha credits"
}
Captcha
Create Task
Create an hCaptcha solving task and get its task ID.
POST
/
captcha
/
tasks
curl -X POST "$BASE_URL/captcha/tasks" \
-H "x-captcha-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 6f1c2a52-0b0e-4a4e-9a57-3d1f6f0f9a10" \
-d '{
"type": "hcaptcha",
"siteUrl": "https://discord.com/register",
"sitekey": "a9b5fb07-92ff-493f-86fe-352a2803b3df",
"proxy": "http://user:pass@host:port",
"rqdata": "optional-rqdata"
}'
{
"success": true,
"code": 201,
"message": "Captcha task is pending solver",
"data": {
"taskId": "k3Jd9sLq2Xv7mTn8WbRz4YpC1HeA5GuF",
"taskType": "hcaptcha",
"status": "pending",
"cost": 0.01
},
"idempotent": false
}
{
"success": false,
"code": 402,
"errorCode": "INSUFFICIENT_CAPTCHA_CREDITS",
"message": "Insufficient Captcha credits"
}
Creates an hCaptcha solving task and returns its
taskId. Use Get Task to retrieve the token once it is solved.
The task price is charged from your credits when the task is created. Failed tasks are refunded automatically.
Headers
Unique string per task. Retrying with the same key and the same body returns the existing task instead of creating and charging a new one.
Body
curl -X POST "$BASE_URL/captcha/tasks" \
-H "x-captcha-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 6f1c2a52-0b0e-4a4e-9a57-3d1f6f0f9a10" \
-d '{
"type": "hcaptcha",
"siteUrl": "https://discord.com/register",
"sitekey": "a9b5fb07-92ff-493f-86fe-352a2803b3df",
"proxy": "http://user:pass@host:port",
"rqdata": "optional-rqdata"
}'
Response
true when an existing task was returned for a repeated Idempotency-Key. In that case the status is 200.{
"success": true,
"code": 201,
"message": "Captcha task is pending solver",
"data": {
"taskId": "k3Jd9sLq2Xv7mTn8WbRz4YpC1HeA5GuF",
"taskType": "hcaptcha",
"status": "pending",
"cost": 0.01
},
"idempotent": false
}
{
"success": false,
"code": 402,
"errorCode": "INSUFFICIENT_CAPTCHA_CREDITS",
"message": "Insufficient Captcha credits"
}
Errors
Every error returnssuccess: false with a code, an errorCode and a message.
| Status | errorCode | What to do |
|---|---|---|
| 400 | INVALID_CAPTCHA_REQUEST | A body field is missing or invalid. message names the problem. |
| 401 | INVALID_CAPTCHA_KEY | Send a valid key in the x-captcha-key header. |
| 402 | INSUFFICIENT_CAPTCHA_CREDITS | Add credits to your account. |
| 403 | CAPTCHA_FEATURE_REQUIRED | Your account does not have the active Captcha feature. |
| 404 | CAPTCHA_ACCOUNT_NOT_FOUND | Your Captcha account does not exist. |
| 409 | IDEMPOTENCY_KEY_REUSED | This Idempotency-Key was already used for a different task. Use a new key. |
| 500 | CAPTCHA_TASK_CREATE_FAILED | The task could not be created. Retry the request. |