Documentation menu

How to submit form with Recaptcha

  1. Go to the target website, this one for example.

  2. Find this HTML tag with sitekey parameter:

    HTML
                  <div class=g-recaptcha data-sitekey=6LfydQgUAAAAAMuh1gRreQdKjAop7eGmi6TrNIzp></div>
                

    If you don't see it in source code, check out this article.
  3. Send to API this sitekey and page address in a RecaptchaV2TaskProxyless object.
  4. Our service solves your captcha and returns you a token. Its like a long password with lots of letters.
  5. Use this token to submit your form to the target website. To identify correct property in the request, use any browser tool for developers.

    CURL
              curl 'https://anti-captcha.com/tutorials/submit1.php' \
    -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:88.0) Gecko/20100101 Firefox/88.0' \
    -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' \
    -H 'Accept-Language: en-US;q=0.5' \
    -H 'Content-Type: application/x-www-form-urlencoded' \
    -H 'Origin: https://anti-captcha.com' \
    -H 'Connection: keep-alive' \
    -H 'Referer: https://anti-captcha.com/tutorials?page=recaptcha_v2_textarea' \
    -H 'Cookie: lang_id=2;' \
    -X POST -d 'login=thelogin&pass=thepassword&g-recaptcha-response=TOKEN_FROM_ANTI_CAPTCHA_GOES_HERE'
            
  6. Check if the result of submission is what you've expected.

Our free NodeJS tutorials contain video lessons which consider more complex implementations of forms with Recaptcha.


Graphical explanation