Example output of getTaskResult:
Code Block | ||
---|---|---|
| ||
{
"gRecaptchaResponse":"3AHJ_VuvYIBNBW5yyv0zRYJ75VkOKvhKj9_xGBJKnQimF72rfoq3Iy-DyGHMwLAo6a3"
} |
With Google cookies:
theme | Midnight |
---|
ATTENTION |
---|
Documentation moved to a new place here.Documentation at anticaptcha.atlassian.net is no longer updated and may be not actual. |
* Previous task name: NoCaptchaTask. We will continue supporting old task name forever, no need to update your code.
This object of type Task contains data required to solve Google Recaptcha on a worker's computer. To provide solid universality for solving this type of task we have reproduce every piece of environment used for an automation task you plan to complete. This includes:
- proxy access
- browser's user-agent
- (optionally) cookies
This approach will eliminate all possible obstacles which Google might implement in the future.
Our system is build in a way that worker's browser doesn't have access to your proxy servers, cookies, etc. These data is stored on our server and gets removed right after task completion. Worker's computer interacts only with our servers.
Before performing this type of task our proxy checker might check your proxy parameters for validity by making a test request. If this test request fails, your task will be marked with ERROR_PROXY_TIMEOUT error and will be canceled.
This type of captcha might be solved a bit longer than usual image captcha, but this issue is compensated by the fact that g-captcha-response value we send to you is valid for the next 120 seconds after a worker solves your Recaptcha.
...
...
Object structure
...
...
...
...
...
Secret token for previous version of Recaptcha (now deprecated). In most cases websites use newer version and this token is not required.
Expand | ||
---|---|---|
| ||
Secret token is generated on Google server and inserted to web page every time a user visits the page. It looks something like this:
Token is valid for a couple of minutes after generation, after that you need to grab it again from the page. |
...
Type of the proxy
http - usual http/https proxy
https - try this only if "http" doesn't work (required by some custom proxy servers)
socks4 - socks4 proxy
socks5 - socks5 proxy
...
Proxy IP address ipv4/ipv6. Not allowed to use:
- host names instead of IPs
- transparent proxies (where client IP is visible)
- proxies from local networks (192.., 10.., 127...)
...
Additional cookies which we must use during interaction with target page or Google.
Format: cookiename1=cookievalue1; cookiename2=cookievalue2
...
Request example
Address https://api.anti-captcha.com/createTask
Code Block | ||
---|---|---|
| ||
{
"clientKey":"dce6bcbb1a728ea8d871de6d169a2057",
"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":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"
}
} |
Response:
Code Block | ||
---|---|---|
| ||
{
"errorId":0,
"taskId":407533072
} |
Grab the result
Use method getTaskResult to request solution. Give worker a time like 10 seconds before requesting it.
...
Property
...
Type
...
Description
...
Optional array of cookies which were used for Recaptcha solving.
Applicable only for google.com domains and subdomains.
...
At the new location we describe how to solve Recaptcha programmatically with Anti-Captcha API. The contents of the page are also available in translations: Russian: Как решить рекапчу автоматически |