reCAPTCHA v2 Enterprise uses the same checkbox challenge as standard v2, but it verifies tokens through Google's Enterprise API instead of the public siteverify endpoint. The solving process through CaptchaAI is nearly identical — you add one parameter: enterprise=1.
This guide walks through detection, parameter extraction, and solving with working Python and Node.js code.
Not sure if you are facing Enterprise or standard? Read How to Identify reCAPTCHA Enterprise Implementation first.
What you need before you start
| Requirement | Details |
|---|---|
| CaptchaAI API key | Get one at captchaai.com/api.php |
| Target page URL | The full URL where reCAPTCHA appears |
| Sitekey | From data-sitekey attribute |
| Enterprise flag | Confirmed via enterprise.js script tag |
| data-s value (if present) | Optional additional token on some Enterprise implementations |
Step 1: Detect Enterprise implementation
Check the page source for these indicators:
// Enterprise script tag (NOT api.js)
// <script src="https://www.google.com/recaptcha/enterprise.js?render=SITEKEY"></script>
// Enterprise JavaScript object
// grecaptcha.enterprise.render(...)
// grecaptcha.enterprise.execute(...)
If you see enterprise.js or grecaptcha.enterprise, it is Enterprise. If you see api.js and grecaptcha, it is standard.
Step 2: Extract parameters
# Sitekey: from data-sitekey attribute
# <div class="g-recaptcha" data-sitekey="6LcR_RsTAAAA..." data-s="..."></div>
# Or from enterprise.js render parameter
# https://www.google.com/recaptcha/enterprise.js?render=6LcR_RsTAAAA...
Also check for data-s — an additional session token that some Enterprise implementations require.
Step 3: Submit to CaptchaAI
import requests
params = {
"key": "YOUR_API_KEY",
"method": "userrecaptcha",
"googlekey": "6LcR_RsTAAAAAFJR-JhNbC6CC42wKCbR9Hq_kVCd",
"pageurl": "https://example.com/login",
"enterprise": 1, # Required for Enterprise
"json": 1
}
# Include data-s if present on the page
# params["data-s"] = "data-s-value-from-page"
response = requests.get("https://ocr.captchaai.com/in.php", params=params)
data = response.json()
task_id = data["request"]
print(f"Task ID: {task_id}")
const params = new URLSearchParams({
key: "YOUR_API_KEY",
method: "userrecaptcha",
googlekey: "6LcR_RsTAAAAAFJR-JhNbC6CC42wKCbR9Hq_kVCd",
pageurl: "https://example.com/login",
enterprise: 1,
json: 1,
});
const res = await fetch(`https://ocr.captchaai.com/in.php?${params}`);
const data = await res.json();
console.log(`Task ID: ${data.request}`);
Step 4: Poll for the result
import time
for _ in range(40):
time.sleep(5)
result = requests.get("https://ocr.captchaai.com/res.php", params={
"key": "YOUR_API_KEY",
"action": "get",
"id": task_id,
"json": 1
}).json()
if result.get("status") == 1:
token = result["request"]
print(f"Token: {token[:50]}...")
break
if result.get("request") != "CAPCHA_NOT_READY":
raise RuntimeError(f"Error: {result['request']}")
let token;
for (let i = 0; i < 40; i++) {
await new Promise((r) => setTimeout(r, 5000));
const res = await fetch(
`https://ocr.captchaai.com/res.php?${new URLSearchParams({
key: "YOUR_API_KEY", action: "get", id: taskId, json: 1,
})}`
);
const data = await res.json();
if (data.status === 1) { token = data.request; break; }
if (data.request !== "CAPCHA_NOT_READY") throw new Error(data.request);
}
Step 5: Inject the token
Token injection is the same as standard v2:
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("https://example.com/login")
# Inject token into hidden field
driver.execute_script(
f'document.getElementById("g-recaptcha-response").innerHTML = "{token}";'
)
# Check for callback
callback = driver.execute_script(
'var el = document.querySelector(".g-recaptcha"); '
'return el ? el.getAttribute("data-callback") : null;'
)
if callback:
driver.execute_script(f'{callback}("{token}");')
else:
driver.find_element("css selector", "form").submit()
Complete working example
import requests
import time
def solve_recaptcha_v2_enterprise(api_key, sitekey, page_url, data_s=None):
params = {
"key": api_key, "method": "userrecaptcha",
"googlekey": sitekey, "pageurl": page_url,
"enterprise": 1, "json": 1
}
if data_s:
params["data-s"] = data_s
submit = requests.get("https://ocr.captchaai.com/in.php", params=params).json()
if submit.get("status") != 1:
raise RuntimeError(f"Submit error: {submit.get('request')}")
task_id = submit["request"]
for _ in range(40):
time.sleep(5)
result = requests.get("https://ocr.captchaai.com/res.php", params={
"key": api_key, "action": "get", "id": task_id, "json": 1
}).json()
if result.get("status") == 1:
return result["request"]
if result.get("request") != "CAPCHA_NOT_READY":
raise RuntimeError(f"Solve error: {result.get('request')}")
raise TimeoutError("Solve timed out after 200s")
# Usage
token = solve_recaptcha_v2_enterprise("YOUR_API_KEY", "6LcR_RsTAAAA...", "https://example.com/login")
print(f"Solved: {token[:50]}...")
FAQ
What is the only difference between standard and Enterprise API calls?
Add enterprise=1 to your CaptchaAI request. Everything else — method name, sitekey parameter, polling — is identical.
When do I need the data-s parameter?
Only when the page includes a data-s attribute on the reCAPTCHA div. Most Enterprise implementations do not use it. Check the HTML source.
Does CaptchaAI charge differently for Enterprise?
Check captchaai.com for current pricing. Enterprise solves may use different thread counts.
Can Enterprise tokens be reused?
No. Like standard v2, Enterprise tokens are single-use and expire after approximately 2 minutes.
How do I know if my Enterprise solve failed?
If the target site still blocks you after token injection, verify: (1) you included enterprise=1, (2) the sitekey is correct, (3) data-s is included if present, (4) the token was used within 2 minutes.
Start solving reCAPTCHA v2 Enterprise
Get your API key at captchaai.com/api.php. Add enterprise=1 to your existing reCAPTCHA v2 solve code and you are ready.
Discussions (0)
Join the conversation
Sign in to share your opinion.
Sign InNo comments yet.