Skip to Content
AnySolver logo
AnySolver

Quickstart

Solve your first CAPTCHA with AnySolver: create an account and an API key, send createTask, poll getTaskResult, then handle errors and rate limits.

Solve your first CAPTCHA with AnySolver in three steps: create an account, create an API key, then send createTask and poll getTaskResult.

Try without code first

The Playground runs the same createTask flow against your account from the dashboard. Use it to confirm a sitekey works before wiring it into an integration.

Step 1: Create an account

Register for free. Your first sign-in opens a short setup: name your organization, accept the Terms of Service if you did not accept them when registering, and read a short introduction to routing, pricing and Provider Exchange. The setup ends on Create your first API key, which opens Step 2.

The setup's last screen also offers Free trial credit: $0.25 to run this guide, for the organization's owner. Click Verify with Google or Verify with GitHub to link that account, then Claim $0.25. Some claims ask for a 6-digit code sent to your email before the credit is added. If you skip it, the same card stays in Billing until you add funds. The free trial has these limits:

  • One trial per organization, ever, and one per Google or GitHub account and per email address.
  • Only for an organization that has not added funds, and not for a disposable email address.
  • A GitHub account must be at least 14 days old, and a Google account needs a verified email.
  • Whatever is unspent 7 days after the claim expires. Money you add yourself never expires.

Top up in Billing when the free credit runs out. A task sent with too little balance returns ERROR_ZERO_BALANCE and is not charged.

If a teammate invited you, sign up with the invited email address. Registering then creates no organization of its own, so there is no free trial to claim. The setup asks you to accept the Terms of Service, then shows the invitation: click Join next to the organization's name, or name an organization of your own and click Continue. Organizations, members and permissions explains shared accounts.

This guide solves the Google reCAPTCHA demo, so you need no CAPTCHA of your own yet.

Step 2: Create an API key

Create your first API key at the end of the setup opens step 2 below for your organization's default workspace, the one the dashboard opens on. To create a key later:

  1. Open the dashboard and click API keys in the sidebar. If the dashboard opens on the Workspaces table instead, open a workspace first. Workspaces explains how keys are grouped.
  2. Click Create key, name the key, and pick a routing mode. Advanced settings are optional and keep sensible defaults.
  3. Click Create key again. The confirmation dialog shows the new key and, under Send a first task, the createTask request of Step 3 with your key filled in, in cURL, Python or Node. Keys are prefixed anysolver_, and you can reveal or copy them again later from the list.

Keep your API key secret

Your key controls your balance. Never commit it to a public repository or expose it in client-side code.

Step 3: Send a task and poll for the result

Send the task

POST to https://api.anysolver.com/createTask with Content-Type: application/json. This example solves reCAPTCHA v2 through the provider's own IP (ReCaptchaV2TokenProxyLess):

{
    "clientKey": "YOUR_API_KEY",
    "task": {
        "type": "ReCaptchaV2TokenProxyLess",
        "websiteURL": "https://www.google.com/recaptcha/api2/demo",
        "websiteKey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-",
        "pageTitle": "ReCAPTCHA demo"
    }
}

Response:

{
    "errorId": 0,
    "taskId": "01KFNDF328KAN2AJ3BNHCQYE88"
}

Save the taskId for polling.

Poll for the result

POST to https://api.anysolver.com/getTaskResult:

{
    "clientKey": "YOUR_API_KEY",
    "taskId": "01KFNDF328KAN2AJ3BNHCQYE88"
}

Repeat while status is processing, as often as every 0.5 seconds. When it is ready:

{
    "status": "ready",
    "taskId": "01KFNDF328KAN2AJ3BNHCQYE88",
    "errorId": 0,
    "cost": 0.00012,
    "taskType": "ReCaptchaV2TokenProxyLess",
    "provider": "Multibot",
    "solution": {
        "token": "03AGdBq24PBCbwiDRaS_MJ7Z…"
    }
}

The solution block contains the token to submit to the target site. The provider and cost fields tell you which provider solved it and what you paid.

Auto Fallback is on for new API keys. After an eligible failure it can move the task to another provider. You pay once if that provider solves it. The ready response looks the same; to see each attempt, send settings.statistics: true on createTask and the result gains a retry object.

Example: ready response after a fallback

An example run where the cheapest provider failed: SCTG, the cheapest for ReCaptchaV2TokenProxyLess at $0.08 per 1,000, returned CAPTCHA_UNSOLVABLE, and Multibot solved it. cost is Multibot's catalog rate, 0.00012 USD for this task ($0.12 per 1,000); when the cheapest provider solves, you pay its rate.

