getTaskResult
Poll for task status and retrieve the solution.
Poll a task until it is ready or failed. Returns the current status and, when complete, the solution.
/getTaskResultAuthentication
Pass your AnySolver API key as clientKey in the JSON body. Send Content-Type: application/json.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
clientKey* | string | Yes | Your API key from the AnySolver dashboard. |
taskId* | string | Yes | Unique identifier returned when the task was created. |
Example Request
{ "clientKey": "your-api-key-from-dashboard", "taskId": "01KFNDF328KAN2AJ3BNHCQYE88"}Example
{ "clientKey": "YOUR_API_KEY", "taskId": "01KFNDF328KAN2AJ3BNHCQYE88"}curl -X POST https://api.anysolver.com/getTaskResult \ -H 'Content-Type: application/json' \ -d '{"clientKey":"YOUR_API_KEY","taskId":"01KFNDF328KAN2AJ3BNHCQYE88"}'const res = await fetch('https://api.anysolver.com/getTaskResult', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ "clientKey": "YOUR_API_KEY", "taskId": "01KFNDF328KAN2AJ3BNHCQYE88"}),});const data = await res.json();import requestsres = requests.post( 'https://api.anysolver.com/getTaskResult', json={ "clientKey": "YOUR_API_KEY", "taskId": "01KFNDF328KAN2AJ3BNHCQYE88"},).json()Response body
See Error IDs for what each errorId value means.
| Field | Type | Required | Description |
|---|---|---|---|
status* | Yes | Task status: "processing", "ready", or "failed". Example: | |
errorId* | Yes | 0 = success, 1 = external error, 2 = internal error. Example: | |
taskId | string | No | Unique identifier returned when the task was created. Example: |
errorCode | No | Machine-readable error code (e.g., "CAPTCHA_UNSOLVABLE"). Example: | |
errorDescription | string | No | Human-readable error message with resolution hints. Example: |
cost | number | No | Actual cost charged for this task in USD. Example: |
taskType | No | The type of CAPTCHA task to solve. Example: | |
provider | No | Specific provider to use. If omitted, automatic routing selects the best provider. Example: |
Status values
| Status | Description |
|---|---|
| processing | Task is queued or being solved by a provider. |
| ready | Task completed successfully. Solution is available. |
| failed | Task failed. Check errorCode for details. |
Examples
Processing Response
{ "status": "processing", "taskId": "01KFNDF328KAN2AJ3BNHCQYE88", "errorId": 0, "taskType": "ReCaptchaV2TokenProxyLess", "provider": "Multibot", "solution": null}Ready Response
{ "status": "ready", "taskId": "01KFNDF328KAN2AJ3BNHCQYE88", "errorId": 0, "cost": 0.00013, "taskType": "ReCaptchaV2TokenProxyLess", "provider": "Multibot", "solution": { "token": "03AGdBq24PBCbwiDRaS_MJ7Z..." }}Failed Response
{ "status": "failed", "taskId": "01KFNDF328KAN2AJ3BNHCQYE88", "errorId": 1, "errorCode": "CAPTCHA_UNSOLVABLE", "errorDescription": "The captcha could not be solved.", "taskType": "ReCaptchaV2TokenProxyLess", "provider": "Multibot", "solution": null}Polling
Wait three to five seconds after createTask before the first poll. Then poll every two to three seconds until status is ready or failed. Cap total wait around 120 seconds.
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));
Errors
| Error code | Cause | Fix |
|---|---|---|
TASK_NOT_FOUND | Task ID is unknown or has expired. | Re-create the task with createTask. |
CAPTCHA_UNSOLVABLE | The provider could not solve the CAPTCHA. | Refunded automatically. Verify sitekey, domain, and proxy. |
TASK_TIMEOUT | Task did not complete in time. | Refunded automatically. Retry; consider a different provider. |
PROXY_CONNECTION_FAILED | Provider could not connect through your proxy. | Refunded automatically. Check the proxy is reachable from the public internet. |
Full list: Error handling.
Notes
- Responses always return HTTP 200. Branch on
errorId, not the HTTP status. - The
solutionobject shape is task-specific. See the relevant page in Tasks for the exact fields. - Solutions and error descriptions are removed roughly 24 hours after the task completes. Persist anything you need before then. Task metadata (status, cost, timestamps) is retained for billing.