What is hCaptcha?
hCaptcha is the box with a checkbox that says “I am human”. When it isn’t sure about you, it opens a puzzle. You might be asked to click every picture with a bus, drag a piece into place, or pick the odd one out. When you pass, hCaptcha gives the page a response token.
You’ll find hCaptcha on sign-up pages, logins, ticket shops, game sites, forums, password resets and many other forms. Site owners like it because it blocks bots that try to make lots of accounts or send spam.
For a script, the hard part is the token. The website checks it with hCaptcha before it accepts the form. Without a fresh, real token, the form fails. DraxonCloud gets you that token through a simple API, so your script can send the form like anyone else.
How to solve hCaptcha with DraxonCloud
- Find the page with the hCaptcha box and copy its address.
- Copy the site key from the page (we show you where below).
- Send both to our API with the type
standard_hcaptcha. - Wait for the answer. One request can wait for you until it’s ready.
- Put the token in the form and submit it.
There is no browser to run and nothing to install. Any language that can send HTTP requests works.
What you send
website_url: the full address of the page that shows the captcha, likehttps://example.com/register.website_key: the hCaptcha site key. It is a public ID the site uses for its widget, and it looks like10000000-ffff-ffff-ffff-000000000001. To find it, right-click the page, choose “View page source” and search fordata-sitekey. If the widget is added by a script, open the developer tools, go to the Network tab, and look at the requests tohcaptcha.com. The site key is in their addresses assitekey=....rqdata(optional): extra data some sites attach to the challenge. Most sites don’t use it. If a site does, you’ll see anrqdatavalue in the requests the page sends tohcaptcha.com.invisible(optional): set it totrueif the site uses hCaptcha without a checkbox, where the check runs when you press the form’s button. You can often spot this asdata-size="invisible"in the page source.proxyanduser_agent(optional): leave them out unless you have a reason to use them.
What you get back
A solved task gives you solution.token. It is a long string that usually starts with P1_. Some answers also include a solution.user_agent. If you get one, use it as your User-Agent when you submit the form.
To use the token:
- Put it in the hidden field called
h-captcha-response. - Many sites also read
g-recaptcha-response, because hCaptcha fills both. Put the same token there too. - Submit the form. If the site sends the token in its own way (for example in a JSON body), watch your browser’s Network tab once and copy what the page does.
Tokens work once and don’t last long, so ask for one when you are ready to submit.
A quick example
Start a task:
curl -s -X POST https://draxon.one/api/captcha/v1/tasks \
-H "Authorization: Bearer $DRAXON_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "standard_hcaptcha",
"website_url": "https://example.com/register",
"website_key": "10000000-ffff-ffff-ffff-000000000001"
}'
Wait for the answer in one request:
curl -s -H "Authorization: Bearer $DRAXON_KEY" \
"https://draxon.one/api/captcha/v1/tasks/<id>?wait=30"
When it’s ready (some fields left out):
{
"status": "solved",
"solution": {
"token": "P1_eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..."
}
}
Which hCaptcha type do I need?
We offer three hCaptcha types. They take the same fields, so switching is easy.
standard_hcaptcha(this page): the right choice for most sites. Start here.enterprise_hcaptcha: for sites on hCaptcha Enterprise, the paid plan big companies use. These sites often send rqdata.hsw_hcaptcha: for sites that run hCaptcha’s full browser check (called HSW).
If tokens from the standard type keep getting refused, try the other two.
Already using another service?
Keep your code and only change the address and key.
- CapSolver and Anti-Captcha style:
createTaskwithHCaptchaTask,HCaptchaTaskProxylessorHCaptchaTurboTask. - 2Captcha style:
in.phpwithmethod=hcaptcha,sitekeyandpageurl. Put rqdata indata.
See Compatible APIs for the addresses and answer formats.
What it costs
You pay for each solved hCaptcha. The current price is in the box at the top of this page and on the pricing page. When you start a task, we set the price aside from your balance. You are only charged if you get a token. If the task fails or runs out of time, all of it comes back to you, and no task is ever charged twice.
Tips that save you time
- Copy the site key from the page you submit on. One site can use different keys on different pages.
- Fill both token fields.
h-captcha-responseandg-recaptcha-responsewith the same token covers most forms. - Ask for the token at the last moment. It works once and expires soon.
- Don’t guess rqdata. Send it only if the page really uses it.
- Use
?wait=30so one request waits for the answer. - Add an
Idempotency-Keyheader when you retry after a network error, so you never pay twice.
Code in Python and Node.js, every field and every error are in the hCaptcha docs.