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.
POST
https://api.yescaptcha.com/getTaskResultGlobal endpointPOST
https://cn.yescaptcha.com/getTaskResultChina endpointRequest fields
Section titled “Request fields”| 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" }Response
Section titled “Response”| 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
taskIdwithin 5 seconds returnprocessingright away. - A task runs for at most about 110 seconds (180 to 220 seconds for a few types); then it returns
ERROR_TASK_TIMEOUTand is refunded. Give up waiting in your code after about 3 minutes. - Results are kept for about 10 minutes, after which the
taskIdreturnsERROR_TASKID_INVALID. Use results promptly: tokens expire sooner (about 120 seconds for reCAPTCHA). - Stop on errors. After
errorId: 1, querying the sametaskIdagain returns the same result; from the third query of a finished task,errorDescriptionends with a hint to stop polling.ERROR_TASKID_INVALIDcounts toward the automatic pause (only the first time per ID). - Query on the same endpoint you created the task on.
getTaskResultis not affected by automatic pauses: tasks created before a pause can still be queried.