# 2Captcha Solver (`2captcha/two-captcha-solver`) Actor

Solves Turnstile, reCAPTCHA v2, reCAPTCHA v3, reCAPTCHA Enterprise and normal image captchas via the official 2Captcha API.

- **URL**: https://apify.com/2captcha/two-captcha-solver.md
- **Developed by:** [Mark](https://apify.com/2captcha) (community)
- **Categories:** Developer tools, Automation
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-usage

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## 2Captcha Solver

Official Apify Actor wrapper around the [2Captcha](https://2captcha.com) API. Solve **Cloudflare Turnstile**, **reCAPTCHA v2 / v3 / Enterprise** and **normal image (text) captchas** directly from your scrapers, automations, and workflows running on the Apify platform — no SDK integration required.

This Actor is maintained by 2Captcha, the original captcha-solving service.

### What it does

You give the Actor:
- Your **2Captcha API key** (created in the [2Captcha dashboard](https://2captcha.com/enterpage)),
- The **captcha type** you want to solve,
- The relevant parameters for that type (URL + sitekey, or a base64 image),
- Optionally a **proxy** configuration (Apify Proxy or your own list).

The Actor sends the task to 2Captcha's `createTask` endpoint, polls `getTaskResult` every 5 seconds, and stores the resulting **token / text** in the default dataset together with the task metadata. Total wait time is capped at **5 minutes** per run.

### Supported captcha types

| `captchaType` | 2Captcha task type | What goes into `token` |
| --- | --- | --- |
| `turnstile` | `TurnstileTaskProxyless` / `TurnstileTask` | Cloudflare Turnstile token |
| `recaptchaV2` | `RecaptchaV2TaskProxyless` / `RecaptchaV2Task` | `g-recaptcha-response` |
| `recaptchaV3` | `RecaptchaV3TaskProxyless` (always proxyless) | `g-recaptcha-response` |
| `recaptchaEnterprise` | `RecaptchaV2EnterpriseTaskProxyless` / `RecaptchaV2EnterpriseTask` | `g-recaptcha-response` |
| `normal` | `ImageToTextTask` | The text recognized in the image |

### Input

All input fields are configured through a clean UI on the Apify console.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `apiKey` | string (secret) | yes | Your 2Captcha API key. Encrypted on the platform. |
| `captchaType` | enum | yes | One of `turnstile`, `recaptchaV2`, `recaptchaV3`, `recaptchaEnterprise`, `normal`. |
| `url` | string | for non-`normal` | Full URL of the page where the captcha appears. |
| `sitekey` | string | for non-`normal` | The captcha sitekey rendered on that page. |
| `action` | string | optional | Used for `recaptchaV3` / `recaptchaEnterprise`. Defaults to `verify`. |
| `minScore` | string | optional | reCAPTCHA v3 minimum score, `0.1`–`0.9`. Defaults to `0.3`. |
| `base64` | string | for `normal` | Base64-encoded captcha image. |
| `proxyConfiguration` | object | optional | Apify Proxy or a custom proxy list. Forwarded to 2Captcha so the captcha is solved from your IP. **Ignored for `recaptchaV3` and `normal`.** |

### Output

A single record is pushed to the default dataset on success:

```json
{
  "taskId": 82540839253,
  "captchaType": "recaptchaV2",
  "token": "0cAFcWeA7eb...rAvhcSPdb0N6mv1CeaPkbPDeQqaNM4Glu...",
  "cost": "0.16",
  "ip": "171.97.52.200",
  "solveCount": 3,
  "createTime": 1777352791,
  "endTime": 1777352832,
  "solvedAt": "2026-04-28T05:07:13.294Z"
}
````

If 2Captcha returns an error (`errorId !== 0`) or the task is still processing after 300 seconds, the run finishes with a clear failure message in the run status.

### Pricing

- **You pay 2Captcha** for every successfully solved captcha. See [2Captcha pricing](https://2captcha.com/pricing) — typical rates are around `$2.99/1000` for reCAPTCHA v2 and `$0.50/1000` for normal image captchas. Failed solves are not charged.
- **You also pay Apify** for the compute units used by this Actor (very small — most runs finish in 5–60 seconds).

### Examples

#### reCAPTCHA v2

```json
{
  "apiKey": "YOUR_2CAPTCHA_API_KEY",
  "captchaType": "recaptchaV2",
  "url": "https://www.google.com/recaptcha/api2/demo",
  "sitekey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-"
}
```

#### Cloudflare Turnstile

```json
{
  "apiKey": "YOUR_2CAPTCHA_API_KEY",
  "captchaType": "turnstile",
  "url": "https://target-site.example/login",
  "sitekey": "0xABCDEFGH..."
}
```

#### reCAPTCHA v3

```json
{
  "apiKey": "YOUR_2CAPTCHA_API_KEY",
  "captchaType": "recaptchaV3",
  "url": "https://target-site.example/checkout",
  "sitekey": "6Lc...",
  "action": "checkout",
  "minScore": "0.7"
}
```

#### Normal image captcha

```json
{
  "apiKey": "YOUR_2CAPTCHA_API_KEY",
  "captchaType": "normal",
  "base64": "iVBORw0KGgoAAAANSUhEUgAAA..."
}
```

#### With Apify Proxy (for IP-bound captchas)

```json
{
  "apiKey": "YOUR_2CAPTCHA_API_KEY",
  "captchaType": "recaptchaV2",
  "url": "https://target-site.example/login",
  "sitekey": "6Lc...",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}
```

When a proxy is supplied for non-`recaptchaV3` / non-`normal` captchas, the Actor parses the proxy URL and forwards `proxyType / proxyAddress / proxyPort / proxyLogin / proxyPassword` to 2Captcha, switching the task type from `*Proxyless` to the proxied variant automatically.

### Calling this Actor from your own scraper

The standard Apify pattern: call this Actor from any Apify SDK / API client and read its dataset.

```ts
import { Actor } from 'apify';

const run = await Actor.call('two-captcha/two-captcha-solver', {
    apiKey: process.env.TWOCAPTCHA_API_KEY,
    captchaType: 'recaptchaV2',
    url: 'https://target-site.example/login',
    sitekey: '6Lc...',
});

const { items } = await Actor.openDataset(run.defaultDatasetId).then(d => d.getData());
const token = items[0].token;
```

### Limits and notes

- Each run solves **one** captcha. For high-volume usage, call the Actor in parallel from your scraper.
- The polling timeout is **300 seconds** per task. Most reCAPTCHA v2 / Turnstile / normal captchas resolve in well under 60 seconds.
- The `softId` of every request is set to `5656` (2Captcha partner ID).
- The full source is open and runs as a transparent thin wrapper — no captured input data, no proxying through third-party services.

### Support

- 2Captcha service questions, billing, balance: <support@2captcha.com> / [Telegram](https://t.me/captchasupport_bot)
- Issues with this Actor: open an issue on the Actor's GitHub or contact us through the Apify console.

### Useful links

- [2Captcha homepage](https://2captcha.com)
- [2Captcha API v2 docs](https://2captcha.com/api-docs)
- [2Captcha pricing](https://2captcha.com/pricing)
- [Apify Proxy docs](https://docs.apify.com/platform/proxy)

# Actor input Schema

## `apiKey` (type: `string`):

Your 2Captcha API key (clientKey). You can find it in your 2Captcha account dashboard.

## `captchaType` (type: `string`):

The type of captcha you want to solve.

## `url` (type: `string`):

Full URL of the page where the captcha is located. Required for all captcha types EXCEPT 'normal'. Hidden / ignored when captchaType is 'normal'.

## `sitekey` (type: `string`):

Captcha site key found on the target page. Required for all captcha types EXCEPT 'normal'. Hidden / ignored when captchaType is 'normal'.

## `action` (type: `string`):

Action parameter sent with the captcha solving request. Used ONLY when captchaType is 'recaptchaV3' or 'recaptchaEnterprise'.

## `minScore` (type: `string`):

Minimum reCAPTCHA v3 score (0.1 - 0.9). Used ONLY when captchaType is 'recaptchaV3'. Higher values give a stronger token but are slower / costlier. Stored as a string because Apify Input Schema does not support decimal numbers natively.

## `base64` (type: `string`):

Base64-encoded image to be solved. Used ONLY when captchaType is 'normal'. Hidden / ignored for all other captcha types.

## `proxyConfiguration` (type: `object`):

Optional proxy. If provided, the proxy is forwarded to 2Captcha so the captcha is solved from your IP. Ignored for 'recaptchaV3' (always proxyless) and for 'normal' (image-based, no proxy needed). Supports both Apify Proxy and a custom proxy list.

## Actor input object example

```json
{
  "captchaType": "recaptchaV2",
  "action": "verify",
  "minScore": "0.3"
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("2captcha/two-captcha-solver").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("2captcha/two-captcha-solver").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call 2captcha/two-captcha-solver --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=2captcha/two-captcha-solver",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "2Captcha Solver",
        "description": "Solves Turnstile, reCAPTCHA v2, reCAPTCHA v3, reCAPTCHA Enterprise and normal image captchas via the official 2Captcha API.",
        "version": "0.0",
        "x-build-id": "bX9UjYohRCkfXOiI6"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/2captcha~two-captcha-solver/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-2captcha-two-captcha-solver",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/2captcha~two-captcha-solver/runs": {
            "post": {
                "operationId": "runs-sync-2captcha-two-captcha-solver",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/2captcha~two-captcha-solver/run-sync": {
            "post": {
                "operationId": "run-sync-2captcha-two-captcha-solver",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "apiKey",
                    "captchaType"
                ],
                "properties": {
                    "apiKey": {
                        "title": "2Captcha API key",
                        "type": "string",
                        "description": "Your 2Captcha API key (clientKey). You can find it in your 2Captcha account dashboard."
                    },
                    "captchaType": {
                        "title": "Captcha type",
                        "enum": [
                            "turnstile",
                            "recaptchaV2",
                            "recaptchaV3",
                            "recaptchaEnterprise",
                            "normal"
                        ],
                        "type": "string",
                        "description": "The type of captcha you want to solve.",
                        "default": "recaptchaV2"
                    },
                    "url": {
                        "title": "Page URL",
                        "type": "string",
                        "description": "Full URL of the page where the captcha is located. Required for all captcha types EXCEPT 'normal'. Hidden / ignored when captchaType is 'normal'."
                    },
                    "sitekey": {
                        "title": "Site key",
                        "type": "string",
                        "description": "Captcha site key found on the target page. Required for all captcha types EXCEPT 'normal'. Hidden / ignored when captchaType is 'normal'."
                    },
                    "action": {
                        "title": "Action",
                        "type": "string",
                        "description": "Action parameter sent with the captcha solving request. Used ONLY when captchaType is 'recaptchaV3' or 'recaptchaEnterprise'.",
                        "default": "verify"
                    },
                    "minScore": {
                        "title": "Minimum score",
                        "pattern": "^0?\\.[1-9]$",
                        "type": "string",
                        "description": "Minimum reCAPTCHA v3 score (0.1 - 0.9). Used ONLY when captchaType is 'recaptchaV3'. Higher values give a stronger token but are slower / costlier. Stored as a string because Apify Input Schema does not support decimal numbers natively.",
                        "default": "0.3"
                    },
                    "base64": {
                        "title": "Image (base64)",
                        "type": "string",
                        "description": "Base64-encoded image to be solved. Used ONLY when captchaType is 'normal'. Hidden / ignored for all other captcha types."
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Optional proxy. If provided, the proxy is forwarded to 2Captcha so the captcha is solved from your IP. Ignored for 'recaptchaV3' (always proxyless) and for 'normal' (image-based, no proxy needed). Supports both Apify Proxy and a custom proxy list."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
