# 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:** 12 total users, 2 monthly users, 35.4% runs succeeded, 0 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/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).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": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,2captcha/two-captcha-solver"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/BQU5alSFDNFLb17o3/builds/bX9UjYohRCkfXOiI6/openapi.json
