RecaptchaV2Task
The object contains data for Google ReCaptcha2 solving task. To ensure the universality of the solution to this type of captcha, you need to use all the data used when automating the filling of the form on the target site, including proxies, browser user-agent and cookies. This will help to avoid any problems when Google changes the code of its captcha.
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 60 seconds after we solves your ReCaptcha2.
If the proxy is authorized by IP, then be sure to add 116.203.55.208 to the white list.
Request parameters
- RecaptchaV2TaskProxyless (without proxy)
- RecaptchaV2Task (using proxy)
type
<string>requiredRecaptchaV2TaskProxyless
websiteURL
<string>requiredAddress of a webpage with captcha.
websiteKey
<string>requiredRecaptcha website key.<div class="g-recaptcha" data-sitekey="THIS_ONE"></div>
recaptchaDataSValue
<string>optionalSome custom implementations may contain additional "data-s" parameter in ReCaptcha2 div, which is in fact a one-time token and must be grabbed every time you want to solve a ReCaptcha2.<div class="g-recaptcha" data-sitekey="some sitekey" data-s="THIS_ONE"></div>
userAgent
<string>optionalBrowser's User-Agent which is used in emulation. It is required that you use a signature of a modern browser, otherwise Google will ask you to "update your browser".
cookies
<string>optionalAdditional cookies which we must use during interaction with target page or Google.
Format: cookiename1=cookievalue1; cookiename2=cookievalue2
isInvisible
<bool>optionaltrue if the captcha is invisible, i.e. has a hidden field for confirmation, no checkbox. If a bot is suspected, an additional check is called.
type
<string>requiredRecaptchaV2Task
websiteURL
<string>requiredAddress of a webpage with captcha.
websiteKey
<string>requiredRecaptcha website key.<div class="g-recaptcha" data-sitekey="THIS_ONE"></div>
recaptchaDataSValue
<string>optionalSome custom implementations may contain additional "data-s" parameter in ReCaptcha2 div, which is in fact a one-time token and must be grabbed every time you want to solve a ReCaptcha2.<div class="g-recaptcha" data-sitekey="some sitekey" data-s="THIS_ONE"></div>
userAgent
<string>optionalBrowser's User-Agent which is used in emulation. It is required that you use a signature of a modern browser, otherwise Google will ask you to "update your browser".
cookies
<string>optionalAdditional cookies which we must use during interaction with target page or Google.
Format: cookiename1=cookievalue1; cookiename2=cookievalue2
isInvisible
<bool>optionaltrue if the captcha is invisible, i.e. has a hidden field for confirmation, no checkbox. If a bot is suspected, an additional check is called.
proxyType
<string>requiredhttp - regular http/https proxy;
https - try this option only if "http" doesn't work (required for some custom proxies);
socks4 - socks4 proxy;
socks5 - socks5 proxy.
proxyAddress
<string>requiredIPv4/IPv6 proxy IP address. Not allowed:
- using of hostnames;
- using transparent proxies (where you can see the client's IP);
- using proxies on local machines.
proxyPort
<integer>requiredProxy port.
proxyLogin
<string>optionalProxy-server login.
proxyPassword
<string>optionalProxy-server password.
Create task method
- RecaptchaV2TaskProxyless (without proxy)
- RecaptchaV2Task (using proxy)
https://api.capmonster.cloud/createTask
Request
{
"clientKey":"API_KEY",
"task": {
"type":"RecaptchaV2TaskProxyless",
"websiteURL":"https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high",
"websiteKey":"6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd"
}
}
Response
{
"errorId":0,
"taskId":407533072
}
https://api.capmonster.cloud/createTask
Request
{
"clientKey":"API_KEY",
"task": {
"type":"RecaptchaV2Task",
"websiteURL":"https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high",
"websiteKey":"6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd",
"proxyType":"http",
"proxyAddress":"8.8.8.8",
"proxyPort":8080,
"proxyLogin":"proxyLoginHere",
"proxyPassword":"proxyPasswordHere",
"userAgent":"userAgentPlaceholder"
}
}
Response
{
"errorId":0,
"taskId":407533072
}
Get task result method
Use the getTaskResult method to request answer for ReCaptcha2. You will get response within 10 - 80 secs period depending on service workload.
https://api.capmonster.cloud/getTaskResult
Request
{
"clientKey":"API_KEY",
"taskId": 407533072
}
Response
{
"errorId":0,
"status":"ready",
"solution": {
"gRecaptchaResponse":"3AHJ_VuvYIBNBW5yyv0zRYJ75VkOKvhKj9_xGBJKnQimF72rfoq3Iy-DyGHMwLAo6a3"
}
}
Property | Type | Description |
---|---|---|
gRecaptchaResponse | String | Hash which should be inserted into Recaptcha2 submit form in <textarea id="g-recaptcha-response" ..></textarea> . It has a length of 500 to 2190 bytes. |
Use SDK Library
- JavaScript
- Python
- C#
// https://github.com/ZennoLab/capmonstercloud-client-js
import { CapMonsterCloudClientFactory, ClientOptions, RecaptchaV2ProxylessRequest, /*RecaptchaV2Request*/ } from '@zennolab_com/capmonstercloud-client';
document.addEventListener('DOMContentLoaded', async () => {
const cmcClient = CapMonsterCloudClientFactory.Create(new ClientOptions({ clientKey: '<your capmonster.cloud API key>' }));
console.log(await cmcClient.getBalance());
const recaptchaV2Request = new RecaptchaV2ProxylessRequest({
websiteURL: 'https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high',
websiteKey: '6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd',
});
// const recaptchaV2Request = new RecaptchaV2Request({
// websiteURL: 'https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high',
// websiteKey: '6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd',
// proxyType: 'http',
// proxyAddress: '8.8.8.8',
// proxyPort: 8080,
// proxyLogin: 'proxyLoginHere',
// proxyPassword: 'proxyPasswordHere',
// userAgent: 'userAgentPlaceholder',
// });
console.log(await cmcClient.Solve(recaptchaV2Request));
});
# https://github.com/ZennoLab/capmonstercloud-client-python
# ReСaptchaV2Proxyless:
import asyncio
from capmonstercloudclient import CapMonsterClient, ClientOptions
from capmonstercloudclient.requests import RecaptchaV2ProxylessRequest
client_options = ClientOptions(api_key="your_api_key") # Replace with your CapMonster Cloud API key
cap_monster_client = CapMonsterClient(options=client_options)
recaptcha2request = RecaptchaV2ProxylessRequest(
websiteUrl="https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high", # URL with captcha
websiteKey="6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd" # Replace with the correct website key
)
async def solve_captcha():
return await cap_monster_client.solve_captcha(recaptcha2request)
responses = asyncio.run(solve_captcha())
print(responses)
# ReСaptchaV2:
import asyncio
from capmonstercloudclient import CapMonsterClient, ClientOptions
from capmonstercloudclient.requests import RecaptchaV2Request
client_options = ClientOptions(api_key="your_api_key") # Replace with your CapMonster Cloud API key
cap_monster_client = CapMonsterClient(options=client_options)
recaptcha2_request = RecaptchaV2Request(
websiteUrl="https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high", # URL with captcha
websiteKey="6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd", # ReCaptcha v2 site key
proxyType="http",
proxyAddress="8.8.8.8",
proxyPort=8080,
proxyLogin="proxyLoginHere",
proxyPassword="proxyPasswordHere",
userAgent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36" # Use the current userAgent
)
async def solve_captcha():
return await cap_monster_client.solve_captcha(recaptcha2_request)
response = asyncio.run(solve_captcha())
print(response)
// https://github.com/ZennoLab/capmonstercloud-client-dotnet
// ReСaptchaV2Proxyless:
using Zennolab.CapMonsterCloud.Requests;
using Zennolab.CapMonsterCloud;
class Program
{
static async Task Main(string[] args)
{
var clientOptions = new ClientOptions
{
ClientKey = "your_api_key" // Replace with your CapMonster Cloud API key
};
var cmCloudClient = CapMonsterCloudClientFactory.Create(clientOptions);
var recaptchaV2Request = new RecaptchaV2ProxylessRequest
{
WebsiteUrl = "https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high", // URL with captcha
WebsiteKey = "6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd", // Replace with the correct website key
};
var recaptchaV2Result = await cmCloudClient.SolveAsync(recaptchaV2Request);
Console.WriteLine("Captcha Solution: " + recaptchaV2Result.Solution.Value);
}
}
// ReСaptchaV2:
using Zennolab.CapMonsterCloud.Requests;
using Zennolab.CapMonsterCloud;
class Program
{
static async Task Main(string[] args)
{
var clientOptions = new ClientOptions
{
ClientKey = "your_api_key" // Replace with your CapMonster Cloud API key
};
var cmCloudClient = CapMonsterCloudClientFactory.Create(clientOptions);
var recaptchaV2Request = new RecaptchaV2Request
{
WebsiteUrl = "https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high", // URL with captcha
WebsiteKey = "6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd", // Replace with the correct website key
ProxyType = ProxyType.Http,
ProxyAddress = "8.8.8.8",
ProxyPort = 8080,
ProxyLogin = "proxyLoginHere",
ProxyPassword = "proxyPasswordHere"
};
var recaptchaV2Result = await cmCloudClient.SolveAsync(recaptchaV2Request);
Console.WriteLine("Captcha Solution: " + recaptchaV2Result.Solution.Value);
}
}