Yandex SmartCaptcha

Yandex SmartCaptcha widget

Token-based method for automated solving of reCAPTCHA V3.

Yandex SmartCaptcha is a captcha made by Yandex. The captcha looks like a mix of reCAPTCHA V3 with normal captcha or interactive captchas.

First you click on I'm not a robot checkbox and captcha checks the fingerprint of your browser. Then, if you don't appear to be a human, an additional challenge is shown - a normal captcha with some text or an interactive challenge asking to click on the image.

After the challenge is completed a token is generated. The token is sent to Yandex Captcha API for verification through the website backend.

The captcha is quite flexible, has a callback option and provides smartCaptcha.render, smartCaptcha.execute, smartCaptcha.reset and smartCaptcha.getResponse methods well-known by reCAPTCHA JavaScript API that allows webiste owners to perform quick migration.

Task types

  • YandexSmartCaptchaTaskProxyless - we use our own pool of proxies
  • YandexSmartCaptchaTask - we use your proxies

YandexSmartCaptchaTaskProxyless task type specification

Property Type Required Description
type String Yes Task type:
YandexSmartCaptchaTaskProxyless
YandexSmartCaptchaTask
websiteURL String Yes The full URL of target web page where the captcha is loaded. We do not open the page, not a problem if it is available only for authenticated users
websiteKey String Yes Yandex SmartCaptcha sitekey. The sitekey can be found in the captcha's iframe URL or inside smartCaptcha.render call options.
userAgent String No User-Agent of your browser will be used to load the captcha. Use only modern browser's User-Agents

YandexSmartCaptchaTask task type specification

YandexSmartCaptchaTask extends YandexSmartCaptchaTaskProxyless adding a set of proxy-related parameters listed below

Property Type Required Description
proxyType String Yes Proxy type:
http
socks4
socks5
proxyAddress String Yes Proxy IP address or hostname
proxyPort Integer Yes Proxy port
proxyLogin String No Login for basic authentication on the proxy
proxyPassword String No Password for basic authentication on the proxy

Request examples

Method: createTask
API endpoint: https://2captcha.com/createTask

YandexSmartCaptchaTaskProxyless request example

{
    "clientKey":"YOUR_API_KEY",
    "task":{
        "type":"YandexSmartCaptchaTaskProxyless",
        "websiteKey":"AbC0defgHiJKLm12Opq34rst5uV6w7XYzaBcdE8f",
        "websiteURL":"https://example.com",
    }
}

YandexSmartCaptchaTask request example

{
    "clientKey":"YOUR_API_KEY",
    "task":{
        "type":"YandexSmartCaptchaTask",
        "websiteKey":"AbC0defgHiJKLm12Opq34rst5uV6w7XYzaBcdE8f",
        "websiteURL":"https://example.com",
        "proxyType":"http",
        "proxyAddress":"1.2.3.4",
        "proxyPort":"8080",
        "proxyLogin":"user23",
        "proxyPassword":"p4$$w0rd"
    }
}

Response example

{
    "errorId": 0,
    "status": "ready",
    "solution": {
        "token": "dD0xNjkzNDg1NzQ0O2k9OT...NWExOTJjMzA1ZDNkZTg="
    },
    "cost": "0.00299",
    "ip": "1.2.3.4",
    "createTime": 1692863536,
    "endTime": 1692863556,
    "solveCount": 1
}

Code examples

// https://github.com/2captcha/2captcha-php

require(__DIR__ . '/../src/autoloader.php');

$solver = new \TwoCaptcha\TwoCaptcha('YOUR_API_KEY');

try {
    $result = $solver->recaptcha([
        'sitekey' => '6LfB5_IbAAAAAMCtsjEHEHKqcB9iQocwwxTiihJu',
        'url'     => 'https://2captcha.com/demo/recaptcha-v3',
        'version' => 'v3',
        'action'  => 'test',
    ]);
} catch (\Exception $e) {
    die($e->getMessage());
}

die('Captcha solved: ' . $result->code);
Yandex captcha = new Yandex();
  captcha.SetSiteKey("Y5Lh0tiycconMJGsFd3EbbuNKSp1yaZESUOIHfeV");
  captcha.SetUrl("https://rutube.ru");
```java
Yandex captcha = new Yandex();
captcha.setSiteKey("Y5Lh0tiycconMJGsFd3EbbuNKSp1yaZESUOIHfeV");
captcha.setUrl("https://rutube.ru");
```
```ruby
require 'api_2captcha'

client =  Api2Captcha.new("YOUR_API_KEY")

result = client.yandex({
sitekey: 'AbC0defgHiJKLm12Opq34rst5uV6w7XYzaBcdE8f',
pageurl: 'https://example.com',
})
```