Skip to main content

hCaptcha

hCaptcha is a quite new type of captcha that is really similar to reCAPTCHA and looks like this:

Solving hCaptcha is pretty simple:

  1. Find the value of data-sitekey parameter in the source code of the page.

  2. Submit a HTTP GET or POST request to our API URL: https://ocr.captchaai.com/in.php with method set to hcaptcha and provide the value found on previous step as value for sitekey and full page URL as value for pageurl.
    You can find the full list of parameters in the table below.

    Request URL example:

    https://ocr.captchaai.com/in.php?key=1abc234de56fab7c89012d34e56fa7b8&method=hcaptcha&sitekey=10000000-ffff-ffff-ffff-000000000001&pageurl=https://mysite.com/register

  3. If everything is fine server will return the ID of your captcha as plain text, like: OK|2122988149 or as JSON {"status":1,"request":"2122988149"} if json parameter was used.
    Otherwise server will return an error code.

  4. Make a 15-20 seconds timeout then submit a HTTP GET request to our API URL: https://ocr.captchaai.com/res.php to get the result.
    The full list of parameters is in the table below.

    If captcha is already solved server will respond in plain text or JSON and return the answer token that looks like:

    P0_eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwYXNza2V5IjoiNGQ3MTI5ZmUtOTQxZi00NGQ4LWI5MzYtMzAwZjUyMmM3Yzc2IiwiZXhwIjoxNTY4MTA3MjY4LCJzaGFyZF9pZCI6MzAyMzQ1NDg4fQ.yJuANPBc1uzCw9tW6CoLqiijBgh6zF00KdsnqaJtugg

    If captcha is not solved yet server will return CAPCHA_NOT_READY result. Repeat your request in 5 seconds.

    If something went wrong server will return an error code.

  5. Place the token into h-captcha-response and g-recaptcha-response hidden elements and submit the form.
    Please note, hcaptcha also has a callback. If there is no form to submit you MUST explore the website code and find the callback.

List of GET/POST request parameters for https://ocr.captchaai.com/in.php

ParameterTypeRequiredDescription
keyStringYesyour API key
methodStringYeshcaptcha - defines that you're sending hCaptcha
sitekeyStringYesValue of data-sitekey parameter you found on page
pageurlStringYesFull URL of the page where you bypass the captcha
invisibleNumber
Default: 0
NoUse 1 for invisible version of hcaptcha. Currently it is a very rare case.
domainString
Default: hcaptcha.com
NoDomain used to load the captcha: hcaptcha.com or js.hcaptcha.com
dataStringNoCustom data that is used in some implementations of hCaptcha, mostly with invisible=1. In most cases you see it as rqdata inside network requests.
IMPORTANT: you MUST provide userAgent if you submit captcha with data paramater. The value should match the User-Agent you use when interacting with the target website.
userAgentStringNoYour userAgent that will be passed to our OCR server and used to solve the captcha.
Required for hCaptcha with data parameter.
header_acaoInteger
Default: 0
No0 - disabled
1 - enabled.
If enabled in.php will include Access-Control-Allow-Origin:* header in the response.
Used for cross-domain AJAX requests in web applications. Also supported by res.php.
jsonInteger
Default: 0
No0 - server will send the response as plain text
1 - tells the server to send the response as JSON
proxyStringNoFormat: login:password@123.123.123.123:3128
You can find more info about proxies here.
proxytypeStringNoType of your proxy: HTTP, HTTPS, SOCKS4, SOCKS5.

List of GET request parameters for https://ocr.captchaai.com/res.php

GET parameterTypeRequiredDescription
keyStringYesyour API key
actionStringYesget - get the asnwer for your captcha
idIntegerYesID of captcha returned by in.php.
jsonInteger
Default: 0
No0 - server will send the response as plain text
1 - tells the server to send the response as JSON

Request URL example:

https://ocr.captchaai.com/res.php?key=1abc234de56fab7c89012d34e56fa7b8&action=get&id=2122988149


Details

Get details about your account and threads.

Submit a HTTP GET or POST request to our API URL: https://ocr.captchaai.com/res.php with one of the following actions:

  • getbalance

It returns your plan threads number

Request URL example:

https://ocr.captchaai.com/res.php?key=347bc2896fc1812d3de5ab56a0bf4ea7&action=getbalance

Response example

600

  • threadsinfo

It returns your plan threads details (the threads & the working_threads) NEW

Request URL example:

https://ocr.captchaai.com/res.php?key=347bc2896fc1812d3de5ab56a0bf4ea7&action=threadsinfo

Response example

{"threads":"600","working_threads":553}