Use this type of task to solve Recaptchas in Google services. In all other cases use RecaptchaV2TaskProxyless to solve Recaptcha in proxy-off mode. Google’s API does not disclose the solver’s IP address to website owners.
Our system is build so that a worker’s browsers don’t have access to your proxy servers. This data is stored on our server and is removed as soon as the task is completed. Workers’ computers interact only with our servers. Your proxy is accessed only from one IP address.
Before executing this type of task, our proxy checker might test your proxy for compatibility by making a series of test requests. If these test requests fail, your task will be marked with ERROR_PROXY_CONNECT_TIMEOUT or a similar error and will be canceled. During the solution process, your proxy also might fail and our API will produce other proxy errors.
Task object
Property | Type | Required | Purpose |
---|---|---|---|
type | String | Yes | RecaptchaV2Task Previous task name: ‘NoCaptchaTask’. We will continue supporting old task name forever, no need to update your code. |
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 | Recaptcha website key. |
recaptchaDataSValue | String | No | Value of ‘data-s’ parameter. Applies only to Recaptchas on Google web sites. |
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”. |
cookies | String | No | Additional cookies that we should use in Google domains. |
isInvisible | Boolean | No | Specify whether or not Recaptcha is invisible. This will render an appropriate widget for our workers. |
Request example
curl -i -H "Accept: application/json" \
-H "Content-Type: application/json" \
-X POST -d '{
"clientKey":"YOUR_API_KEY",
"task":
{
"type":"RecaptchaV2Task",
"websiteURL":"http://mywebsite.com/recaptcha/test.php",
"websiteKey":"6Lc_aCMTAAAAABx7u2N0D1XnVbI_v6ZdbM6rYf16",
"proxyType":"http",
"proxyAddress":"8.8.8.8",
"proxyPort":8080,
"proxyLogin":"proxyLoginHere",
"proxyPassword":"proxyPasswordHere",
"userAgent":"MODERN_USER_AGENT_HERE",
"cookie":"cookiename1=cookievalue1; cookiename2=cookievalue2"
}
}' 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. |
cookies | Array | Optional array of cookies used for solving Recaptchas. Applies only for google.com domains and subdomains. |
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"
}