Guide
createTask: Create Task

createTask:task creating

WARNING

Creates a task for solving selected captcha type.

Specify which type of captchas in the parameter.

For example:ImageToTextTask

You can View all supported task types

Example request

POST https://api.capsolver.com/createTask
Host: api.capsolver.com
Content-Type: application/json
 
{
    "clientKey":"YOUR_API_KEY",
    "appId": "APP_ID",
    "task": {
        "type":"ImageToTextTask",// Write below the type you need to identify
        "body":"BASE64 image"
    }
}

Request Parameters

ParametersTypeRequiredDescription
clientKeyStringYesClient account key, can be found in dashboard
appIdStringNoYour Developer appId, Apply in dashboard’s developer section
taskObjectYesTask object
callbackUrlStringNotoken will send (post) to this endpoint

Example response

Example of asynchronous task response

When a task is created as a token task or a special asynchronous task, the taskresult is obtained through the getTaskResult command

{
    "errorId": 0,
    "errorCode": "",
    "errorDescription": "",
    "taskId": "37223a89-06ed-442c-a0b8-22067b79c5b4" // Save this ID for the next step
}

Example of Synchronous task response

If the task type is image recognition, voice recognition, or some special tasks, the task result is directly returned. It can be judged by whether status is equal to ready

{
    "errorId": 0,
    "errorCode": "",
    "errorDescription": "",
    "status": "ready",
    "solution": {
        "text": "44795sds"
    },
    "taskId": "2376919c-1863-11ec-a012-94e6f7355a0b",
}

Response Structure

ParametersTypeDescription
errorIdIntegerError message:
0 - no error
1 - with error
errorCodeStringError code table
errorDescriptionStringError description
statusStringreturns the status, which can only be null or ready
solutionObjectThe synchronization task returns a result
taskIdStringID of the created task, Get Task results