Quick Start
Solve your first CAPTCHA in under 5 minutes.
Overview
This guide walks you through solving your first CAPTCHA with AnySolver. You'll need an API key and about 5 minutes.
Steps
Step 1: Get Your API Key
- Go to Dashboard → API Keys
- Click Create API Key
- Copy your new API key
Keep Your Key Secret
Your API key grants access to your balance. Never share it or commit it to public repositories.
Step 2: Create a Task
Send a POST request to https://api.anysolver.com/createTask with your CAPTCHA parameters:
{ "clientKey": "your-api-key-from-dashboard", "task": { "websiteURL": "https://www.google.com/recaptcha/api2/demo", "websiteKey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-", "pageTitle": "reCAPTCHA demo", "type": "ReCaptchaV2TokenProxyLess" }}Response:
{
"errorId": 0,
"taskId": "7c1e1d3a-7e8f-4d4f-8e5d-5c9e7d8a9b1c"
}Save the taskId for the next step.
Step 3: Poll for Result
Wait 3-5 seconds, then poll https://api.anysolver.com/getTaskResult:
{
"clientKey": "YOUR_API_KEY",
"taskId": "7c1e1d3a-7e8f-4d4f-8e5d-5c9e7d8a9b1c"
}Keep polling every 2-3 seconds until status is ready:
{
"errorId": 0,
"status": "ready",
"solution": {
"token": "03AGdBq24PBCbwiDRaS_MJ7Z..."
},
"cost": "0.002900"
}Step 4: Use the Token
Submit the token to the target website. For reCAPTCHA v2, inject it into the g-recaptcha-response field:
document.getElementById('g-recaptcha-response').value = token;
form.submit();Complete Example
JavaScript
const API_KEY = 'YOUR_API_KEY';
const BASE_URL = 'https://api.anysolver.com';
const TASK = {
type: 'ReCaptchaV2TokenProxyLess',
websiteURL: 'https://www.google.com/recaptcha/api2/demo',
websiteKey: '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI',
pageTitle: 'reCAPTCHA demo',
};
const post = async (path, body) =>
await fetch(`${BASE_URL}${path}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(body),
}).then(async (r) => await r.json());
async function solveCaptcha() {
console.log('Creating task...');
const create = await post('/createTask', { clientKey: API_KEY, task: TASK });
if (create.errorId !== 0) throw new Error(`${create.errorCode}: ${create.errorDescription ?? 'Unknown error'}`);
console.log(`Task created: ${create.taskId}`);
console.log('Polling for result...');
let result;
do {
await new Promise((r) => setTimeout(r, 3000));
result = await post('/getTaskResult', { clientKey: API_KEY, taskId: create.taskId });
console.log(`Status: ${result.status}`);
if (result.status === 'ready') {
console.log('Task completed!');
return result.solution.token;
}
if (result.status === 'failed') {
throw new Error(`${result.errorCode}: ${result.errorDescription ?? 'Unknown error'}`);
}
if (result.status !== 'processing') {
throw new Error(`Unexpected status: ${result.status}`);
}
} while (result.status === 'processing');
}
void solveCaptcha().then((token) => console.log('Solved:', token));Python
import time
import requests
API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.anysolver.com"
TASK = {
"type": "ReCaptchaV2TokenProxyLess",
"websiteURL": "https://www.google.com/recaptcha/api2/demo",
"websiteKey": "6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI",
"pageTitle": "ReCAPTCHA demo",
}
def solve_captcha():
print("Creating task...")
create = requests.post(f"{BASE_URL}/createTask", json={"clientKey": API_KEY, "task": TASK}).json()
if create.get("errorId") != 0:
raise Exception(f"{create.get('errorCode')}: {create.get('errorDescription', 'Unknown error')}")
task_id = create["taskId"]
print(f"Task created: {task_id}")
print("Polling for result...")
status = "processing"
while status == "processing":
time.sleep(3)
result = requests.post(f"{BASE_URL}/getTaskResult", json={"clientKey": API_KEY, "taskId": task_id}).json()
status = result.get("status")
print(f"Status: {status}")
if status == "ready":
print("Task completed!")
return result["solution"]["token"]
if status == "failed":
raise Exception(f"{result.get('errorCode')}: {result.get('errorDescription', 'Unknown error')}")
if status != "processing":
raise Exception(f"Unexpected status: {status}")
print("Solved:", solve_captcha())Next Steps
Complete documentation for all endpoints, request/response formats, and authentication.
Learn how to configure automatic provider selection by cost, speed, or reliability.
Understand the pre-deduction model, automatic refunds, and transaction types.
Browse all supported CAPTCHA types and learn when to use each one.