reCAPTCHA v2 Enterprise
CapMonster Cloud uses built-in proxies by default — their cost is already included in the service. You only need to specify your own proxies in cases where the website does not accept the token or access to the built-in services is restricted.
If you are using a proxy with IP authorization, make sure to whitelist the address 65.21.190.34.
The object contains data for Google reCAPTCHA Enterprise solving task. 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. Including, proxy access, browser's user-agent, cookies (optionally).
This type of captcha has no visual differences from ReCaptcha v2. You can see the difference by examining the captcha code, for example, in the developer tools under the Network tab in the requests:
Request URL (anchor): https://www.google.com/recaptcha/enterprise/anchor?ar=1&k=6Lf26sUnAAAAAIKLuWNYgRsFUfmI-3Lex3xT5N-s&co=aHR0cHM6Ly8yY2FwdGNoYS5jb206NDQz&hl=en&v=1kRDYC3bfA-o6-tsWzIBvp7k&size=normal&cb=43r1q2d3mx66
This type of captcha might be solved a bit longer than usual image captcha, but this issue is compensated by the fact that g-recaptcha-response value we send to you is valid for the next 60 seconds after we solves your ReCaptcha2.
Request parameters
type<string>requiredRecaptchaV2EnterpriseTask
websiteURL<string>requiredAddress of a webpage with Google ReCaptcha Enterprise.
websiteKey<string>requiredRecaptcha website key.<div class="g-recaptcha" data-sitekey="THIS_ONE"></div>
or <iframe title="reCAPTCHA" src="...;k=6LdIFr0ZAAAAAO3vz0O0OQrtAefzdJcWQM2TMYQH&... , where 6LdIFr0ZAAAAAO3vz0O0OQrtAefzdJcWQM2TMYQH - websiteKey
pageAction<string>optionalThe value of the action parameter sent by the ReCaptcha widget to Google, which is later visible to the site owner during verification. Specify this parameter if its value differs from the default: verify
Example in HTML:
grecaptcha.execute('site_key', {action:'login_test'}).
enterprisePayload<string>optionalSome implementations of the reCAPTCHA Enterprise widget may contain additional parameters that are passed to the “grecaptcha.enterprise.render” method along with the sitekey. For example: <pre lang="js" ><code>grecaptcha.enterprise.render("some-div-id", { sitekey: "6Lc_aCMTAAAAABx7u2N0D1XnVbI_v6ZdbM6rYf16" theme: "dark" s: "2JvUXHNTnZl1Jb6WEvbDyB...ugQA" });</code></pre>
apiDomain<string>optionalDomain address from which to load reCAPTCHA Enterprise. For example:
- www.google.com
- www.recaptcha.net
Don't use a parameter if you don't know why it's needed.
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
proxyType<string>optionalhttp - 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>optionalIPv4/IPv6 proxy IP address. Not allowed:
- using transparent proxies (where you can see the client's IP);
- using proxies on local machines.
proxyPort<integer>optionalProxy port.
proxyLogin<string>optionalProxy-server login.
proxyPassword<string>optionalProxy-server password.
For enterprisePayload - before calling it, you need to replace the grecaptcha.enterprise.render function with your own and take the value from its parameters. The function exists after loading the script, and the captcha is usually rendered immediately or based on a page event. If the captcha is rendered with the current field s on the client, then the token will most likely not be accepted.
The original function can be called without the s field.
apiDomain is the domain that hosts the API interface for interacting with reCAPTCHA, it is used to verify that the user passes the captcha.
Script
var __test_grc = undefined;
var __test_enterprise = undefined;
var __test_render = undefined;
var __test_render_widget = undefined;
var __test_render_args = undefined; // here will be the object with which render is called.
var __test_handler = {
get: function(target, name, receiver) {
if (name == 'enterprise') {
return __test_enterprise ? __test_enterprise : (__test_enterprise = new Proxy(target[name], __test_handler));
} else if (name == 'render') {
__test_render = target[name];
return (function(a, b) {
__test_render_args = b;
__test_render_widget = a;
return __test_render(a, {sitekey: b.sitekey}); });
} else {
return target[name];
}
}
};
Object.defineProperty(window, 'grecaptcha', {
enumerable: true,
configurable: false,
get: function() {
return __test_grc;
},
set: function(value) {
__test_grc = new Proxy(value, __test_handler);
}
});
Create task method
- RecaptchaV2EnterpriseTask (without proxy)
- RecaptchaV2EnterpriseTask (with proxy)
https://api.capmonster.cloud/createTask
Request
{
"clientKey":"API_KEY",
"task": {
"type":"RecaptchaV2EnterpriseTask",
"websiteURL":"https://mydomain.com/page-with-recaptcha-enterprise",
"websiteKey":"6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd",
"enterprisePayload": {
"s": "SOME_ADDITIONAL_TOKEN"
}
}
}
Response
{
"errorId":0,
"taskId":407533072
}
https://api.capmonster.cloud/createTask
Request
{
"clientKey":"API_KEY",
"task": {
"type":"RecaptchaV2EnterpriseTask",
"websiteURL":"https://mydomain.com/page-with-recaptcha-enterprise",
"websiteKey":"6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd",
"enterprisePayload": {
"s": "SOME_ADDITIONAL_TOKEN"
},
"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 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 Recaptcha2 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
Public site key (sitekey). You can find the websiteKey in the Elements:

Or in Network requests:

Automatically
To automate parameter extraction, you can retrieve them via a browser (regular or headless, e.g., using Playwright) or directly from HTTP requests. Since dynamic parameter values are short-lived, it is recommended to use them immediately after retrieval.
The provided code snippets are basic examples for learning how to extract the required parameters. The exact implementation will depend on your captcha page, its structure, and the HTML elements and selectors used.
- JavaScript
- Python
- C#
Show code (in browser)
(() => {
const payload = {};
let sitekey = null;
document.querySelectorAll('.g-recaptcha').forEach(div => {
if (div.dataset.sitekey) sitekey = div.dataset.sitekey;
for (const [key, value] of Object.entries(div.dataset)) {
if (key !== 'sitekey') {
payload[key] = value;
}
}
});
const scriptTags = Array.from(document.querySelectorAll("script:not([src])"));
const regex = /grecaptcha\.enterprise\.render\([^,]+,\s*\{(.*?)\}/s;
scriptTags.forEach(tag => {
const match = regex.exec(tag.textContent);
if (match) {
const obj = match[1];
const paramRegex = /(\w+)\s*:\s*['"]([^'"]+)['"]/g;
let p;
while ((p = paramRegex.exec(obj)) !== null) {
const key = p[1];
const val = p[2];
if (key === "sitekey") sitekey = val;
else payload[key] = val;
}
}
});
console.log("sitekey:", sitekey);
console.log("enterprisePayload:", payload);
})();
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();
let sitekey = null;
const enterprisePayload = {};
const targetUrl = 'https://example.com';
await page.goto(targetUrl, { timeout: 60000 });
await page.waitForTimeout(3000);
const recaptchaDivs = await page.$$('.g-recaptcha');
for (const div of recaptchaDivs) {
const attrs = ['data-sitekey', 'data-s', 'data-cdata', 'data-type', 'data-context'];
for (const attr of attrs) {
const val = await div.getAttribute(attr);
if (val) {
const key = attr.replace('data-', '');
if (key === 'sitekey') {
sitekey = val;
} else {
enterprisePayload[key] = val;
}
}
}
}
const inlineScripts = await page.$$eval("script:not([src])", (scripts) =>
scripts.map((s) => s.textContent)
);
const pattern = /grecaptcha\.enterprise\.render\([^,]+,\s*\{(.*?)\}/s;
for (const script of inlineScripts) {
const match = script.match(pattern);
if (match) {
const obj = match[1];
const keyValuePattern = /(\w+)\s*:\s*['"]([^'"]+)['"]/g;
let keyValueMatch;
while ((keyValueMatch = keyValuePattern.exec(obj)) !== null) {
const key = keyValueMatch[1];
const val = keyValueMatch[2];
if (key === 'sitekey') {
sitekey = val;
} else {
enterprisePayload[key] = val;
}
}
break;
}
}
console.log(`sitekey: ${sitekey}`);
console.log("enterprisePayload:");
for (const [key, value] of Object.entries(enterprisePayload)) {
console.log(` ${key}: ${value}`);
}
await browser.close();
})();
Show code
import asyncio
import re
from playwright.async_api import async_playwright
async def extract_recaptcha_v2_enterprise(url):
async with async_playwright() as p:
browser = await p.chromium.launch(headless=False)
context = await browser.new_context()
page = await context.new_page()
sitekey = None
enterprise_payload = {}
await page.goto(url, timeout=60000)
await page.wait_for_timeout(3000)
recaptcha_divs = await page.query_selector_all(".g-recaptcha")
for div in recaptcha_divs:
attrs = ["data-sitekey", "data-s", "data-cdata", "data-type", "data-context"]
for attr in attrs:
val = await div.get_attribute(attr)
if val:
key = attr.replace("data-", "")
if key == "sitekey":
sitekey = val
else:
enterprise_payload[key] = val
inline_scripts = await page.locator("script:not([src])").all_text_contents()
pattern = re.compile(r"grecaptcha\.enterprise\.render\([^,]+,\s*\{(.*?)\}", re.DOTALL)
for script in inline_scripts:
match = pattern.search(script)
if match:
obj = match.group(1)
for pair in re.finditer(r"(\w+)\s*:\s*['\"]([^'\"]+)['\"]", obj):
key = pair.group(1)
val = pair.group(2)
if key == "sitekey":
sitekey = val
else:
enterprise_payload[key] = val
break
await browser.close()
print(f"sitekey: {sitekey}")
print("enterprisePayload:")
for k, v in enterprise_payload.items():
print(f" {k}: {v}")
asyncio.run(extract_recaptcha_v2_enterprise("https://example.com"))
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 ExtractRecaptchaV2Enterprise("https://example.com");
}
public static async Task ExtractRecaptchaV2Enterprise(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 sitekey = null;
var enterprisePayload = new Dictionary<string, string>();
await page.GotoAsync(url, new PageGotoOptions { Timeout = 60000 });
await page.WaitForTimeoutAsync(3000);
var recaptchaDivs = await page.QuerySelectorAllAsync(".g-recaptcha");
foreach (var div in recaptchaDivs)
{
var sitekeyAttr = await div.GetAttributeAsync("data-sitekey");
if (!string.IsNullOrEmpty(sitekeyAttr))
sitekey = sitekeyAttr;
var attributes = new[] { "data-s", "data-cdata", "data-type", "data-context" };
foreach (var attr in attributes)
{
var value = await div.GetAttributeAsync(attr);
if (!string.IsNullOrEmpty(value))
{
enterprisePayload[attr.Replace("data-", "")] = value;
}
}
}
var scripts = await page.Locator("script:not([src])").AllTextContentsAsync();
var pattern = new Regex(@"grecaptcha\.enterprise\.render\([^,]+,\s*\{(.*?)\}",
RegexOptions.Singleline);
foreach (var script in scripts)
{
var match = pattern.Match(script);
if (match.Success)
{
var obj = match.Groups[1].Value;
var keyMatches = Regex.Matches(obj, @"(\w+)\s*:\s*['""]([^'""]+)['""]");
foreach (Match m in keyMatches)
{
var key = m.Groups[1].Value.Trim();
var val = m.Groups[2].Value.Trim();
if (key == "sitekey")
sitekey = val;
else
enterprisePayload[key] = val;
}
break;
}
}
Console.WriteLine($"Sitekey: {sitekey}");
Console.WriteLine("Enterprise Payload:");
foreach (var kv in enterprisePayload)
{
Console.WriteLine($" {kv.Key}: {kv.Value}");
}
await browser.CloseAsync();
}
}
Use the SDK library
- JavaScript
- Python
- C#
Show code (for browser)
// https://github.com/ZennoLab/capmonstercloud-client-js
import {
CapMonsterCloudClientFactory,
ClientOptions,
RecaptchaV2EnterpriseRequest
} from '@zennolab_com/capmonstercloud-client';
document.addEventListener('DOMContentLoaded', async () => {
const API_KEY = "YOUR_API_KEY"; // Specify your CapMonster Cloud API key
const client = CapMonsterCloudClientFactory.Create(
new ClientOptions({ clientKey: API_KEY })
);
// Basic example without proxy
// CapMonster Cloud automatically uses its own proxies
let recaptchaV2EnterpriseRequest = new RecaptchaV2EnterpriseRequest({
websiteURL: "https://mydomain.com/page-with-recaptcha-enterprise", // URL of the page with captcha
websiteKey: "6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd", // Replace with correct value
enterprisePayload: {
s: "SOME_ADDITIONAL_TOKEN", // Optional enterprise parameter
}
});
// Example of using your own proxy
// Uncomment this block if you want to use your own proxy
/*
const proxy = {
proxyType: "http",
proxyAddress: "123.45.67.89",
proxyPort: 8080,
proxyLogin: "username",
proxyPassword: "password"
};
recaptchaV2EnterpriseRequest = new RecaptchaV2EnterpriseRequest({
websiteURL: "https://mydomain.com/page-with-recaptcha-enterprise",
websiteKey: "6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd",
enterprisePayload: { s: "SOME_ADDITIONAL_TOKEN" },
proxy,
userAgent: "userAgentPlaceholder"
});
*/
// Optionally, you can check the balance
const balance = await client.getBalance();
console.log("Balance:", balance);
const result = await client.Solve(recaptchaV2EnterpriseRequest);
console.log("Solution:", result);
});
Show code (Node.js)
// https://github.com/ZennoLab/capmonstercloud-client-js
import { CapMonsterCloudClientFactory, ClientOptions, RecaptchaV2EnterpriseRequest } from '@zennolab_com/capmonstercloud-client';
const API_KEY = "YOUR_API_KEY"; // Specify your CapMonster Cloud API key
async function solveRecaptchaV2Enterprise() {
const client = CapMonsterCloudClientFactory.Create(
new ClientOptions({ clientKey: API_KEY })
);
// Basic example without proxy
// CapMonster Cloud automatically uses its own proxies
let recaptchaV2EnterpriseRequest = new RecaptchaV2EnterpriseRequest({
websiteURL: "https://mydomain.com/page-with-recaptcha-enterprise", // URL of the page with captcha
websiteKey: "6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd", // Replace with correct value
enterprisePayload: {
s: "SOME_ADDITIONAL_TOKEN", // Optional enterprise parameter
}
});
// Example of using your own proxy
// Uncomment this block if you want to use your own proxy
/*
const proxy = {
proxyType: "http",
proxyAddress: "123.45.67.89",
proxyPort: 8080,
proxyLogin: "username",
proxyPassword: "password"
};
recaptchaV2EnterpriseRequest = new RecaptchaV2EnterpriseRequest({
websiteURL: "https://mydomain.com/page-with-recaptcha-enterprise",
websiteKey: "6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd",
enterprisePayload: { s: "SOME_ADDITIONAL_TOKEN" },
proxy,
userAgent: "userAgentPlaceholder"
});
*/
// Optionally, you can check the balance
const balance = await client.getBalance();
console.log("Balance:", balance);
const result = await client.Solve(recaptchaV2EnterpriseRequest);
console.log("Solution:", result);
}
solveRecaptchaV2Enterprise().catch(console.error);
Show code
# https://github.com/ZennoLab/capmonstercloud-client-python
import asyncio
from capmonstercloudclient import CapMonsterClient, ClientOptions
from capmonstercloudclient.requests import RecaptchaV2EnterpriseRequest
# from capmonstercloudclient.requests.baseRequestWithProxy import ProxyInfo # Uncomment if you plan to use a proxy
API_KEY = "YOUR_API_KEY" # Specify your CapMonster Cloud API key
async def solve_recaptcha_v2_enterprise():
client_options = ClientOptions(api_key=API_KEY)
cap_monster_client = CapMonsterClient(options=client_options)
# Basic example without proxy
# CapMonster Cloud automatically uses its own proxies
recaptcha2request = RecaptchaV2EnterpriseRequest(
websiteUrl="https://example.com",
websiteKey="6Lf56sUnAAAAAIKLuONYgRsFUfmI-3Lex3xT5U-s",
enterprisePayload={
"s": "SOME_ADDITIONAL_TOKEN"
}
)
# Example of using your own proxy
# Uncomment this block if you want to use a custom proxy
# proxy = ProxyInfo(
# proxyType="http",
# proxyAddress="123.45.67.89",
# proxyPort=8080,
# proxyLogin="username",
# proxyPassword="password"
# )
# recaptcha2request = RecaptchaV2EnterpriseRequest(
# websiteUrl="https://example.com",
# websiteKey="6Lf56sUnAAAAAIKLuONYgRsFUfmI-3Lex3xT5U-s",
# enterprisePayload={
# "s": "SOME_ADDITIONAL_TOKEN"
# },
# proxy=proxy,
# userAgent="userAgentPlaceholder"
# )
# Optionally, you can check the balance
balance = await cap_monster_client.get_balance()
print("Balance:", balance)
result = await cap_monster_client.solve_captcha(recaptcha2request)
print("Solution:", result)
asyncio.run(solve_recaptcha_v2_enterprise())
Show code
// https://github.com/ZennoLab/capmonstercloud-client-dotnet
using System;
using System.Threading.Tasks;
using Zennolab.CapMonsterCloud;
using Zennolab.CapMonsterCloud.Requests;
class Program
{
static async Task Main(string[] args)
{
// Specify your CapMonster Cloud API key
var clientOptions = new ClientOptions
{
ClientKey = "YOUR_API_KEY"
};
var cmCloudClient = CapMonsterCloudClientFactory.Create(clientOptions);
// Optionally, you can check the balance
var balance = await cmCloudClient.GetBalanceAsync();
Console.WriteLine("Balance: " + balance);
// Basic example without proxy
// CapMonster Cloud automatically uses its own proxies
var recaptchaV2EnterpriseRequest = new RecaptchaV2EnterpriseRequest
{
WebsiteUrl = "https://example.com", // URL of the page with the captcha
WebsiteKey = "6Lf26sUnAAAAAIKLuWNYgRsFUfmI-3Lex3xT5N-s", // Replace with the correct value
EnterprisePayload = "{\"s\":\"SOME_ADDITIONAL_TOKEN\"}"
};
// Example of using your own proxy
// Uncomment this block if you want to use a custom proxy
/*
var recaptchaV2EnterpriseRequest = new RecaptchaV2EnterpriseRequest
{
WebsiteUrl = "https://example.com",
WebsiteKey = "6Lf26sUnAAAAAIKLuWNYgRsFUfmI-3Lex3xT5N-s",
EnterprisePayload = "{\"s\":\"SOME_ADDITIONAL_TOKEN\"}",
Proxy = new ProxyContainer(
"123.45.67.89",
8080,
ProxyType.Http,
"username",
"password"
)
};
*/
var recaptchaV2EnterpriseResult = await cmCloudClient.SolveAsync(recaptchaV2EnterpriseRequest);
Console.WriteLine("Solution: " + recaptchaV2EnterpriseResult.Solution.Value);
}
}
