Skip to content

hCaptcha

An hCaptcha task returns a token (gRecaptchaResponse). Submit it to the target site together with the returned userAgent (and respKey, when present) to pass the check. HCaptchaTaskProxyless costs 30 points (¥0.03) per task and HCaptchaTask (your own proxy) costs 15 points (¥0.015); both are asynchronous: createTask, then getTaskResult every 5 seconds. Failed and timed-out tasks are refunded automatically.

POSThttps://api.yescaptcha.com/createTaskGlobal endpoint
POSThttps://cn.yescaptcha.com/createTaskChina endpoint

The request body is JSON authenticated with your clientKey. Query results on the same endpoint you created the task on.

The page shows an hCaptcha “I am human” checkbox or an hCaptcha image challenge. Use the types on this page to get a token; to click the images yourself in a browser, use hCaptcha image recognition.

hCaptcha pass rates vary a lot between sites; test with a small batch first.

Task typePriceModeNotes
HCaptchaTaskProxyless30 points (¥0.03)Asynchronous
HCaptchaTaskProxylessM130 points (¥0.03)AsynchronousSame parameters as HCaptchaTaskProxyless on a different route; use either as a fallback
HCaptchaTask15 points (¥0.015)AsynchronousOwn proxy
  • HCaptchaTaskProxyless and HCaptchaTaskProxylessM1 take the same parameters on different routes; use either as a fallback for the other.
  • HCaptchaTask loads the captcha through your own proxy and needs the proxy fields; use it when the site checks the visitor’s IP.
FieldTypeRequiredDescription
typestringYesTask type; see "Task types and pricing" on this page
websiteURLstringYesFull URL of the page that shows the captcha. Use the site you see the captcha on, not the captcha vendor's domain
websiteKeystringYesThe hCaptcha site key (sitekey), usually a UUID
userAgentstringNoBrowser User-Agent. Recommended, but only the value returned by GET https://api.yescaptcha.com/useragent is accepted; submit the token with the userAgent from the result
isInvisiblebooleanNoSet to true for the invisible variant; omit otherwise
rqdatastringNorqdata for enterprise hCaptcha; required by some sites and usually found in the request that loads the captcha
proxyTypestringRequired for HCaptchaTaskProxy protocol: http, https, socks4 or socks5
proxyAddressstringRequired for HCaptchaTaskProxy IP address or hostname. Local or private addresses such as 127.0.0.1 or 192.168.x.x will not work because our servers cannot reach them
proxyPortintegerRequired for HCaptchaTaskProxy port
proxyLoginstringNoProxy username, if the proxy requires authentication (HCaptchaTask only)
proxyPasswordstringNoProxy password, if the proxy requires authentication (HCaptchaTask only)
  • websiteURL is the page that shows the captcha, not hcaptcha.com.
  • userAgent is recommended, but only the value returned by /useragent is accepted.
  • rqdata: required by sites using hCaptcha Enterprise (some social and chat sites) and usually found in the request that loads the captcha. Omit it for ordinary sites.

How to find them: Find hCaptcha parameters.

POST https://api.yescaptcha.com/createTask
{
"clientKey": "YOUR_CLIENT_KEY",
"task": {
"type": "HCaptchaTaskProxyless",
"websiteURL": "https://accounts.hcaptcha.com/demo",
"websiteKey": "a5f74b19-9e45-40e0-b45d-47ff91b7a6c2"
}
}
终端窗口
curl -s https://api.yescaptcha.com/createTask \
-H 'Content-Type: application/json' \
-d '{
"clientKey": "YOUR_CLIENT_KEY",
"task": {
"type": "HCaptchaTaskProxyless",
"websiteURL": "https://accounts.hcaptcha.com/demo",
"websiteKey": "a5f74b19-9e45-40e0-b45d-47ff91b7a6c2"
}
}'
# Returns {"errorId":0,"taskId":"..."}; then poll every 5 seconds:
curl -s https://api.yescaptcha.com/getTaskResult \
-H 'Content-Type: application/json' \
-d '{"clientKey": "YOUR_CLIENT_KEY", "taskId": "TASK_ID"}'

With your own proxy:

POST https://api.yescaptcha.com/createTask
{
"clientKey": "YOUR_CLIENT_KEY",
"task": {
"type": "HCaptchaTask",
"websiteURL": "https://accounts.hcaptcha.com/demo",
"websiteKey": "a5f74b19-9e45-40e0-b45d-47ff91b7a6c2",
"proxyType": "http",
"proxyAddress": "proxy.example.com",
"proxyPort": 8080,
"proxyLogin": "user",
"proxyPassword": "pass"
}
}
{
"errorId": 0,
"status": "ready",
"solution": {
"gRecaptchaResponse": "P1_eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36",
"respKey": "E0_eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..."
}
}
FieldTypeDescription
gRecaptchaResponsestringThe token to submit to the target site. Single use, valid for about 120 seconds; use it within 60 seconds
userAgentstringThe User-Agent used to obtain the token. Use this value when you submit the token, even if it differs from the one you sent
respKeystringA value some sites require together with the token; submit it if present

To submit:

  1. Put the token in the page’s h-captcha-response field (and g-recaptcha-response, if present), or in whatever field the site’s API expects.
  2. Send the submission with the returned userAgent as the User-Agent.
  3. If a respKey was returned, submit it too as the site requires.

While in progress you get {"errorId": 0, "status": "processing"}; check again 5 seconds later. Handle errors by errorCode as described in Error codes.

hCaptcha decides based on the site’s settings, the visitor’s IP and browser environment, so pass rates vary by site. Use the returned userAgent; for IP-sensitive sites, use HCaptchaTask with your own proxy and submit through the same proxy; or compare with HCaptchaTaskProxylessM1.

Single use, valid for about 120 seconds. Submit it as soon as possible.