RecaptchaV3TaskProxyless
The object contains data for Google ReCaptcha3 solving task. This task will be executed by our service using our own proxy servers.
ReCaptcha3, unlike ReCaptcha2, does not require any action from the site visitor, it works invisibly in the background of the page, collecting and analyzing data about the user to determine whether he is a human or a bot. Based on this analytics, the site receives a trust rating (from 0.1 to 0.9).
When creating a task, you should additionally pass two parameters - pageAction and minScore.
Request parameters
type
<string>requiredRecaptchaV3TaskProxyless
websiteURL
<string>requiredAddress of a webpage with Google ReCaptcha.
websiteKey
<string>requiredRecaptcha website key.
https://www.google.com/recaptcha/api.js?render=THIS_ONE
minScore
<double>optionalValue from 0.1 to 0.9
pageAction
<string>optionalWidget action value. Website owner defines what user is doing on the page through this parameter. Default value: verify
Example:grecaptcha.execute('site_key', {action:'login_test'})
.
Create task method
https://api.capmonster.cloud/createTask
Request
{
"clientKey":"API_KEY",
"task": {
"type":"RecaptchaV3TaskProxyless",
"websiteURL":"https://lessons.zennolab.com/captchas/recaptcha/v3.php?level=beta",
"websiteKey":"6Le0xVgUAAAAAIt20XEB4rVhYOODgTl00d8juDob",
"minScore": 0.3,
"pageAction": "myverify"
}
}
Response
{
"errorId":0,
"taskId":407533072
}
Get task result method
Use the getTaskResult to request answer for ReCaptcha3. You will get response within 10 - 30 sec 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 Recaptcha3 submit form in <textarea id="g-recaptcha-response" ></textarea> . It has a length of 500 to 2190 bytes. |
How to Find All Required Parameters for Task Creation
Manually
- Open your website where the captcha appears in the browser.
- Right-click on the captcha element and select Inspect.
websiteKey
The public site key (sitekey). Usually, it can be found in the included script:
In Elements:
In the Network tab:
pageAction
The action name passed to grecaptcha.execute(). For example:
Automatically
A convenient way to automate the search for all necessary parameters. Some parameters are regenerated every time the page loads, so you'll need to extract them through a browser — either regular or headless (e.g., using Playwright). Since the values of dynamic parameters are short-lived, the captcha must be solved immediately after retrieving them.
The code snippets provided are basic examples for familiarization with extracting the required parameters. The exact implementation will depend on your captcha page, its structure, and the HTML elements/selectors it uses.
- JavaScript
- Python
- C#
Show code (in browser)
(() => {
const originalGrecaptcha = window.grecaptcha;
if (!originalGrecaptcha || !originalGrecaptcha.execute) {
console.warn("grecaptcha.execute not found. Wait until it loads.");
return;
}
window.__extractedParams = null;
window.grecaptcha = {
...originalGrecaptcha,
execute: function(sitekey, config) {
console.log("Captured!");
console.log("sitekey:", sitekey);
console.log("action:", config?.action);
window.__extractedParams = {
sitekey,
action: config?.action
};
return originalGrecaptcha.execute(sitekey, config);
},
ready: originalGrecaptcha.ready
};
console.log("grecaptcha.execute is wrapped. Click the button - parameters will be captured.");
})();
Show code (Node.js)
import { chromium } from "playwright";
(async () => {
const browser = await chromium.launch({ headless: false });
const context = await browser.newContext();
const page = await context.newPage();
const jsContents = [];
page.on("response", async (response) => {
try {
const url = response.url();
const ct = response.headers()["content-type"] || "";
if (ct.includes("javascript") || url.endsWith(".js")) {
const text = await response.text();
jsContents.push(text);
}
} catch (e) {}
});
const targetUrl = "https://lessons.zennolab.com/captchas/recaptcha/v3.php?level=beta";
await page.goto(targetUrl, { timeout: 60000 });
await page.waitForTimeout(3000);
const inlineScripts = await page.$$eval("script:not([src])", (scripts) =>
scripts.map((s) => s.textContent)
);
jsContents.push(...inlineScripts);
const executeRegex =
/grecaptcha\.execute\(\s*['"]
(?<sitekey>[^'"]+)['"]\s*,\s*\{[^}]*action\s*:\s*['"](?<action>[^'"]+)['"]/i;
let foundSitekey = null;
let foundAction = null;
for (const js of jsContents) {
const match = js.match(executeRegex);
if (match && match.groups) {
foundSitekey = match.groups.sitekey;
foundAction = match.groups.action;
break;
}
}
console.log({
sitekey: foundSitekey,
action: foundAction,
});
await browser.close();
})();
Show code
import asyncio
import re
from playwright.async_api import async_playwright
async def extract_recaptcha_v3_execute(url):
async with async_playwright() as p:
browser = await p.chromium.launch(headless=False)
context = await browser.new_context()
page = await context.new_page()
execute_pattern = re.compile(
r"grecaptcha\.execute\(\s*['\"]"
r"(?P<sitekey>[^'\"]+)['\"]\s*,\s*\{[^}]*action\s*:\s*['\"](?P<action>[^'\"]+)['\"]",
re.IGNORECASE
)
found_sitekey = None
found_action = None
js_contents = []
async def handle_response(response):
try:
ct = response.headers.get("content-type", "")
if "javascript" in ct or response.url.endswith(".js"):
text = await response.text()
js_contents.append(text)
except:
pass
page.on("response", handle_response)
await page.goto(url, timeout=60000)
await page.wait_for_timeout(3000)
inline_scripts = await page.locator("script:not([src])").all_text_contents()
js_contents += inline_scripts
for js in js_contents:
match = execute_pattern.search(js)
if match:
found_sitekey = match.group("sitekey")
found_action = match.group("action")
break
await browser.close()
print({
"sitekey": found_sitekey,
"action": found_action
})
asyncio.run(extract_recaptcha_v3_execute("https://lessons.zennolab.com/captchas/recaptcha/v3.php?level=beta"))
Show code
using System;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Microsoft.Playwright;
using System.Collections.Generic;
class Program
{
public static async Task Main(string[] args)
{
await ExtractRecaptchaV3Execute
("https://lessons.zennolab.com/captchas/recaptcha/v3.php?level=beta");
}
public static async Task ExtractRecaptchaV3Execute(string url)
{
using var playwright = await Playwright.CreateAsync();
var browser = await playwright.Chromium.LaunchAsync(new BrowserTypeLaunchOptions
{
Headless = false
});
var context = await browser.NewContextAsync();
var page = await context.NewPageAsync();
string foundSitekey = null;
string foundAction = null;
var jsContents = new List<string>();
page.Response += async (_, response) =>
{
try
{
var ct = response.Headers.ContainsKey("content-type") ?
response.Headers["content-type"] : "";
if ((ct != null && ct.Contains("javascript")) || response.Url.EndsWith(".js"))
{
var text = await response.TextAsync();
jsContents.Add(text);
}
}
catch { }
};
await page.GotoAsync(url, new PageGotoOptions { Timeout = 60000 });
await page.WaitForTimeoutAsync(3000);
var inlineScripts = await page.EvalOnSelectorAllAsync<string[]>(
"script:not([src])",
"els => els.map(e => e.textContent)"
);
jsContents.AddRange(inlineScripts);
var regex = new Regex(@"grecaptcha\.execute\(\s*['""]"
+ @"(?<sitekey>[^'""]+)['""]\s*,\s*\{[^}]*action\s*:\s*['""](?<action>[^'""]+)['""]",
RegexOptions.IgnoreCase);
foreach (var js in jsContents)
{
var match = regex.Match(js);
if (match.Success)
{
foundSitekey = match.Groups["sitekey"].Value;
foundAction = match.Groups["action"].Value;
break;
}
}
Console.WriteLine($"sitekey: {foundSitekey}");
Console.WriteLine($"action: {foundAction}");
await browser.CloseAsync();
}
}
Use SDK Library
- JavaScript
- Python
- C#
// https://github.com/ZennoLab/capmonstercloud-client-js
import { CapMonsterCloudClientFactory, ClientOptions, RecaptchaV3ProxylessRequest } 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 recaptchaV3Request = new RecaptchaV3ProxylessRequest({
websiteURL: 'https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high',
websiteKey: '6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd',
minScore: 0.6,
pageAction: 'some-action',
});
console.log(await cmcClient.Solve(recaptchaV3Request));
});
# https://github.com/Zennolab/capmonstercloud-client-python
import asyncio
from capmonstercloudclient import CapMonsterClient, ClientOptions
from capmonstercloudclient.requests import RecaptchaV3ProxylessRequest
client_options = ClientOptions(api_key="your_api_key") # Replace with your CapMonster Cloud API key
cap_monster_client = CapMonsterClient(options=client_options)
recaptcha_v3_request = RecaptchaV3ProxylessRequest(
websiteUrl="https://lessons.zennolab.com/captchas/recaptcha/v3.php?level=beta", # URL with captcha
websiteKey="6Le0xVgUAAAAAIt20XEB4rVhYOODgTl00d8juDob", # Replace with the correct website key
minScore=0.6,
pageAction="myverify"
)
async def solve_captcha():
return await cap_monster_client.solve_captcha(recaptcha_v3_request)
responses = asyncio.run(solve_captcha())
print(responses)
// https://github.com/ZennoLab/capmonstercloud-client-dotnet
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 recaptchaV3Request = new RecaptchaV3ProxylessRequest
{
WebsiteUrl = "https://lessons.zennolab.com/captchas/recaptcha/v3.php?level=beta", // URL with captcha
WebsiteKey = "6Le0xVgUAAAAAIt20XEB4rVhYOODgTl00d8juDob", // Replace with the correct website key
MinScore = 0.6,
PageAction = "myverify"
};
var recaptchaV3Result = await cmCloudClient.SolveAsync(recaptchaV3Request);
Console.WriteLine("Captcha Solution: " + recaptchaV3Result.Solution.Value);
}
}