Skip to content

getTaskResult

getTaskResult returns the result of an asynchronous task. Call it every 5 seconds after creating the task: keep waiting on processing, read solution on ready, and stop on an error. Queries are free no matter how many you make.

POSThttps://api.yescaptcha.com/getTaskResultGlobal endpoint
POSThttps://cn.yescaptcha.com/getTaskResultChina endpoint
Field Type Required Description
clientKey string Yes Your account key, the same one that created the task
taskId string Yes The task ID returned by createTask
{ "clientKey": "YOUR_CLIENT_KEY", "taskId": "61138bb6-19fb-11ec-a9c8-0242ac110006" }
Situation Response What to do
In progress {"errorId": 0, "status": "processing"} Check again in 5 seconds
Done {"errorId": 0, "status": "ready", "solution": {...}} Read solution; its fields are on each task type page
Not solved {"errorId": 1, "errorCode": "ERROR_CAPTCHA_UNSOLVABLE", ...} Already refunded; you can create a new task
Timed out {"errorId": 1, "errorCode": "ERROR_TASK_TIMEOUT", ...} Already refunded; you can create a new task
Unknown or expired task {"errorId": 1, "errorCode": "ERROR_TASKID_INVALID", ...} Stop querying this taskId

A finished task (reCAPTCHA v2):

{
"errorId": 0,
"status": "ready",
"solution": {
"gRecaptchaResponse": "03AGdBq25SxXT-pmSeBXjzScW-EiocHwwpwqtk1QXlJnGnU..."
}
}
  • Poll every 5 seconds. Repeated queries for the same taskId within 5 seconds return processing right away.
  • A task runs for at most about 110 seconds (180 to 220 seconds for a few types); then it returns ERROR_TASK_TIMEOUT and is refunded. Give up waiting in your code after about 3 minutes.
  • Results are kept for about 10 minutes, after which the taskId returns ERROR_TASKID_INVALID. Use results promptly: tokens expire sooner (about 120 seconds for reCAPTCHA).
  • Stop on errors. After errorId: 1, querying the same taskId again returns the same result; from the third query of a finished task, errorDescription ends with a hint to stop polling. ERROR_TASKID_INVALID counts toward the automatic pause (only the first time per ID).
  • Query on the same endpoint you created the task on.
  • getTaskResult is not affected by automatic pauses: tasks created before a pause can still be queried.