Yandex SmartCaptcha
We offer two methods for solving Yandex SmartCaptcha in API v2: token-based and image coordinates.
Use the
https://api.2captcha.com/createTaskendpoint to work with this method and get the result viahttps://api.2captcha.com/getTaskResult.
Method specifications
- YandexSmartCaptchaTaskProxyless — solving using our proxies
- YandexSmartCaptchaTask — solving using your proxies
- CoordinatesTask — solving captcha by image, returning coordinates
Token-based solving
YandexSmartCaptchaTaskProxyless / YandexSmartCaptchaTask
| Property | Type | Required | Description |
|---|---|---|---|
| type | String | Yes | Task type: YandexSmartCaptchaTaskProxyless or YandexSmartCaptchaTask |
| websiteURL | String | Yes | Full URL of the page where the captcha is loaded |
| websiteKey | String | Yes | The sitekey value from the page code or captcha iframe |
| userAgent | String | No | Your userAgent to be used during solving |
| cookies | String | No | Cookies to send in the request, format: name1=value1;name2=value2 |
Proxy parameters (only for YandexSmartCaptchaTask)
| Property | Type | Required | Description |
|---|---|---|---|
| proxyType | String | Yes | Proxy type: http, https, socks4, socks5 |
| proxyAddress | String | Yes | IP address or hostname of the proxy server |
| proxyPort | Number | Yes | Proxy server port |
| proxyLogin | String | No | Login for proxy authorization |
| proxyPassword | String | No | Password for proxy authorization |
Request example
Method: createTask
Endpoint: https://api.2captcha.com/createTask
json
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "YandexSmartCaptchaTaskProxyless",
"websiteURL": "https://mysite.com/",
"websiteKey": "Y5Lh0ti..."
}
}
Response example
Method: getTaskResult
Endpoint: https://api.2captcha.com/getTaskResult
json
{
"errorId": 0,
"status": "ready",
"solution": {
"token": "dV9xNjYyNTU3NjkxO4k9OTQuNVMuMjkuMjM9O9Q9MVEzQUEwMURERTY3RkUxQ9U3MTlEQzE3RjhYNTJCQUFFN9YyQTc3QUNFQjk9NzhVOTZGNjVCOEUyOVM4RTg9Q9VEQzY9NzY4O3U9MTY4MjU3NTY5MTQ4MTI3MVUyNVTo2ImVWMmQ4NWQzNjdlNzM9MVYhOGI5NWMxNWZlM4E4"
}
}
Use the received token in the
smart-tokenfield or pass it to the site backend similar to manual captcha solving.
Image-based solving (CoordinatesTask)
Returns click coordinates or object order, not a token. Suitable for visual Yandex SmartCaptcha tasks.
Task specification
| Property | Type | Required | Description |
|---|---|---|---|
| type | String | Yes | Task type: CoordinatesTask |
| body | String | Yes | Main captcha image in Base64 format |
| imgType | String | Yes | Captcha type: smart_captcha or pazl_smart_captcha |
| imgInstructions | String | No* | Instruction image in Base64. * Required for imgType=smart_captcha |
| comment | String | No* | Text hint for the worker. * Recommended for imgType=smart_captcha, e.g., select objects in the order of the instruction |
Option 1: Selecting objects by instruction (smart_captcha)
json
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "CoordinatesTask",
"body": "BASE64_IMAGE",
"imgType": "smart_captcha",
"imgInstructions": "BASE64_INSTRUCTION_IMAGE",
"comment": "select objects in the order of the instruction"
}
}
Option 2: Puzzle captcha (pazl_smart_captcha)
json
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "CoordinatesTask",
"body": "BASE64_IMAGE",
"imgType": "pazl_smart_captcha"
}
}
Response example
json
{
"errorId": 0,
"status": "ready",
"solution": {
"coordinates": [
{"x": 57, "y": 82},
{"x": 239, "y": 75},
{"x": 138, "y": 113},
{"x": 154, "y": 42},
{"x": 230, "y": 155}
]
}
}
For
smart_captcha, you must passimgInstructions— without it, the worker may misunderstand the task. Thecommentparameter helps clarify the action order, especially if the instruction on the image is not obvious.