reCAPTCHA v2 Enterprise Callback Token Solving
Solve Google reCAPTCHA v2 Enterprise with callback function support. Enterprise version of callback reCAPTCHA v2 with enhanced security and callback verification.
Google reCAPTCHA v2 Enterprise Callback combines Enterprise-grade security with callback-based token
verification. It uses recaptcha/enterprise.js and the data-callback attribute
to define a JavaScript function that receives the solved token. This variant provides enhanced threat
analysis and custom risk scoring while handling token delivery through the site's callback flow.
Captcha Type
"type": "RECAPTCHA_V2_ENTERPRISE_CALLBACK_TOKEN"
Request Format
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
auth.token |
string | required | Your API key |
captcha.type |
string | required | Must be "RECAPTCHA_V2_ENTERPRISE_CALLBACK_TOKEN" |
captcha.metadata.siteUrl |
string | required | URL where the enterprise callback captcha appears |
captcha.metadata.siteKey |
string | required | reCAPTCHA Enterprise site key (data-sitekey attribute) |
captcha.payload.sValue |
string | optional | The Enterprise "s" metadata value (required by some Enterprise sites) |
captcha.payload.userAgent |
string | optional | Your browser's user agent to improve solving accuracy |
captcha.payload.cookies |
array | optional | Array of cookie objects (see Cookie Object Structure below) |
captcha.payload.cookies[].name |
string | required* | Cookie name |
captcha.payload.cookies[].value |
string | required* | Cookie value |
captcha.payload.cookies[].domain |
string | required* | Cookie domain (e.g., ".example.com") |
captcha.payload.domain |
string | optional | reCAPTCHA API endpoint domain if the site uses an alternative |
captcha.payload.proxy |
object | optional | Proxy configuration (recommended for Enterprise) |
captcha.payload.proxy.protocol |
string | required* | Proxy protocol: "http", "https", "socks4", or "socks5" |
captcha.payload.proxy.host |
string | required* | Proxy IP address or hostname |
captcha.payload.proxy.port |
number | required* | Proxy port number |
captcha.payload.proxy.username |
string | optional | Proxy authentication username |
captcha.payload.proxy.password |
string | optional | Proxy authentication password |
* Required only if parent object (proxy/cookies) is provided
Example Request
const response = await fetch('https://solver-api.mydisct.com/createTask', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'apikey': 'YOUR_API_KEY'
},
body: JSON.stringify({
auth: {
token: 'YOUR_API_KEY'
},
context: {
source: 'api',
version: '1.0.0'
},
captcha: {
type: 'RECAPTCHA_V2_ENTERPRISE_CALLBACK_TOKEN',
metadata: {
siteUrl: 'https://example.com/login',
siteKey: '6LcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxAA'
},
payload: {
sValue: 'OPTIONAL_S_VALUE',
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36...',
proxy: {
protocol: 'http',
host: '1.2.3.4',
port: 8080,
username: 'proxyuser',
password: 'proxypass'
}
}
}
})
});
const data = await response.json();
console.log('Task ID:', data.task.id);
Response Format
Create Task Response (Processing)
{
"success": true,
"service": "MyDisct Solver",
"message": "Captcha task created successfully",
"task": {
"id": "MyDisctSolver_abc123",
"status": "processing"
}
}
Fetch Result Response (Processing)
{
"success": true,
"service": "MyDisct Solver",
"message": "Captcha is being processed",
"task": {
"id": "MyDisctSolver_abc123",
"status": "processing"
}
}
Fetch Result Response (Completed)
{
"success": true,
"service": "MyDisct Solver",
"message": "Captcha solved successfully",
"task": {
"id": "MyDisctSolver_abc123",
"status": "completed",
"result": {
"token": "03AGdBq24PBCbwiDRaS_MJ7Z...",
"timestamp": "2025-12-13T12:00:00.000Z"
}
}
}
The token field contains the reCAPTCHA Enterprise response token. For Enterprise
callback-based reCAPTCHA, you must pass this token to the site's callback function (defined in the
data-callback attribute). Enterprise tokens are compatible with Google's Enterprise
verification endpoints.
Implementation Guide
Step 1: Identify Enterprise Callback reCAPTCHA
// Enterprise Callback reCAPTCHA uses enterprise.js AND has data-callback attribute
function isEnterpriseCallbackRecaptcha() {
let isEnterprise = false;
const scripts = document.querySelectorAll('script');
for (const script of scripts) {
if (script.src?.includes('recaptcha/enterprise.js')) {
isEnterprise = true;
break;
}
}
if (!isEnterprise) return false;
const recaptchaDiv = document.querySelector('.g-recaptcha');
if (recaptchaDiv) {
return recaptchaDiv.hasAttribute('data-callback');
}
return false;
}
function getEnterpriseCallbackInfo() {
const recaptchaDiv = document.querySelector('.g-recaptcha, [data-sitekey]');
if (recaptchaDiv) {
return {
siteKey: recaptchaDiv.getAttribute('data-sitekey'),
callbackName: recaptchaDiv.getAttribute('data-callback')
};
}
const scripts = document.querySelectorAll('script');
for (const script of scripts) {
const match = script.src?.match(/render=([^&]+)/);
if (match) return { siteKey: match[1], callbackName: null };
}
return null;
}
const info = getEnterpriseCallbackInfo();
console.log('Enterprise Site Key:', info?.siteKey);
console.log('Callback Function:', info?.callbackName);
Step 2: Solve Enterprise Callback Token
async function solveRecaptchaV2EnterpriseCallback(siteUrl, siteKey) {
const createResponse = await fetch('https://solver-api.mydisct.com/createTask', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'apikey': 'YOUR_API_KEY'
},
body: JSON.stringify({
auth: { token: 'YOUR_API_KEY' },
context: { source: 'api', version: '1.0.0' },
captcha: {
type: 'RECAPTCHA_V2_ENTERPRISE_CALLBACK_TOKEN',
metadata: { siteUrl, siteKey },
payload: {
userAgent: navigator.userAgent
}
}
})
});
const createData = await createResponse.json();
if (!createData.success) throw new Error(createData.error.message);
const taskId = createData.task.id;
while (true) {
await new Promise(resolve => setTimeout(resolve, 5000));
const resultResponse = await fetch('https://solver-api.mydisct.com/fetchResult', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'apikey': 'YOUR_API_KEY'
},
body: JSON.stringify({ taskId })
});
const resultData = await resultResponse.json();
if (resultData.task.status === 'completed') {
return resultData.task.result.token;
} else if (resultData.task.status === 'failed') {
throw new Error('Enterprise callback token solving failed');
}
}
}
const token = await solveRecaptchaV2EnterpriseCallback(
'https://example.com/login',
'6LcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxAA'
);
console.log('Enterprise Callback Token:', token);
Step 3: Submit Token with Callback
// Inject enterprise token and trigger the callback function
function injectEnterpriseCallbackToken(token) {
// Set the g-recaptcha-response field
let responseField = document.querySelector('[name="g-recaptcha-response"]');
if (!responseField) {
responseField = document.createElement('textarea');
responseField.name = 'g-recaptcha-response';
responseField.style.display = 'none';
document.querySelector('form').appendChild(responseField);
}
responseField.value = token;
// IMPORTANT: Trigger the callback function
const recaptchaDiv = document.querySelector('.g-recaptcha');
const callbackName = recaptchaDiv?.getAttribute('data-callback');
if (callbackName && typeof window[callbackName] === 'function') {
// Call the site's callback function with the enterprise token
window[callbackName](token);
console.log('Enterprise callback triggered:', callbackName);
} else {
console.warn('Enterprise callback function not found:', callbackName);
// Fallback: try submitting the form
document.querySelector('form')?.submit();
}
}
Python Example
import requests
import time
def solve_recaptcha_v2_enterprise_callback(site_url, site_key, api_key, s_value=None):
"""Solve reCAPTCHA v2 Enterprise Callback token challenge"""
payload_data = {
'userAgent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'
}
# Add sValue if provided (required by some Enterprise sites)
if s_value:
payload_data['sValue'] = s_value
# Step 1: Create task
create_response = requests.post(
'https://solver-api.mydisct.com/createTask',
headers={
'Content-Type': 'application/json',
'apikey': api_key
},
json={
'auth': {'token': api_key},
'context': {'source': 'api', 'version': '1.0.0'},
'captcha': {
'type': 'RECAPTCHA_V2_ENTERPRISE_CALLBACK_TOKEN',
'metadata': {
'siteUrl': site_url,
'siteKey': site_key
},
'payload': payload_data
}
}
)
create_data = create_response.json()
if not create_data['success']:
raise Exception(create_data['error']['message'])
task_id = create_data['task']['id']
print(f'Task created: {task_id}')
# Step 2: Poll for result
while True:
time.sleep(5)
result_response = requests.post(
'https://solver-api.mydisct.com/fetchResult',
headers={
'Content-Type': 'application/json',
'apikey': api_key
},
json={'taskId': task_id}
)
result_data = result_response.json()
if result_data['task']['status'] == 'completed':
return result_data['task']['result']['token']
elif result_data['task']['status'] == 'failed':
raise Exception('Enterprise callback token solving failed')
print('Waiting for solution...')
# Example usage
token = solve_recaptcha_v2_enterprise_callback(
site_url='https://example.com/login',
site_key='6LcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxAA',
api_key='YOUR_API_KEY'
)
print(f'Enterprise Callback Token: {token}')
# Submit with form (callback sites often use AJAX)
response = requests.post(
'https://example.com/verify',
json={
'username': 'myusername',
'password': 'mypassword',
'g-recaptcha-response': token
}
)
print(f'Verify response: {response.status_code}')
Best Practices
- sValue Parameter: Some Enterprise sites require the "s" metadata value - extract it from the page if token is rejected
- Enterprise Detection: Verify the site loads
recaptcha/enterprise.jsinstead ofrecaptcha/api.js - Callback Handling: Always identify and trigger the correct callback function after token injection
- Proxy Recommended: Enterprise implementations often benefit from proxy usage for better success rates
- Polling Intervals: Enterprise tokens take 10-30 seconds, use 5-second polling intervals
- Token Expiration: Enterprise tokens expire after ~2 minutes, trigger the callback immediately
Common Issues
Solution: Ensure you're using the correct Enterprise site key and check if the site requires the sValue parameter. Also verify that the callback function is being triggered correctly with the token as its argument.
Solution: Verify the site uses Enterprise reCAPTCHA by checking for
recaptcha/enterprise.js in the page source. Also confirm the callback variant by
checking for the data-callback attribute. If there's no callback, use
RECAPTCHA_V2_ENTERPRISE_TOKEN instead.