Guide
getTaskResult: Task Result

getTaskResult: request task result

When the task initiated by createTask is an asynchronous task, get the asynchronous task result through getTaskResult.

  1. The maximum number of query requests for each task is 120. When the number of query requests exceeds, the task results will be lost
  2. Each task can be queried within 5 minutes after it is created, and will be lost after the time exceeds
  3. The recognition result obtained by this method, depending on the system load, you will get the result within a time interval of 1s to 30s.
WARNING

Please note that not all tasks need to get results this way. The following two tasks need to check the documents.

  • Identify class tasks, ImageToText, etc, that are synchronized directly through createTask return results

Example request

POST https://api.capsolver.com/getTaskResult
Host: api.capsolver.com
Content-Type: application/json
 
{
    "clientKey":"YOUR_API_KEY",
    "taskId": "37223a89-06ed-442c-a0b8-22067b79c5b4" //ID created by the createTask method
}

Request Parameters

ParametersTypeRequiredDescription
clientKeystringYesClient account key, can be found here
taskIdstringYesID created by the createTask method

Example response

{
    "errorId": 0,
	"taskId": "...",
    "solution": {
        "userAgent": "xxx",
        "gRecaptchaResponse": "03AGdBq25SxXT-pmSeBXjzScW-EiocHwwpwqtk1QXlJnGnUJCZrgjwLLdt7cb0..."
    },
    "status": "ready"
}

Response Structure

ParametersTypeDescription
errorIdIntegerError message:
0 - no error
1 - with error
errorCodeStringerrorCode: full list of errors
errorDescriptionStringError Description
statusString• idle - Waiting
• processing - Under identification
• ready - The identification is complete and the result is found in the solution parameter
solutionObjectTask result data. Different for each type of task

Response specification

  • Recognition success: When errorId equals 0 and status equals ready , the result is in solution.

  • Identifying: When errorId equals 0 and status equals processing , please try again in 3 seconds.

  • Error: When errorId is greater than 0, please know the error information according to errorDescription.

    errorCode: full list of errors