CAPTCHA Task Query API (Server-Side Asynchronous Tasks) Integration Guide
This document introduces the CAPTCHA asynchronous task query endpoint POST /captcha/tasks. When you pass async: true while calling any CAPTCHA endpoint (the token series or recognition series), the endpoint immediately returns a task_id, and the server immediately takes over and continues processing; you can use the task_id to query the final result, but querying is not a prerequisite for the task to continue. This is suitable for scenarios such as multi-solver rotation: obtain the task_id immediately after submitting a task, schedule other solvers first, and return later to retrieve the result.
📘 Full interactive documentation (including online debugging): CAPTCHA Task Query API →
¶ Application Process
Log in to the application list, open General Application, and click the copy button to the right of the API KEY field. Please keep the Key on the server for use as {token} in the examples below.

¶ Basic Usage
¶ Step 1: Create a Task Asynchronously
Pass async: true in the request body of any CAPTCHA endpoint, and the endpoint will immediately return a task_id (HTTP 201) without blocking to wait:
curl -X POST 'https://api.acedata.cloud/captcha/token/recaptcha2' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
"website_key": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-",
"website_url": "https://www.google.com/recaptcha/api2/demo",
"async": true
}'
{
"task_id": "61138bb6-19aa-11ec-a9c8-0242ac110002",
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}
¶ Step 2 (Optional): Query the Result Using task_id
If you want to actively check progress, you can query POST /captcha/tasks using the task_id returned in the previous step (once every 3–5 seconds is recommended). This endpoint does not trigger or advance task processing; reading a ready result follows the existing one-time billing behavior:
curl -X POST 'https://api.acedata.cloud/captcha/tasks' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
"task_id": "61138bb6-19aa-11ec-a9c8-0242ac110002"
}'
While processing, status: processing is returned:
{
"success": true,
"task_id": "61138bb6-19aa-11ec-a9c8-0242ac110002",
"status": "processing"
}
When processing is complete, status: ready and the corresponding result fields are returned—the field structure is exactly the same as in synchronous mode:
- token series (hcaptcha, recaptcha2, recaptcha3) returns
token:
{
"success": true,
"task_id": "61138bb6-19aa-11ec-a9c8-0242ac110002",
"status": "ready",
"started_at": 1784885653.0,
"finished_at": 1784885665.4,
"elapsed": 12.4,
"token": "03AFcWeA5kjJyDQ9S1a9UYimR6nuxnpEnAs5x2Pixao0dXZhMB......"
}
- recognition classification (recognition/recaptcha2, recognition/hcaptcha) returns
solution; recognition/image2text returnstext.
/captcha/tasks works with all CAPTCHA endpoints (the token and recognition series); simply poll using the same task_id.
The server continues processing from the time of creation, for a maximum of 120 seconds. If the final query at the deadline still does not obtain a result, HTTP 504 is persisted. This status is terminal, and the client should stop polling; repeated queries using the same task_id will consistently return the same failure result:
{
"detail": "The captcha task timed out.",
"code": "timeout",
"success": false,
"task_id": "61138bb6-19aa-11ec-a9c8-0242ac110002",
"status": "failed",
"started_at": 1784885653.0,
"finished_at": 1784885765.4,
"elapsed": 112.4
}
Both status: ready and HTTP 504 terminal responses include timing fields.
started_at, the time task processing began, as a Unix timestamp (seconds, floating-point).finished_at, the time the task produced a result, as a Unix timestamp (seconds, floating-point). This field is not returned while processing is still in progress.elapsed, the task processing duration in seconds (floating-point, rounded to 3 decimal places). This field is not returned while processing is still in progress.
¶ Billing
In asynchronous mode, creating a task and reading the “processing” status are not charged; a one-time charge is applied when the client first reads a successful result (consistent with existing behavior and synchronous-mode pricing). The server advances the task independently, but does not charge in advance simply because it completes in the background. Tasks that do not succeed within the 120-second deadline terminate with HTTP 504 and are not charged.
¶ Error Handling
When calling this endpoint, if an error occurs, the corresponding error code and message are returned. For example:
400 invalid_request: The request is missing thetask_idparameter.401 invalid_token: Unauthorized; the authorization Token is invalid or missing.404 not_found: Thetask_iddoes not exist or does not belong to the current account.504 timeout: The task has terminated without producing a result; please stop polling thistask_id. This failure is not charged.
¶ Example Error Response
{
"success": false,
"error": {
"code": "not_found",
"message": "task not found"
}
}
