getTaskResult: request task result
When the task initiated by createTask is an asynchronous task, get the asynchronous task result through getTaskResult.
- The maximum number of query requests for each task is 120. When the number of query requests exceeds, the task results will be lost
- Each task can be queried within 5 minutes after it is created, and will be lost after the time exceeds
- 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
Parameters | Type | Required | Description |
---|---|---|---|
clientKey | string | Yes | Client account key, can be found here |
taskId | string | Yes | ID created by the createTask method |
Example response
{
"errorId": 0,
"taskId": "...",
"solution": {
"userAgent": "xxx",
"gRecaptchaResponse": "03AGdBq25SxXT-pmSeBXjzScW-EiocHwwpwqtk1QXlJnGnUJCZrgjwLLdt7cb0..."
},
"status": "ready"
}
Response Structure
Parameters | Type | Description |
---|---|---|
errorId | Integer | Error message: 0 - no error 1 - with error |
errorCode | String | errorCode: full list of errors |
errorDescription | String | Error Description |
status | String | • idle - Waiting • processing - Under identification • ready - The identification is complete and the result is found in the solution parameter |
solution | Object | Task result data. Different for each type of task |
Response specification
-
Recognition success: When
errorId
equals0
andstatus
equalsready
, the result is insolution
. -
Identifying: When
errorId
equals0
andstatus
equalsprocessing
, please try again in 3 seconds. -
Error: When
errorId
is greater than0
, please know the error information according toerrorDescription
.