CaptchaFox Token Solving
Solve CaptchaFox token challenges programmatically. CaptchaFox provides seamless bot protection with invisible verification that doesn't require user interaction.
CaptchaFox is a modern captcha service that provides invisible bot protection. Unlike traditional captchas, CaptchaFox works in the background and generates verification tokens without requiring any user interaction. Our service can solve these challenges and provide valid tokens for seamless automation.
Captcha Type
Use the following captcha type identifier in your API requests:
"type": "CAPTCHAFOX_TOKEN"
Request Format
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
auth.token |
string | required | Your API key |
captcha.type |
string | required | Must be "CAPTCHAFOX_TOKEN" |
captcha.metadata.siteUrl |
string | required | URL where CaptchaFox appears |
captcha.metadata.siteKey |
string | required | CaptchaFox site key (cfox_...) |
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: 'CAPTCHAFOX_TOKEN',
metadata: {
siteUrl: 'https://example.com/login',
siteKey: 'cfox_xxxxxxxxxxxxxxxxxxxx'
},
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_cfox123",
"status": "processing"
}
}
Fetch Result Response (Processing)
{
"success": true,
"service": "MyDisct Solver",
"message": "Captcha is being processed",
"task": {
"id": "MyDisctSolver_cfox123",
"status": "processing"
}
}
Fetch Result Response (Completed)
{
"success": true,
"service": "MyDisct Solver",
"message": "Captcha solved successfully",
"task": {
"id": "MyDisctSolver_cfox123",
"status": "completed",
"result": {
"token": "cfox_token_value_here",
"timestamp": "2025-11-05T12:34:56.789Z"
}
}
}
The token field contains the CaptchaFox verification token. This token should be
submitted in the appropriate form field or API request. CaptchaFox tokens are typically valid for a short
period.
Implementation Guide
Step 1: Extract CaptchaFox Site Key
Find the CaptchaFox site key from the page:
// Method 1: From script tag
function getCaptchaFoxSiteKey() {
const scripts = document.querySelectorAll('script');
for (const script of scripts) {
const match = script.textContent?.match(/cfox[_-]([^'"]+)/);
if (match) return 'cfox_' + match[1];
}
const cfoxDiv = document.querySelector('[data-cfox-key], [data-sitekey]');
if (cfoxDiv) {
const key = cfoxDiv.getAttribute('data-cfox-key') ||
cfoxDiv.getAttribute('data-sitekey');
if (key?.startsWith('cfox_')) return key;
}
if (window.cfox && window.cfox.siteKey) {
return window.cfox.siteKey;
}
return null;
}
const siteKey = getCaptchaFoxSiteKey();
console.log('CaptchaFox Site Key:', siteKey);
Step 2: Solve CaptchaFox Token
async function solveCaptchaFoxToken(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: 'CAPTCHAFOX_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, 3000)); // Wait 3 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('CaptchaFox solving failed');
}
}
}
const token = await solveCaptchaFoxToken(
'https://example.com/login',
'cfox_xxxxxxxxxxxxxxxxxxxx'
);
console.log('CaptchaFox Token:', token);
Step 3: Submit Token with Form
// Method 1: Submit with form data
async function submitFormWithToken(token) {
const formData = new FormData();
formData.append('username', 'myusername');
formData.append('password', 'mypassword');
formData.append('cfox_token', token);
const response = await fetch('https://example.com/login', {
method: 'POST',
body: formData
});
return await response.json();
}
async function submitJsonWithToken(token) {
const response = await fetch('https://example.com/api/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
username: 'myusername',
password: 'mypassword',
cfoxToken: token
})
});
return await response.json();
}
function injectTokenIntoForm(token) {
const tokenField = document.querySelector('input[name="cfox_token"]') ||
document.querySelector('input[name*="cfox"]') ||
document.querySelector('#cfox_token');
if (tokenField) {
tokenField.value = token;
const form = tokenField.closest('form');
if (form) {
form.submit();
}
}
}
const token = await solveCaptchaFoxToken(siteUrl, siteKey);
await submitFormWithToken(token);
Python Example
import requests
import time
def solve_captchafox_token(site_url, site_key, api_key):
"""
Solve CaptchaFox token challenge
Args:
site_url: URL where CaptchaFox appears
site_key: CaptchaFox site key (cfox_...)
api_key: Your MyDisct Solver API key
Returns:
CaptchaFox verification 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': 'CAPTCHAFOX_TOKEN',
'metadata': {
'siteUrl': site_url,
'siteKey': site_key
},
'payload': {}
}
}
)
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(3) # Wait 3 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('CaptchaFox solving failed')
print('Waiting for solution...')
# Example usage
token = solve_captchafox_token(
site_url='https://example.com/login',
site_key='cfox_xxxxxxxxxxxxxxxxxxxx',
api_key='YOUR_API_KEY'
)
print(f'CaptchaFox Token: {token}')
# Submit with form
response = requests.post(
'https://example.com/login',
data={
'username': 'myusername',
'password': 'mypassword',
'cfox_token': token
}
)
print(f'Login response: {response.status_code}')
Best Practices
- Always use the exact URL where CaptchaFox appears
- Include user agent for better success rates
- CaptchaFox solving typically takes 5-15 seconds
- Poll every 3 seconds for faster response
- Use appropriate user agents that match the target site
- Handle token expiration (tokens typically valid for 2 minutes)
- Implement proper error handling for failed tasks
Common Issues
Solution: CaptchaFox keys usually start with 'cfox_'. Check script tags, data attributes, and global variables for the key.
Solution: Ensure you're using the correct site key and URL. CaptchaFox validation is strict about these parameters.
Solution: For invisible CaptchaFox, ensure the challenge is properly triggered on the page before attempting to solve.