v1.0.0 2020-05-15 16:31 UTC

This package is auto-updated.

Last update: 2020-05-22 23:43:10 UTC


Works for solving captchas when scraping Google, YouTube, and other sites that use ReCaptcha.

ReCaptcha V2


use CaptchaSolver\TwoCaptcha;

$captcha = new TwoCaptcha([
    'key' => 'API_KEY_GOES_HERE',
    'proxy' => null // optional

$id = $captcha->sendReCaptchaV2("SITE_KEY", "PAGE_URL");


$response = $captcha->getReCaptchaV2($id);

// or combine the two calls into one that polls automatically every 5 seconds and times out after 90 seconds:

$response = $captcha->solveReCaptchaV2("SITE_KEY", "PAGE_URL", 90);

response should hold a "solution" token that looks something like this:


submit the captcha form given to you with that solution as g-recaptcha-response field along with any other relevant form fields, and you are done!


composer require athlon1600/php-captcha-solver dev-master


A useful mini web-application can be launched via:

php -S localhost:8000 -t public

and then visit:

Known issues

Sometimes solving the captcha will not get you through, and instead you would just get this message at the end:

so at this point there is not much else you can do other than not make any requests for a while until Google automatically unblocks your IP address.

Misc stuff

Make 'g-recaptcha-response' textarea visible on page:

document.getElementById('g-recaptcha-response').style = null;