{
    "status": "ready",
    "taskId": "01KFNDF328KAN2AJ3BNHCQYE88",
    "errorId": 0,
    "cost": 0.00012,
    "taskType": "ReCaptchaV2TokenProxyLess",
    "provider": "Multibot",
    "solution": {
        "token": "03AGdBq24PBCbwiDRaS_MJ7Z…"
    },
    "retry": {
        "totalAttempts": 2,
        "retries": 0,
        "fallbacks": 1,
        "provider": "Multibot",
        "attempts": [
            {
                "attempt": 0,
                "provider": "SCTG",
                "kind": "initial",
                "errorCode": "CAPTCHA_UNSOLVABLE",
                "errorDescription": "The captcha could not be solved. Check your parameters or try again.",
                "durationMs": 18234
            },
            {
                "attempt": 1,
                "provider": "Multibot",
                "kind": "fallback",
                "durationMs": 9120
            }
        ]
    }
}

Retry and fallback statistics describes every field.

How long to wait

Solve time depends on the task type and the provider that runs it. Provider stats shows the measured p50 and p90 solve time for every provider and task type.

Every task ends ready or failed within 30 minutes of createTask. A task still running then fails with TASK_TIMEOUT and its estimate is refunded. Give your polling loop an overall timeout of 31 minutes, just past that lifetime, so it always reads the final status. A task you stop polling still finishes, and is still charged if it is solved.

A finished task stays readable for 5 minutes, then getTaskResult returns TASK_NOT_FOUND. Read the result promptly.

Polling every 0.5 seconds is 120 requests a minute per task, far inside the request limit of 10,000 requests per 10 seconds per client IP.

Need the result faster?

solveTask returns the result in the same request. Sync or async explains when to use it.

Limits

LimitValueWhat happens past it
Request rate10,000 requests per 10 seconds, per client IPThat request returns RATE_LIMITED. Back off and retry.
Tasks in flight1,000 processing tasks per API keycreateTask returns RATE_LIMITED before any charge. Support can raise it.
Task lifetime30 minutes from createTask, across every retry and fallbackThe task fails with TASK_TIMEOUT and the estimate is refunded.
Result retention5 minutes after the task is ready or failedgetTaskResult returns TASK_NOT_FOUND. Store the solution as soon as you read it.

Handle common errors

A first integration meets these errors most:

errorCodeWhen you see itCharged?What to do
ERROR_KEY_DOES_NOT_EXISTThe API key is empty, unknown, disabled or deletedNot chargedCopy the key from API keys in the dashboard and check it is enabled
ERROR_ZERO_BALANCEYour balance is below the task's estimateNot chargedTop up in Billing, then send the request again
NO_PROVIDERS_AVAILABLENo provider in your routing settings can take the task typeNot chargedSwitch to an auto* mode, or add a supporting provider to your Priority order
INVALID_SITEKEYThe provider says the sitekey does not match the pageRefundedCopy the sitekey from the target page again, then create a new task

Task requests return HTTP 200 even on failure. Branch on errorId (0 success, 1 request or provider error, 2 AnySolver internal error), not on the status code. Error handling lists every code.

Complete examples

const API_URL = 'https://api.anysolver.com';
const API_KEY = 'YOUR_API_KEY';
const POLL_INTERVAL_MS = 1_000;
const POLL_TIMEOUT_MS = 31 * 60_000;

const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));

async function call(endpoint, params) {
    const response = await fetch(`${API_URL}/${endpoint}`, {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({ clientKey: API_KEY, ...params }),
    });
    const data = await response.json();
    if (data.errorId !== 0) throw new Error(`${data.errorCode}: ${data.errorDescription}`);
    return data;
}

async function solve(task) {
    const { taskId } = await call('createTask', { task });
    const deadline = Date.now() + POLL_TIMEOUT_MS;

    while (Date.now() < deadline) {
        await sleep(POLL_INTERVAL_MS);
        const result = await call('getTaskResult', { taskId });
        if (result.status === 'ready') return result.solution;
    }
    throw new Error(`Task ${taskId} did not finish in time`);
}

solve({
    type: 'ReCaptchaV2TokenProxyLess',
    websiteURL: 'https://www.google.com/recaptcha/api2/demo',
    websiteKey: '6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-',
    pageTitle: 'ReCAPTCHA demo',
}).then((solution) => console.log('Token:', solution.token));

Next steps