Solve Google Recaptcha automatically
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 solving system is built 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 the 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. Learn how to find it in this article. |
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
#pip3 install anticaptchaofficial
from anticaptchaofficial.recaptchav2proxyon import *
solver = recaptchaV2Proxyon()
solver.set_verbose(1)
solver.set_key("YOUR_KEY")
solver.set_website_url("https://website.com")
solver.set_website_key("SITE_KEY")
#set optional custom parameter which Google made for their search page Recaptcha v2
#solver.set_data_s('"data-s" token from Google Search results "protection"')
# DO NOT USE PURCHASED/RENTED PROXIES ON PROXY SERVICES!!!
# THEY WILL NOT WORK!
# USE ONLY PROXIES YOU INSTALL YOURSELF ON YOUR OWN SERVER OR FAST VPS
# USE PROPER PROXY SOFTWARE LIKE SQUID !
# INSTALLATION INSTRUCTIONS:
# https://anti-captcha.com/apidoc/articles/how-to-install-squid
solver.set_proxy_address("PROXY_ADDRESS")
solver.set_proxy_port(1234)
solver.set_proxy_login("proxylogin")
solver.set_proxy_password("proxypassword")
solver.set_user_agent("Mozilla/5.0")
solver.set_cookies("test=true")
# Specify softId to earn 10% commission with your app.
# Get your softId here: https://anti-captcha.com/clients/tools/devcenter
solver.set_soft_id(0)
g_response = solver.solve_and_return_solution()
if g_response != 0:
print("g-response: "+g_response)
else:
print("task finished with error "+solver.error_code)
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"
}