Cloudflare Turnstile Managed Token Solving
Solve Cloudflare Turnstile challenges on complex sites using the managed token method. Optimized for high-volume automation with 99.7% success rate.
Some sites use advanced Cloudflare Turnstile configurations that require
additional parameters like data (cData) and chlPageData. This endpoint
handles these complex challenges.
Captcha Type
"type": "CLOUDFLARE_TURNSTILE_MANAGED_TOKEN"
Request Format
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
captcha.type |
string | required | Must be "CLOUDFLARE_TURNSTILE_MANAGED_TOKEN" |
captcha.metadata.siteUrl |
string | required | URL where Turnstile appears |
captcha.metadata.siteKey |
string | required | Turnstile site key (data-sitekey) |
captcha.payload.data |
string | required | The cData value from Turnstile widget |
captcha.payload.chlPageData |
string | required | The chlPageData value from Turnstile widget |
captcha.payload.userAgent |
string | optional | User agent string (recommended) |
captcha.payload.proxy |
object | optional | Proxy configuration object |
captcha.payload.proxy.protocol |
string | required* | Proxy protocol: "http", "https", "socks4", "socks5" |
captcha.payload.proxy.host |
string | required* | Proxy IP address |
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 proxy object 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: 'CLOUDFLARE_TURNSTILE_MANAGED_TOKEN',
metadata: {
siteUrl: 'https://example-site.com/verify',
siteKey: '0x4AAAAAAAAkj9F6x3Wdn5Q8'
},
payload: {
data: '8e0502270aafe4e7',
chlPageData: 'NthCl7nhFIqbpQqIfU.....d6rPg',
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
{
"success": true,
"service": "MyDisct Solver",
"message": "Captcha is being processed",
"task": {
"id": "MyDisctSolver_cftm_123def456",
"status": "processing"
}
}
Fetch Result Response (Processing)
{
"success": true,
"service": "MyDisct Solver",
"message": "Captcha is being processed",
"task": {
"id": "MyDisctSolver_cftm_123def456",
"status": "processing"
}
}
Fetch Result Response (Completed)
{
"success": true,
"service": "MyDisct Solver",
"message": "Captcha solved successfully",
"task": {
"id": "MyDisctSolver_cftm_123def456",
"status": "completed",
"result": {
"token": "0.AQAAAAAAAAkj9F6x3Wdn5Q8...",
"timestamp": "2025-11-05T12:34:56.789Z"
}
}
}
Submit the token in the cf-turnstile-response form field.
Implementation Guide
How to get data and chlPageData?
You need to intercept the Turnstile initialization to get these values. Here is a JavaScript snippet to do that:
(() => {
let timer = setInterval(() => {
if(window.turnstile){
intercept();
clearInterval(timer);
}
}, 1)
const intercept = function(){
const initCap = ([a, b]) => {
window.params = {
sitekey: b.sitekey,
data: b.cData || null,
chlPageData: b.chlPageData || null,
action: b.action || null
};
console.log('Turnstile Params Intercepted:', window.params);
}
window.turnstile = new Proxy(window.turnstile,{
get: function (target, prop) {
if(prop === 'render'){
return new Proxy(target[prop], {
apply: (target, Arg, arguments) => {
initCap(arguments);
const obj = Reflect.apply(target, Arg, arguments);
return obj;
}
});
}
return target[prop];
}
});
}
})()
Once intercepted, you'll have access to these parameters in
window.params:
- sitekey: The site key you already know
- data: The cData parameter (required for managed mode)
- chlPageData: The challenge page data (required for managed mode)
- action: The action parameter (handled automatically by our API)
Implementation Example
async function solveManagedTurnstile(siteUrl, siteKey, data, chlPageData, apiKey) {
const createResponse = await fetch('https://solver-api.mydisct.com/createTask', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'apikey': apiKey
},
body: JSON.stringify({
auth: { token: apiKey },
context: { source: 'api', version: '1.0.0' },
captcha: {
type: 'CLOUDFLARE_TURNSTILE_MANAGED_TOKEN',
metadata: { siteUrl, siteKey },
payload: {
data,
chlPageData,
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': apiKey
},
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('Token solving failed');
}
}
}
const token = await solveManagedTurnstile(
'https://example-site.com/verify',
'0x4AAAAAAAAkj9F6x3Wdn5Q8',
'8e0502270aafe4e7',
'NthCl7nhFIqbpQqIfU.....d6rPg',
'YOUR_API_KEY'
);
const formData = new FormData();
formData.append('cf-turnstile-response', token);
await fetch('https://example-site.com/verify', {
method: 'POST',
body: formData
});
Python Example
import requests
import time
def solve_managed_turnstile(site_url, site_key, data, chl_page_data, api_key):
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': 'CLOUDFLARE_TURNSTILE_MANAGED_TOKEN',
'metadata': {
'siteUrl': site_url,
'siteKey': site_key
},
'payload': {
'data': data,
'chlPageData': chl_page_data,
'userAgent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'
}
}
}
)
create_data = create_response.json()
if not create_data['success']:
raise Exception(create_data['error']['message'])
task_id = create_data['task']['id']
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('Token solving failed')
# Usage
token = solve_managed_turnstile(
site_url='https://example-site.com/verify',
site_key='0x4AAAAAAAAkj9F6x3Wdn5Q8',
data='8e0502270aafe4e7',
chl_page_data='NthCl7nhFIqbpQqIfU.....d6rPg',
api_key='YOUR_API_KEY'
)
response = requests.post(
'https://example-site.com/verify',
data={'cf-turnstile-response': token}
)
print(f'Status: {response.status_code}')
Finding Required Parameters
The managed token method requires additional parameters beyond the standard Turnstile implementation:
Finding Site Key
The Turnstile site key can be found in the HTML:
<div class="cf-turnstile" data-sitekey="0x4AAAAAAAAkj9F6x3Wdn5Q8"></div>
Or in JavaScript:
const siteKey = document.querySelector('[data-sitekey]')?.getAttribute('data-sitekey');
console.log('Site Key:', siteKey);
Finding data and chlPageData
Use the interception script provided in the Implementation Guide section above to extract these values dynamically when the Turnstile widget renders.
Best Practices
- Managed tokens typically solve in 8-15 seconds (slightly slower than standard)
- Tokens expire after 5 minutes
- Always use the exact page URL where Turnstile appears
- Ensure data and chlPageData are fresh (intercepted from current session)
- Use high-quality residential proxies for better success rates
- Include userAgent header matching your browser configuration
- The action parameter is handled automatically by our server
Common Issues
Solution: Ensure you are using fresh data and chlPageData values. These parameters change with each page load and must be intercepted from the current session. Also verify that the siteKey and siteUrl are correct.
Solution: Make sure to run the interception script before the Turnstile widget loads. The script must be executed early in the page lifecycle to properly capture the initialization parameters.
Solution: Sites using managed Turnstile are particularly sensitive to IP reputation. Use residential proxies from the same geographic region as the site's target audience. Datacenter proxies often result in failed verifications.