# Scrapfly Documentation

## Table of Contents

### Dashboard

- [Intro](https://scrapfly.io/docs)
- [Project](https://scrapfly.io/docs/project)
- [Account](https://scrapfly.io/docs/account)
- [Workspace & Team](https://scrapfly.io/docs/workspace-and-team)
- [Billing](https://scrapfly.io/docs/billing)

### Products

#### MCP Server

- [Getting Started](https://scrapfly.io/docs/mcp/getting-started)
- [Tools & API Spec](https://scrapfly.io/docs/mcp/tools)
- [Authentication](https://scrapfly.io/docs/mcp/authentication)
- [Examples & Use Cases](https://scrapfly.io/docs/mcp/examples)
- [FAQ](https://scrapfly.io/docs/mcp/faq)
##### Integrations

- [Overview](https://scrapfly.io/docs/mcp/integrations)
- [Claude Desktop](https://scrapfly.io/docs/mcp/integrations/claude-desktop)
- [Claude Code](https://scrapfly.io/docs/mcp/integrations/claude-code)
- [Codex](https://scrapfly.io/docs/mcp/integrations/codex)
- [Gemini CLI](https://scrapfly.io/docs/mcp/integrations/gemini-cli)
- [Antigravity](https://scrapfly.io/docs/mcp/integrations/antigravity)
- [OpenCode](https://scrapfly.io/docs/mcp/integrations/opencode)
- [ChatGPT](https://scrapfly.io/docs/mcp/integrations/chatgpt)
- [Cursor](https://scrapfly.io/docs/mcp/integrations/cursor)
- [Cline](https://scrapfly.io/docs/mcp/integrations/cline)
- [Windsurf](https://scrapfly.io/docs/mcp/integrations/windsurf)
- [Zed](https://scrapfly.io/docs/mcp/integrations/zed)
- [Roo Code](https://scrapfly.io/docs/mcp/integrations/roo-code)
- [VS Code](https://scrapfly.io/docs/mcp/integrations/vscode)
- [LangChain](https://scrapfly.io/docs/mcp/integrations/langchain)
- [LlamaIndex](https://scrapfly.io/docs/mcp/integrations/llamaindex)
- [CrewAI](https://scrapfly.io/docs/mcp/integrations/crewai)
- [OpenAI](https://scrapfly.io/docs/mcp/integrations/openai)
- [n8n](https://scrapfly.io/docs/mcp/integrations/n8n)
- [Make](https://scrapfly.io/docs/mcp/integrations/make)
- [Zapier](https://scrapfly.io/docs/mcp/integrations/zapier)
- [Vapi AI](https://scrapfly.io/docs/mcp/integrations/vapi)
- [Agent Builder](https://scrapfly.io/docs/mcp/integrations/agent-builder)
- [Custom Client](https://scrapfly.io/docs/mcp/integrations/custom-client)


#### Web Scraping API

- [Getting Started](https://scrapfly.io/docs/scrape-api/getting-started)
- [API Specification]()
- [Monitoring](https://scrapfly.io/docs/monitoring)
- [Customize Request](https://scrapfly.io/docs/scrape-api/custom)
- [Debug](https://scrapfly.io/docs/scrape-api/debug)
- [Unblocker (formerly ASP)](https://scrapfly.io/docs/scrape-api/unblocker)
- [Proxy](https://scrapfly.io/docs/scrape-api/proxy)
- [Proxy Mode](https://scrapfly.io/docs/scrape-api/proxy-mode)
- [Proxy Mode - Screaming Frog](https://scrapfly.io/docs/scrape-api/proxy-mode/screaming-frog)
- [Proxy Mode - Apify](https://scrapfly.io/docs/scrape-api/proxy-mode/apify)
- [(Auto) Data Extraction](https://scrapfly.io/docs/scrape-api/extraction)
- [Javascript Rendering](https://scrapfly.io/docs/scrape-api/javascript-rendering)
- [Javascript Scenario](https://scrapfly.io/docs/scrape-api/javascript-scenario)
- [SSL](https://scrapfly.io/docs/scrape-api/ssl)
- [DNS](https://scrapfly.io/docs/scrape-api/dns)
- [Cache](https://scrapfly.io/docs/scrape-api/cache)
- [Batch (Multi-URL Scraping)](https://scrapfly.io/docs/scrape-api/batch)
- [Session](https://scrapfly.io/docs/scrape-api/session)
- [Webhook](https://scrapfly.io/docs/scrape-api/webhook)
- [Schedule](https://scrapfly.io/docs/scrape-api/schedule)
- [Screenshot](https://scrapfly.io/docs/scrape-api/screenshot)
- [Errors](https://scrapfly.io/docs/scrape-api/errors)
- [Timeout](https://scrapfly.io/docs/scrape-api/understand-timeout)
- [Throttling](https://scrapfly.io/docs/throttling)
- [Troubleshoot](https://scrapfly.io/docs/scrape-api/troubleshoot)
- [Billing](https://scrapfly.io/docs/scrape-api/billing)
- [FAQ](https://scrapfly.io/docs/scrape-api/faq)

#### Crawler API

- [Getting Started](https://scrapfly.io/docs/crawler-api/getting-started)
- [API Specification]()
- [Retrieving Results](https://scrapfly.io/docs/crawler-api/results)
- [WARC Format](https://scrapfly.io/docs/crawler-api/warc-format)
- [Data Extraction](https://scrapfly.io/docs/crawler-api/extraction-rules)
- [Search](https://scrapfly.io/docs/crawler-api/search)
- [Prompt & Extract](https://scrapfly.io/docs/crawler-api/prompt)
- [Auto Refresh](https://scrapfly.io/docs/crawler-api/refresh)
- [Webhook](https://scrapfly.io/docs/crawler-api/webhook)
- [Schedule](https://scrapfly.io/docs/crawler-api/schedule)
- [Billing](https://scrapfly.io/docs/crawler-api/billing)
- [Errors](https://scrapfly.io/docs/crawler-api/errors)
- [Troubleshoot](https://scrapfly.io/docs/crawler-api/troubleshoot)
- [FAQ](https://scrapfly.io/docs/crawler-api/faq)

#### Screenshot API

- [Getting Started](https://scrapfly.io/docs/screenshot-api/getting-started)
- [API Specification]()
- [Accessibility Testing](https://scrapfly.io/docs/screenshot-api/accessibility)
- [Webhook](https://scrapfly.io/docs/screenshot-api/webhook)
- [Schedule](https://scrapfly.io/docs/screenshot-api/schedule)
- [Billing](https://scrapfly.io/docs/screenshot-api/billing)
- [Errors](https://scrapfly.io/docs/screenshot-api/errors)

#### Extraction API

- [Getting Started](https://scrapfly.io/docs/extraction-api/getting-started)
- [API Specification]()
- [Rules Template](https://scrapfly.io/docs/extraction-api/rules-and-template)
- [LLM Extraction](https://scrapfly.io/docs/extraction-api/llm-prompt)
- [AI Auto Extraction](https://scrapfly.io/docs/extraction-api/automatic-ai)
- [Webhook](https://scrapfly.io/docs/extraction-api/webhook)
- [Billing](https://scrapfly.io/docs/extraction-api/billing)
- [Errors](https://scrapfly.io/docs/extraction-api/errors)
- [FAQ](https://scrapfly.io/docs/extraction-api/faq)

#### Data API


#### Proxy Saver

- [Getting Started](https://scrapfly.io/docs/proxy-saver/getting-started)
- [Fingerprints](https://scrapfly.io/docs/proxy-saver/fingerprints)
- [Optimizations](https://scrapfly.io/docs/proxy-saver/optimizations)
- [SSL Certificates](https://scrapfly.io/docs/proxy-saver/certificates)
- [Protocols](https://scrapfly.io/docs/proxy-saver/protocols)
- [Pacfile](https://scrapfly.io/docs/proxy-saver/pacfile)
- [Secure Credentials](https://scrapfly.io/docs/proxy-saver/security)
- [Billing](https://scrapfly.io/docs/proxy-saver/billing)

#### Cloud Browser API

- [Getting Started](https://scrapfly.io/docs/cloud-browser-api/getting-started)
- [Proxy & Geo-Targeting](https://scrapfly.io/docs/cloud-browser-api/proxy)
- [Unblock API](https://scrapfly.io/docs/cloud-browser-api/unblock)
- [Captcha Solver](https://scrapfly.io/docs/cloud-browser-api/captcha-solver)
- [Network Policy](https://scrapfly.io/docs/cloud-browser-api/network-policy)
- [File Downloads](https://scrapfly.io/docs/cloud-browser-api/file-downloads)
- [Session Resume](https://scrapfly.io/docs/cloud-browser-api/session-resume)
- [Human-in-the-Loop](https://scrapfly.io/docs/cloud-browser-api/human-in-the-loop)
- [Debug Mode](https://scrapfly.io/docs/cloud-browser-api/debug-mode)
- [Browser Extensions](https://scrapfly.io/docs/cloud-browser-api/extensions)
- [Credential Vault](https://scrapfly.io/docs/cloud-browser-api/credential-vault)
- [Native Browser MCP](https://scrapfly.io/docs/cloud-browser-api/mcp)
- [DevTools Protocol](https://scrapfly.io/docs/cloud-browser-api/cdp-reference)
##### Integrations

- [Puppeteer](https://scrapfly.io/docs/cloud-browser-api/puppeteer)
- [Playwright](https://scrapfly.io/docs/cloud-browser-api/playwright)
- [Selenium](https://scrapfly.io/docs/cloud-browser-api/selenium)
- [Vercel Agent Browser](https://scrapfly.io/docs/cloud-browser-api/agent-browser)
- [Browser Use](https://scrapfly.io/docs/cloud-browser-api/browser-use)
- [Stagehand](https://scrapfly.io/docs/cloud-browser-api/stagehand)
- [1Password](https://scrapfly.io/docs/cloud-browser-api/1password)

- [Billing](https://scrapfly.io/docs/cloud-browser-api/billing)
- [Errors](https://scrapfly.io/docs/cloud-browser-api/errors)


### Tools

- [Antibot Detector](https://scrapfly.io/docs/tools/antibot-detector)

### SDK

- [Golang](https://scrapfly.io/docs/sdk/golang)
- [PHP](https://scrapfly.io/docs/sdk/php)
- [Python](https://scrapfly.io/docs/sdk/python)
- [Rust](https://scrapfly.io/docs/sdk/rust)
- [TypeScript](https://scrapfly.io/docs/sdk/typescript)
- [Scrapy](https://scrapfly.io/docs/sdk/scrapy)

### Integrations

- [Getting Started](https://scrapfly.io/docs/integration/getting-started)
- [LangChain](https://scrapfly.io/docs/integration/langchain)
- [LlamaIndex](https://scrapfly.io/docs/integration/llamaindex)
- [CrewAI](https://scrapfly.io/docs/integration/crewai)
- [Zapier](https://scrapfly.io/docs/integration/zapier)
- [Make](https://scrapfly.io/docs/integration/make)
- [n8n](https://scrapfly.io/docs/integration/n8n)

### Academy

- [Overview](https://scrapfly.io/academy)
- [Web Scraping Overview](https://scrapfly.io/academy/scraping-overview)
- [Tools](https://scrapfly.io/academy/tools-overview)
- [Reverse Engineering](https://scrapfly.io/academy/reverse-engineering)
- [Static Scraping](https://scrapfly.io/academy/static-scraping)
- [HTML Parsing](https://scrapfly.io/academy/html-parsing)
- [Dynamic Scraping](https://scrapfly.io/academy/dynamic-scraping)
- [Hidden API Scraping](https://scrapfly.io/academy/hidden-api-scraping)
- [Headless Browsers](https://scrapfly.io/academy/headless-browsers)
- [Hidden Web Data](https://scrapfly.io/academy/hidden-web-data)
- [JSON Parsing](https://scrapfly.io/academy/json-parsing)
- [Data Processing](https://scrapfly.io/academy/data-processing)
- [Scaling](https://scrapfly.io/academy/scaling)
- [Walkthrough Summary](https://scrapfly.io/academy/walkthrough-summary)
- [Scraper Blocking](https://scrapfly.io/academy/scraper-blocking)
- [Proxies](https://scrapfly.io/academy/proxies)

---

# Captcha Solver

1. [Cloud Browser](https://scrapfly.io/docs/cloud-browser-api/getting-started)
2. Captcha Solver

 Scrapfly Cloud Browser can **detect and solve captchas automatically** while your browser session is live. Enable the captcha solver once, and every challenge that appears on the page (Turnstile, reCAPTCHA, DataDome, GeeTest, PerimeterX) is handled by the browser itself. Your code only observes the outcome through four structured CDP events.

 The captcha solver is part of the `Antibot` CDP domain and is available on every Cloud Browser session.

## How It Works

 A Cloud Browser session exposes a custom `Antibot` CDP domain in addition to the standard Chrome DevTools Protocol surface. A single call to `Antibot.captchaEnable` arms the browser's built-in solver for the lifetime of the session:

1. **Detect:** The browser watches every page it loads, iframes included, for the captcha challenges it supports.
2. **Solve:** When it finds one, the browser solves it on its own. Your code sends nothing.
3. **Notify:** Your code receives CDP events at each step: `captchaDetected`, `captchaSolvingStarted`, `captchaSolved`, or `captchaError`. Use them to update UI, log outcomes, or gate subsequent actions on success.
4. **Continue:** Solves are serialized one-at-a-time; the browser never runs two in parallel, so the page state stays predictable.

 **Zero-orchestration design:** You do *not* call `solveCaptcha` yourself after each detection. The browser already does. `solveCaptcha` exists as a manual escape hatch for custom flows; the default automation path is `captchaEnable` plus listening for events.

## Supported Captcha Types

| Type | `CaptchaType` |
|---|---|
| Cloudflare Turnstile (checkbox) | `turnstile_checkbox` |
| Cloudflare Turnstile (invisible) | `turnstile` |
| DataDome slider | `datadome_slider` |
| Google reCAPTCHA v2/v3 | `recaptcha` |
| Puzzle Click | `puzzle_click` |
| GeeTest | `geetest` |
| PerimeterX hold challenge | `perimeterx_hold` |
| Rotation slider | `cs_captcha_rotation` |
| AWS WAF captcha | `aws_waf` |
| Arkose Labs (FunCaptcha) | `funcaptcha` |
| Any other supported type | *(default)* |

What each type costs: see [Billing](#billing).

 **About `datadome`:** the type of DataDome's block page, which DataDome shows when it has blocked the session outright. There is no challenge on it to solve, so the detection is reported with `captchaDetected` and always ends in `captchaError`. It is never billed.

 What to do: close the session and open a new one. Choosing another proxy pool or country for the new session, the residential pool for example, often helps.

## Enabling the Solver

 The captcha solver is **opt-in**, it only runs when you ask for it. There are two ways to turn it on, and both result in the browser firing `Antibot.captchaEnable` on the first page attach.

### 1. `solve_captcha=true` connection parameter *(recommended)*

 Add `solve_captcha=true` to the Cloud Browser WebSocket URL (or pass it as an SDK option). The browser arms the solver as soon as the first page loads, no extra CDP plumbing in your client code.

| Parameter | Type | Default | Description |
|---|---|---|---|
| `solve_captcha` | boolean | `false` | When `true`, turns on captcha detection and solving on the first page attach. Turnstile, DataDome slider, reCAPTCHA, GeeTest, PerimeterX hold, and puzzle captchas are handled automatically. Billed per solve, see [Pricing](https://scrapfly.io/docs/cloud-browser-api/billing). A `captchaError` costs nothing, unless the captcha's solve had started ([Billing](#billing)). |

  WSS URL  Python SDK  TypeScript SDK  CLI

```
wss://browser.scrapfly.io?api_key=&proxy_pool=public_residential_pool&country=us&solve_captcha=true
```

```
from scrapfly import BrowserConfig, ScrapflyClient

client = ScrapflyClient(key="")
ws_url = client.cloud_browser(BrowserConfig(
    proxy_pool="residential",
    country="us",
    solve_captcha=True,   # arms the solver on page attach
))
```

```
import { ScrapflyClient, BrowserConfig } from 'scrapfly-sdk';

const client = new ScrapflyClient({ key: '' });
const wsUrl = client.cloudBrowser(new BrowserConfig({
    proxy_pool: 'residential',
    country: 'us',
    solve_captcha: true,   // arms the solver on page attach
}));
```

```
scrapfly browser \
  --proxy-pool residential \
  --country us \
  --solve-captcha \
  --pretty
```

 Once enabled, the solver remains active for the rest of the session. You can still subscribe to `Antibot.captchaDetected` / `captchaSolved` / `captchaError` events to observe progress.

#### Listening for events with `solve_captcha=true`

 With `solve_captcha=true` the browser arms the solver on its own page session before your client code runs. Captcha events are **delivered to every CDP session you open** on the page, so you can attach listeners to a fresh `context.new_cdp_session(page)` and receive them without calling `captchaEnable` yourself:

   Python · Playwright  JS · Playwright

```
from scrapfly import BrowserConfig, ScrapflyClient
from playwright.sync_api import sync_playwright

client = ScrapflyClient(key="")
ws_url = client.cloud_browser(BrowserConfig(
    proxy_pool="residential", country="us",
    solve_captcha=True,            # solver armed automatically
))

with sync_playwright() as p:
    browser = p.chromium.connect_over_cdp(ws_url)
    context = browser.contexts[0]
    page = context.pages[0] if context.pages else context.new_page()

    # A fresh CDP session works — events are mirrored to it.
    cdp = context.new_cdp_session(page)

    seen = set()
    def once(label):
        def handler(e):
            # Dedup on detectionId: the same event may arrive on
            # more than one session if you open several.
            det = e.get("detectionId")
            if det and (label, det) in seen:
                return
            seen.add((label, det))
            print(label, e)
        return handler

    cdp.on("Antibot.captchaDetected",       once("detected"))
    cdp.on("Antibot.captchaSolvingStarted", once("solving"))
    cdp.on("Antibot.captchaSolved",         once("solved"))
    cdp.on("Antibot.captchaError",          once("failed"))

    # Do NOT call captchaEnable — solve_captcha=true already armed it.
    page.goto("https://captcha-protected-site.com/login")
    page.wait_for_load_state("networkidle")

    browser.close()
```

```
import { chromium } from 'playwright';
import { ScrapflyClient, BrowserConfig } from 'scrapfly-sdk';

const client = new ScrapflyClient({ key: '' });
const wsUrl = client.cloudBrowser(new BrowserConfig({ proxy_pool: 'residential', country: 'us', solve_captcha: true }));

const browser = await chromium.connectOverCDP(wsUrl);
const context = browser.contexts()[0];
const page = context.pages()[0] ?? await context.newPage();

// A fresh CDP session works — events are mirrored to it.
const cdp = await context.newCDPSession(page);

const seen = new Set();
const once = (label) => (e) => {
    // Dedup on detectionId: the same event may arrive on more than
    // one session if you open several.
    const k = `${label}:${e.detectionId}`;
    if (seen.has(k)) return;
    seen.add(k);
    console.log(label, e);
};

cdp.on('Antibot.captchaDetected',       once('detected'));
cdp.on('Antibot.captchaSolvingStarted', once('solving'));
cdp.on('Antibot.captchaSolved',         once('solved'));
cdp.on('Antibot.captchaError',          once('failed'));

// Do NOT call captchaEnable — solve_captcha=true already armed it.
await page.goto('https://captcha-protected-site.com/login');
await page.waitForLoadState('networkidle');

await browser.close();
```

 **Common pitfall:** if you *don't* pass `solve_captcha=true` and instead arm the solver yourself, you must call `Antibot.captchaEnable` on the *same* CDP session you attached your listeners to. The `Antibot` domain is page-scoped: enabling it on one session and listening on another means you never see the events. The `solve_captcha=true` path above sidesteps this entirely.

### 2. `Antibot.captchaEnable` CDP command *(advanced)*

 For workflows that need runtime control (arm on specific pages only, re-arm after `captchaDisable`), skip the connection parameter and call `Antibot.captchaEnable` directly over CDP. See the [Quick Start](#quick-start) below for a full example.

## Quick Start

Enable the solver once, subscribe to the events you care about, and interact with the page normally. The browser handles the rest.

   Python · Playwright   JS · Playwright   Puppeteer

```
from scrapfly import BrowserConfig, ScrapflyClient
from playwright.sync_api import sync_playwright

client = ScrapflyClient(key="")
ws_url = client.cloud_browser(BrowserConfig(proxy_pool="residential", country="us"))

with sync_playwright() as p:
    browser = p.chromium.connect_over_cdp(ws_url)
    context = browser.contexts[0]
    page = context.pages[0] if context.pages else context.new_page()

    # Attach a raw CDP session to reach the Antibot domain
    cdp = context.new_cdp_session(page)

    # 1. Subscribe BEFORE enabling so no early detection is missed
    cdp.on("Antibot.captchaDetected",       lambda e: print("detected", e))
    cdp.on("Antibot.captchaSolvingStarted", lambda e: print("solving",  e))
    cdp.on("Antibot.captchaSolved",         lambda e: print("solved",   e))
    cdp.on("Antibot.captchaError",          lambda e: print("failed",   e))

    # 2. Arm the solver for the lifetime of this session
    cdp.send("Antibot.captchaEnable")

    # 3. Scrape as usual. Captchas are handled transparently
    page.goto("https://captcha-protected-site.com/product/42")
    page.wait_for_load_state("networkidle")
    print(page.title())

    # 4. (Optional) Inspect everything that happened this session
    history = cdp.send("Antibot.getSolvedCaptchas")
    print(history)

    browser.close()
```

```
import { chromium } from 'playwright';
import { ScrapflyClient, BrowserConfig } from 'scrapfly-sdk';

const client = new ScrapflyClient({ key: '' });
const wsUrl = client.cloudBrowser(new BrowserConfig({ proxy_pool: 'residential', country: 'us' }));

const browser = await chromium.connectOverCDP(wsUrl);
const context = browser.contexts()[0];
const page = context.pages()[0] ?? await context.newPage();

const cdp = await context.newCDPSession(page);

// 1. Subscribe BEFORE enabling
cdp.on('Antibot.captchaDetected',       (e) => console.log('detected', e));
cdp.on('Antibot.captchaSolvingStarted', (e) => console.log('solving',  e));
cdp.on('Antibot.captchaSolved',         (e) => console.log('solved',   e));
cdp.on('Antibot.captchaError',          (e) => console.log('failed',   e));

// 2. Arm the solver
await cdp.send('Antibot.captchaEnable');

// 3. Scrape as usual
await page.goto('https://captcha-protected-site.com/product/42');
await page.waitForLoadState('networkidle');
console.log(await page.title());

// 4. Inspect full session history
const history = await cdp.send('Antibot.getSolvedCaptchas');
console.log(history);

await browser.close();
```

```
import puppeteer from 'puppeteer-core';

const wsUrl = `wss://browser.scrapfly.io/?api_key=&proxy_pool=public_residential_pool&country=us`;
const browser = await puppeteer.connect({ browserWSEndpoint: wsUrl });

const [page] = await browser.pages();
const cdp = await page.target().createCDPSession();

// 1. Subscribe BEFORE enabling
cdp.on('Antibot.captchaDetected',       (e) => console.log('detected', e));
cdp.on('Antibot.captchaSolvingStarted', (e) => console.log('solving',  e));
cdp.on('Antibot.captchaSolved',         (e) => console.log('solved',   e));
cdp.on('Antibot.captchaError',          (e) => console.log('failed',   e));

// 2. Arm the solver
await cdp.send('Antibot.captchaEnable');

// 3. Scrape as usual
await page.goto('https://captcha-protected-site.com/product/42');
console.log(await page.title());

await browser.close();
```

 **MCP users:** If you are driving the browser through the [native MCP integration](https://scrapfly.io/docs/cloud-browser-api/mcp), `captchaEnable` is called automatically on every `cloud_browser_open` / `unblock`, and a concise captcha summary is appended to every tool response. No explicit wiring is needed.

## Event Flow

Per detection, the browser emits up to three events in sequence. The lifecycle is always terminal. A given `detectionId` either finishes with `captchaSolved` or with `captchaError`, never both, never a second attempt.

```
captchaDetected        ──▶   detectionId=abc  type=turnstile_checkbox  frameUrl=...
captchaSolvingStarted  ──▶   detectionId=abc  method=checkbox
captchaSolved          ──▶   detectionId=abc  method=checkbox  token=""
                      OR
captchaError           ──▶   detectionId=abc  errorMessage="<short reason>"
```

| Event | When it fires | Payload fields |
|---|---|---|
| `<a href="/docs/cloud-browser-api/cdp-reference/Antibot#event-captchaDetected">Antibot.captchaDetected</a>` | Browser recognized a captcha widget in any frame of the page | `detectionId`, `type`, `frameUrl`, `siteKey?`, `captchaUrl?` |
| `<a href="/docs/cloud-browser-api/cdp-reference/Antibot#event-captchaSolvingStarted">Antibot.captchaSolvingStarted</a>` | Browser started solving the challenge | `detectionId`, `type`, `method` (values in the [`CaptchaRecord`](https://scrapfly.io/docs/cloud-browser-api/cdp-reference/Antibot#type-CaptchaRecord) schema) |
| `<a href="/docs/cloud-browser-api/cdp-reference/Antibot#event-captchaSolved">Antibot.captchaSolved</a>` | Challenge completed successfully | `detectionId`, `type`, `method`, `token?` (set when the challenge gives the page a token) |
| `<a href="/docs/cloud-browser-api/cdp-reference/Antibot#event-captchaError">Antibot.captchaError</a>` | Challenge could not be solved. `errorMessage` says why, in a few words (see [Error Handling](#error-handling)) | `detectionId`, `type`, `errorMessage` |

> **Terminal failure:** When `captchaError` fires, the browser does *not* retry automatically and you should not retry the same `detectionId` either. The page has already consumed its one attempt, and most antibot vendors penalize rapid repeat submissions. Treat the failure as the signal that *this session* cannot progress past that challenge. Close the session and open a new one to try again.

## Method Reference

### `Antibot.captchaEnable`

 Enables automatic captcha detection AND solving. While enabled, the browser emits `captchaDetected` for each challenge it recognizes on the pages it loads, then solves it right away, one captcha at a time. No-op if already enabled. After 20 automatic solve attempts in a session, detection and solving stop and a `captchaError` says so: call `captchaEnable` again to turn them back on.

- **Parameters:** none
- **Returns:** empty object

### `Antibot.captchaDisable`

 Disables captcha detection. A solve under way is stopped. The session history of detected captchas (and their solve / error outcomes) is preserved. Retrieve it with `getSolvedCaptchas`. Events already in flight from `captchaEnable` may still arrive after the disable call.

- **Parameters:** none
- **Returns:** empty object

### `Antibot.solveCaptcha`

 Manually request a solve, either for a specific `detectionId` or, if omitted, for the most recent unsolved detection. Most integrations do not need this. `captchaEnable` already runs the solve automatically. Use `solveCaptcha` only when you need explicit control (e.g. waiting for user confirmation before a solve is billed). It needs `captchaEnable` first, and is refused for an unknown `detectionId`, one already solved or failed, and while another solve is in progress.

- **Parameters:**
    - `detectionId` *(string, optional)*: id from a prior `captchaDetected` event
    - `timeout` *(integer, optional, default 120)*: seconds the solve may take, from 20 to 600
- **Returns:** `{ detectionId, type, method, token? }`

### `Antibot.getSolvedCaptchas`

 Returns the full list of captchas seen this session, including failures and in-flight records. Kept after `captchaDisable`, so you can still read it before the session ends.

```
{
    "records": [
        {
            "detectionId": "550e8400-e29b-41d4-a716-446655440000",
            "type": "turnstile_checkbox",
            "frameUrl": "https://example.com/",
            "status": "solved",
            "detectedAt": 1714000000000,
            "resolvedAt": 1714000002400,
            "method": "checkbox"
        },
        {
            "detectionId": "6a9f1d2b-8c1f-4ed4-9f11-2f0e5b7a0c3e",
            "type": "recaptcha",
            "frameUrl": "https://example.com/checkout",
            "status": "failed",
            "detectedAt": 1714000010500,
            "resolvedAt": 1714000130500,
            "errorMessage": "<short reason, for your logs>"
        }
    ]
}
```

 See the [full `CaptchaRecord` schema](https://scrapfly.io/docs/cloud-browser-api/cdp-reference/Antibot#type-CaptchaRecord) for every field.

## Error Handling &amp; Retry Policy

 `captchaError` is the only failure signal you receive. Its `errorMessage` is a short human-readable reason, meant for your logs and your operators. Do not parse it: the wording changes from one browser release to the next. Decide what to do from the situation instead:

| Outcome | What to do |
|---|---|
| The challenge left the page before it was solved (the page navigated, the widget was removed) | Retry: reload the page or restart the step of your flow that showed the challenge. |
| The challenge could not be solved in time, or not at the moment | Retry in a new session. If it keeps failing across new sessions, contact support. |
| The page is a block page (`datadome`) or a challenge type that is not supported | Not supported: nothing can solve it in this session. Retry in a new session, on another proxy pool or country if you can. |
| The session reached 20 automatic solve attempts | Call `Antibot.captchaEnable` again to turn solving back on, or open a new session. |

> **Do not loop on failure.** Repeatedly calling `solveCaptcha` on a failed detection, or re-submitting the form to re-trigger the challenge, increases your block score with most antibot vendors and *does not* increase your success rate. The correct recovery is a new session.

## Billing

 Each captcha solved is billed its price, set by its type and your plan, added on top of the usual session-time and bandwidth charges: below in dollars at your plan's price of a credit, then in the API credits your plan's quota is charged. Session time and bandwidth continue to accrue while a solve is in progress, so a solve extends the session-time line on your invoice by the time it takes to complete.

 **A captcha whose solve has started is billed however it ends.** A captcha is billed when it reaches `captchaSolved`, and when its solve has started, a `captchaSolvingStarted` with the method `token` or `coords`, whatever ends it next: `captchaSolved` whatever its method, a `captchaError`, the session closing first, a session that fails. A `captchaError` costs nothing when no solve with the method `token` or `coords` had started: on a captcha the browser handles with a click, a slide or a hold (the methods `checkbox`, `slider`, `hold`).

A session that fails is billed nothing of its time or bandwidth, and still pays the captchas whose solve started.

### Price per captcha type

| Type | Price per captcha | `CaptchaType` |
|---|---|---|
| Cloudflare Turnstile (checkbox) | **$0.000375 to $0.00075 ($0.375 to $0.75 / 1K)** 5 API credits on every plan | `turnstile_checkbox` |
| Cloudflare Turnstile (invisible) | **$0.0015 to $0.003 ($1.50 to $3.00 / 1K)** 20 API credits on every plan | `turnstile` |
| DataDome slider | **$0.000375 to $0.00075 ($0.375 to $0.75 / 1K)** 5 API credits on every plan | `datadome_slider` |
| Google reCAPTCHA v2/v3 | **$0.0038 to $0.0039 ($3.80 to $3.90 / 1K)** 26 to 51 API credits, [by plan](#captcha-prices-by-plan) | `recaptcha` |
| Puzzle Click | **$0.0025 to $0.003 ($2.50 to $3.00 / 1K)** 20 to 34 API credits, [by plan](#captcha-prices-by-plan) | `puzzle_click` |
| GeeTest | **$0.001575 to $0.003 ($1.575 to $3.00 / 1K)** 20 to 21 API credits, [by plan](#captcha-prices-by-plan) | `geetest` |
| PerimeterX hold challenge | **$0.000375 to $0.00075 ($0.375 to $0.75 / 1K)** 5 API credits on every plan | `perimeterx_hold` |
| Rotation slider | **$0.000375 to $0.00075 ($0.375 to $0.75 / 1K)** 5 API credits on every plan | `cs_captcha_rotation` |
| AWS WAF captcha | **$0.001575 to $0.00165 ($1.575 to $1.65 / 1K)** 11 to 21 API credits, [by plan](#captcha-prices-by-plan) | `aws_waf` |
| Arkose Labs (FunCaptcha) | **$0.000375 to $0.00075 ($0.375 to $0.75 / 1K) when Arkose lets the browser through, $0.002 to $0.003 ($2.00 to $3.00 / 1K) for a challenge** 5 API credits when Arkose lets the browser through, 20 to 27 API credits for a challenge, [by plan](#captcha-prices-by-plan) | `funcaptcha` |
| Any other supported type | **$0.0038 to $0.0039 ($3.80 to $3.90 / 1K)** 26 to 51 API credits, [by plan](#captcha-prices-by-plan) | *(default)* |

### Prices by plan

A reCAPTCHA, Puzzle Click, GeeTest, AWS WAF or Arkose challenge costs more API credits on a plan whose credits cost less, and so does a type the table above does not name. The other types cost the same on every plan. Each price is in dollars at your plan's price of a credit, with the price of a thousand, then in the API credits your plan's quota is charged.

| Plan | `recaptcha` | `puzzle_click` | `geetest` | `aws_waf` | `funcaptcha` challenge | Any other type |
|---|---|---|---|---|---|---|
| Free paid from the plan's free credits | 26 credits | 20 credits | 20 credits | 11 credits | 20 credits | 26 credits |
| Discovery | **$0.0039 ($3.90 / 1K)** 26 credits | **$0.003 ($3.00 / 1K)** 20 credits | **$0.003 ($3.00 / 1K)** 20 credits | **$0.00165 ($1.65 / 1K)** 11 credits | **$0.003 ($3.00 / 1K)** 20 credits | **$0.0039 ($3.90 / 1K)** 26 credits |
| Pro | **$0.0038 ($3.80 / 1K)** 38 credits | **$0.0025 ($2.50 / 1K)** 25 credits | **$0.002 ($2.00 / 1K)** 20 credits | **$0.0016 ($1.60 / 1K)** 16 credits | **$0.002 ($2.00 / 1K)** 20 credits | **$0.0038 ($3.80 / 1K)** 38 credits |
| Startup | **$0.0038 ($3.80 / 1K)** 38 credits | **$0.0025 ($2.50 / 1K)** 25 credits | **$0.002 ($2.00 / 1K)** 20 credits | **$0.0016 ($1.60 / 1K)** 16 credits | **$0.002 ($2.00 / 1K)** 20 credits | **$0.0038 ($3.80 / 1K)** 38 credits |
| Enterprise | **$0.003818 ($3.818 / 1K)** 42 credits | **$0.002545 ($2.545 / 1K)** 28 credits | **$0.001818 ($1.818 / 1K)** 20 credits | **$0.001636 ($1.636 / 1K)** 18 credits | **$0.002 ($2.00 / 1K)** 22 credits | **$0.003818 ($3.818 / 1K)** 42 credits |
| Custom in dollars at your contract's price of a credit | 42 credits | 28 credits | 20 credits | 18 credits | 22 credits | 42 credits |
| Hacker | **$0.003825 ($3.825 / 1K)** 51 credits | **$0.00255 ($2.55 / 1K)** 34 credits | **$0.001575 ($1.575 / 1K)** 21 credits | **$0.001575 ($1.575 / 1K)** 21 credits | **$0.002025 ($2.025 / 1K)** 27 credits | **$0.003825 ($3.825 / 1K)** 51 credits |

The Hobbyist plan pays the Discovery prices and the Enthusiast plan the Pro prices, in API credits: in dollars at its own price of a credit. The dollars above are those of the monthly plans.

See [Cloud Browser Billing](https://scrapfly.io/docs/cloud-browser-api/billing) for session-time and bandwidth pricing.

## When to use Unblock API vs Captcha Solver

 Both tools deal with anti-bot challenges but at different points in the session lifecycle. They are not alternatives. In most real-world flows you will use **both** on the same session.

### Use [Unblock API](https://scrapfly.io/docs/cloud-browser-api/unblock) when:

- The site shows a **full-page anti-bot wall** before rendering anything useful (Cloudflare interstitial, "Checking your browser...", JavaScript challenges).
- You need a browser that is **already past** the initial bot check when your code connects. You want to start clicking and filling forms immediately, not wait for a challenge to resolve.
- The bypass is a one-time front-door problem. Once you are in, you only interact with regular pages.
- You are on a heavily protected site, where opening the session on the residential proxy pool gives the best results.

### Use the Captcha Solver when:

- A captcha widget **appears mid-session** in response to a specific action: submitting a form, adding an item to cart, logging in, hitting a rate-limited endpoint.
- The front door was clear (or already handled by Unblock) but a protected action triggers a step-up challenge.
- You run long-lived browser sessions where captchas can appear at any point and you do not want to orchestrate them manually.
- You want structured events (`captchaDetected` / `captchaSolved`) so your code can react to the outcome, for example, to pause UI, retry a form submit, or open a new session on failure.

### Use both together when:

- The site has *both* a front-door anti-bot wall *and* step-up captchas deeper in the flow (typical for e-commerce checkout, ticketing, streaming platforms).
- Open the session with Unblock API to land on a usable page, then call `Antibot.captchaEnable` once so any captcha that appears later is handled without extra wiring.

 **Rule of thumb:** If the challenge is *blocking page render*, use Unblock. If the challenge appears *after* the page has rendered, use the Captcha Solver. Not sure which one you will hit? Use both. Neither costs anything extra when nothing fires.

### Full comparison

Three Scrapfly features interact with anti-bot challenges. They are complementary, not alternatives:

| Feature | Runs on | Handles | Best for |
|---|---|---|---|
| [Unblocker](https://scrapfly.io/docs/scrape-api/unblocker) (the `unblocker` scrape parameter, formerly ASP) | Every scrape request | Anti-bot checks that run before the page renders, background JS challenges included (Cloudflare IUAM, Akamai) | Solving challenges *before* the page renders, on single-request scrapes |
| [Unblock API](https://scrapfly.io/docs/cloud-browser-api/unblock) | Cloud Browser open | Opens the page past the anti-bot wall and hands you the browser on it | Post-bypass interaction (clicks, forms) on heavily protected sites |
| **Captcha Solver** (this page) | Any live Cloud Browser session | Interactive captcha widgets that appear *during* the session (Turnstile, reCAPTCHA, GeeTest, PerimeterX, and more) | Long-running sessions where a captcha can appear mid-flow (checkout, login, rate-limited navigation) |

 **Combine freely:** Open a session with `Unblock API` to clear the initial wall, then call `Antibot.captchaEnable` so any captcha that appears later (e.g. at checkout) is handled transparently. The Unblocker parameter, the Unblock API and the Captcha Solver are three separate products and they compose. They don't compete.

## Related Documentation

- [Antibot CDP Reference](https://scrapfly.io/docs/cloud-browser-api/cdp-reference/Antibot): full method and event schemas
- [Unblock API](https://scrapfly.io/docs/cloud-browser-api/unblock): automatic bypass at session-open time
- [Native Browser MCP](https://scrapfly.io/docs/cloud-browser-api/mcp): captcha solver is auto-enabled for MCP sessions
- [Human-in-the-Loop](https://scrapfly.io/docs/cloud-browser-api/human-in-the-loop): take manual control when automated solving isn't an option
- [Billing](https://scrapfly.io/docs/cloud-browser-api/billing): understand session costs
