createTask : captcha task creating





ATTENTION

Documentation moved to a new place here.

Documentation at anticaptcha.atlassian.net is no longer updated and may be not actual.







This method creates a task for solving selected captcha type.

Method address: https://api.anti-captcha.com/createTask 
Request format: JSON POST

Request parameters:

Parameter
Type
Required
Purpose
clientKeyStringYesClient account key, can be found here
taskTask type objectYesTask data. See list of available object descriptions here.
softIdIntNoID of your application from out AppCenter,
this is required to earn 10% from clients spendings which use your application.
languagePoolStringNo

Sets workers pool language. At the moment the following language pools are available:

en (default) : English language queue
rn  : group of countries: Russia, Ukraine, Belarus, Kazahstan

callbackUrlStringNoOptional web address were will send result of captcha/factory task processing. Contents are sent by AJAX POST request and are similar to the contents of getTaskResult method.


Examples:


 CURL example for Recaptcha v2
Solve image captcha
curl -i -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -X POST -d '{
    "clientKey":"YOUR_API_KEY",
    "task":
        {
            "type":"NoCaptchaTaskProxyless",
            "websiteURL":"http://makeawebsitehub.com/recaptcha/test.php",
            "websiteKey":"6LfI9IsUAAAAAKuvopU0hfY8pWADfR_mogXokIIZ"
        },
    "softId":0,
    "languagePool":"en"
}' https://api.anti-captcha.com/createTask
 CURL example to test your JSON payload

In case you can't figure out what you send to our API, we have a test method which displays POST contents.

Solve image captcha
curl -i -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -X POST -d '{"name1":"value", "name2":"any json data here to see how it looks at our end"}' \
     https://api.anti-captcha.com/test
 JSON for image captcha
Solve image captcha
{
    "clientKey":"YOUR_API_KEY",
    "task":
        {
            "type":"ImageToTextTask",
            "body":"BASE64_BODY_HERE!",
            "phrase":false,
            "case":false,
            "numeric":false,
            "math":0,
            "minLength":0,
            "maxLength":0
        }
}
 JSON for Recaptcha v2
Recaptcha solving without proxy
{
    "clientKey":"YOUR_API_KEY",
    "task":
        {
            "type":"NoCaptchaTaskProxyless",
            "websiteURL":"http://mywebsite.com/recaptcha/test.php",
            "websiteKey":"6Lc_aCMTAAAAABx7u2N0D1XnVbI_v6ZdbM6rYf16"
        },
    "softId":0,
    "languagePool":"en"
}
 JSON for recaptcha v2 with proxy
Recaptcha solving with your proxy
{
    "clientKey":"YOUR_API_KEY",
    "task":
        {
            "type":"NoCaptchaTask",
            "websiteURL":"http://mywebsite.com/recaptcha/test.php",
            "websiteKey":"6Lc_aCMTAAAAABx7u2N0D1XnVbI_v6ZdbM6rYf16",
            "proxyType":"http",
            "proxyAddress":"8.8.8.8",
            "proxyPort":8080,
            "proxyLogin":"proxyLoginHere",
            "proxyPassword":"proxyPasswordHere",
            "userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"
        },
    "softId":0,
    "languagePool":"en"
}

For other captcha types check this section.



Response structure:

Parameter
Type
Purpose
errorIdIntegerError identificator.
0 - no errors, the task has been successfully created, task ID located in taskId property
>1 - error identificator. Error code and short information transferred in errorCode and errorDescription properties
errorCodeStringError code. Check out errors list.
errorDescriptionStringShort information describing error
taskIdIntegerTask ID for future use in getTask method.
Response example
{
    "errorId": 0,
    "taskId": 7654321
}