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.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: {
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",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",
"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. The user_agent field contains the browser user agent used during solving and should be included in your requests to avoid detection. CaptchaFox tokens are typically valid for a short
period.
Response Fields
| Field | Type | Description |
|---|---|---|
result.token |
string | The CaptchaFox verification token to submit with your form or API request |
result.user_agent |
string | The exact user agent used during solving. Must be forwarded in all subsequent requests that use the generated token. |
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: {}
}
})
});
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 {
token: resultData.task.result.token,
userAgent: resultData.task.result.user_agent
};
} else if (resultData.task.status === 'failed') {
throw new Error('CaptchaFox solving failed');
}
}
}
const result = await solveCaptchaFoxToken(
'https://example.com/login',
'cfox_xxxxxxxxxxxxxxxxxxxx'
);
console.log('CaptchaFox Token:', result.token);
console.log('User Agent:', result.userAgent);
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 result = await solveCaptchaFoxToken(siteUrl, siteKey);
await submitFormWithToken(result.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 {
'token': result_data['task']['result']['token'],
'user_agent': result_data['task']['result']['user_agent']
}
elif result_data['task']['status'] == 'failed':
raise Exception('CaptchaFox solving failed')
print('Waiting for solution...')
# Example usage
result = solve_captchafox_token(
site_url='https://example.com/login',
site_key='cfox_xxxxxxxxxxxxxxxxxxxx',
api_key='YOUR_API_KEY'
)
print(f'CaptchaFox Token: {result["token"]}')
print(f'User Agent: {result["user_agent"]}')
# Submit with form — use the user_agent from the response
response = requests.post(
'https://example.com/login',
headers={
'User-Agent': result['user_agent']
},
data={
'username': 'myusername',
'password': 'mypassword',
'cfox_token': result['token']
}
)
print(f'Login response: {response.status_code}')
Best Practices
- Always use the exact URL where CaptchaFox appears
- Use the
user_agentvalue from the API response in all subsequent requests for consistency - CaptchaFox solving typically takes 5-15 seconds
- Poll every 3 seconds for faster response
- 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.