hCaptcha devs call their captcha “a drop-in replacement for Recaptcha”. We tried to create the same thing in our API, so task properties are absolutely the same as in RecaptchaV2Task except for the “type” property.
IMPORTANT: hCaptcha seems to have a limit on solved tasks from one IP: about 3 items per 12 hours. Take this into account when you build the solving process through your proxy.
Task object
Property | Type | Required | Purpose |
---|---|---|---|
type | String | Yes | HCaptchaTask |
websiteURL | String | Yes | Address of a target web page. Can be located anywhere on the web site, even in a member area. Our workers don’t navigate there but simulate the visit instead. |
websiteKey | String | Yes | hCaptcha sitekey |
proxyType | String | Yes | Type of proxy http – usual http/https proxy socks4 – socks4 proxy socks5 – socks5 proxy |
proxyAddress | String | Yes | Proxy IP address ipv4/ipv6. No host names or IP addresses from local networks. |
proxyPort | Integer | Yes | Proxy port |
proxyLogin | String | No | Login for proxy which requires authorization (basic) |
proxyPassword | String | No | Proxy password |
userAgent | String | Yes | Browser’s User-Agent used in emulation. You must use a modern-browser signature; otherwise, Google will ask you to “update your browser”. |
Request example
curl -i -H "Accept: application/json" \
-H "Content-Type: application/json" \
-X POST -d '{
"clientKey":"YOUR_API_KEY",
"task":
{
"type":"HCaptchaTask",
"websiteURL":"https://hcaptcha.com/",
"websiteKey":"00000000-0000-0000-0000-000000000000",
"proxyType":"http",
"proxyAddress":"8.8.8.8",
"proxyPort":8080,
"proxyLogin":"proxyLoginHere",
"proxyPassword":"proxyPasswordHere",
"userAgent":"MODERN_USER_AGENT_HERE"
}
}' https://api.ocrdatasolutions.com/createTask
Response example
JSON with no errors
{
"errorId": 0,
"taskId": 7654321
}
JSON with an error
{
"errorId": 1,
"errorCode": "ERROR_KEY_DOES_NOT_EXIST",
"errorDescription": "Account authorization key not found in the system"
}
Retrieve the solution
Use method getTaskResult to request the solution. Give the worker about 5 seconds before making your first request. If the worker is still busy, retry in 3 seconds.
Task solution object
Property | Type | Purpose |
---|---|---|
gRecaptchaResponse | String | Token string required for interacting with the submit form on the target website. |
Response example
{
"errorId":0,
"status":"ready",
"solution":
{
"gRecaptchaResponse":"3AHJ_VuvYIBNBW5yyv0zRYJ75VkOKvhKj9_xGBJKnQimF72rfoq3Iy-DyGHMwLAo6a3"
},
"cost":"0.001500",
"ip":"46.98.54.221",
"createTime":1472205564,
"endTime":1472205570,
"solveCount":"0"
}