DataDome Captcha Token Solving
Solve DataDome CAPTCHA challenges programmatically. DataDome is a bot protection service that uses slider captchas to verify human users. Token-based solving returns a datadome cookie that bypasses the protection.
DataDome is a real-time bot protection service used by many e-commerce and high-traffic websites. When triggered, it displays a slider captcha that must be solved to continue browsing. The solution returns a datadome cookie that allows access to the protected website.
Captcha Type
Use the following captcha type identifier in your API requests:
"type": "DATADOME_CAPTCHA_TOKEN"
Request Format
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
auth.token |
string | required | Your API key |
captcha.type |
string | required | Must be "DATADOME_CAPTCHA_TOKEN" |
captcha.metadata.siteUrl |
string | required | The target website URL where you want to access |
captcha.metadata.siteKey |
string | required | Full DataDome captcha URL (starts with geo.captcha-delivery.com) |
captcha.payload.userAgent |
string | optional | Browser user agent string (recommended) |
captcha.payload.proxy |
object | required | Proxy configuration object (required for DataDome) |
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: 'DATADOME_CAPTCHA_TOKEN',
metadata: {
siteUrl: 'https://www.example.com/',
siteKey: 'https://geo.captcha-delivery.com/captcha/?initialCid=AHrlqAAAAAMAlk-FmAyNOW8AUyTH_g%3D%3D&hash=5B45875B653A484CC79E57036CE9FC&cid=...'
},
payload: {
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 is being processed",
"task": {
"id": "MyDisctSolver_abc123def456",
"status": "processing"
}
}
Fetch Result Response (Completed)
{
"success": true,
"service": "MyDisct Solver",
"message": "Captcha solved successfully",
"task": {
"id": "MyDisctSolver_abc123def456",
"status": "completed",
"result": {
"token": "datadome=4ZXwCBlyHx9ktZhSnycMF...; Path=/; Secure; SameSite=Lax",
"timestamp": "2025-11-26T12:00:15.000Z"
}
}
}
The token field contains the datadome cookie. Set this cookie in your browser or HTTP client
to bypass DataDome protection on the target website.
Implementation Guide
Step 1: Extract DataDome Captcha URL
When DataDome triggers, you'll be redirected to a captcha page. Extract the full URL:
// The captcha URL looks like this:
function getDataDomeCaptchaUrl() {
if (window.location.href.includes('captcha-delivery.com')) {
return window.location.href;
}
const iframe = document.querySelector('iframe[src*="captcha-delivery.com"]');
if (iframe) {
return iframe.src;
}
return null;
}
const siteKey = getDataDomeCaptchaUrl();
console.log('DataDome siteKey:', siteKey);
Step 2: Solve DataDome Token
async function solveDataDomeToken(siteUrl, siteKey, proxy) {
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: 'DATADOME_CAPTCHA_TOKEN',
metadata: {
siteUrl: siteUrl,
siteKey: siteKey
},
payload: {
userAgent: navigator.userAgent,
proxy: proxy
}
}
})
});
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)); // Wait 5 seconds
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('Token solving failed');
}
}
}
const proxy = {
protocol: 'http',
host: '1.2.3.4',
port: 8080,
username: 'proxyuser',
password: 'proxypass'
};
const token = await solveDataDomeToken(
'https://www.example.com/',
'https://geo.captcha-delivery.com/captcha/?initialCid=...',
proxy
);
console.log('DataDome Token:', token);
Step 3: Use the Token
// Method 1: Set cookie in browser
document.cookie = token;
const response = await fetch('https://www.example.com/protected-page', {
headers: {
'Cookie': token
}
});
const cookieValue = token.split('=')[1].split(';')[0];
document.cookie = `datadome=${cookieValue}; path=/; secure`;
Python Example
import requests
import time
def solve_datadome_token(site_url, site_key, proxy, api_key):
"""
Solve DataDome CAPTCHA token challenge
Args:
site_url: Target website URL
site_key: Full DataDome captcha URL (geo.captcha-delivery.com/...)
proxy: Proxy configuration dict
api_key: Your MyDisct Solver API key
Returns:
DataDome cookie string (token)
"""
# 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': 'DATADOME_CAPTCHA_TOKEN',
'metadata': {
'siteUrl': site_url,
'siteKey': site_key
},
'payload': {
'userAgent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36',
'proxy': proxy
}
}
}
)
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) # Wait 5 seconds
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')
print('Waiting for solution...')
# Example usage
proxy = {
'protocol': 'http',
'host': '1.2.3.4',
'port': 8080,
'username': 'proxyuser',
'password': 'proxypass'
}
token = solve_datadome_token(
site_url='https://www.example.com/',
site_key='https://geo.captcha-delivery.com/captcha/?initialCid=...',
proxy=proxy,
api_key='YOUR_API_KEY'
)
print(f'DataDome Token: {token}')
# Use the token in your requests
session = requests.Session()
cookie_value = token.split('=')[1].split(';')[0]
session.cookies.set('datadome', cookie_value, domain='.example.com')
response = session.get('https://www.example.com/protected-page')
print(f'Response status: {response.status_code}')
Best Practices
- Always use a proxy - DataDome validates the IP address
- Use the same proxy for solving and subsequent requests
- Match the user agent between solving and your requests
- DataDome cookies typically last 24 hours
- Extract the full captcha URL from the redirect or page source
- Use high-quality residential proxies for better success rates
Common Issues
Solution: Ensure you're using the same proxy IP for solving and accessing the website. DataDome validates the IP address associated with the cookie.
Solution: Make sure you're using the complete captcha URL including all query parameters. The URL should start with geo.captcha-delivery.com/captcha/.
Solution: DataDome cookies typically last 24 hours. Request a new token if you encounter issues after extended use.