> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.airtop.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.airtop.ai/_mcp/server.

# Solving Captchas

## Overview

From time to time, you may encounter captchas during web automation, but Airtop has you covered. Airtop can solve Captchas in 2 ways:

1. Using a built-in Captcha solver
   * Very simple to use, but less flexible
2. Using a Chrome extension
   * Provides a lot more flexibility, but requires a bit more setup

### Built-in Captcha Solver

The built-in Captcha solver is simple to use. When you create a new session, simply pass the `solveCaptcha` flag in the session configuration.

```typescript
const session = await client.sessions.create({
    configuration: {
        solveCaptcha: true,
    }
});
```

You can also experiment with the captcha solver in the studio by enabling the option in the session configuration.

![Captcha Solver Option](/_fern-files/_img/8f9a3cf5f22cb0d50cd6538378d5a4b5c0428155093ed5a1cd5ead25ee0aa298.webp)

With this option enabled, every time a Captcha is detected, Airtop will automatically solve it using the built-in solver.

#### Captcha Events

You can subscribe to the `onCaptchaEvent` event to get notified when a Captcha is detected and solved.

```typescript
const unsubscribe = await client.sessions.onCaptchaEvent(sessionId, (event) => {
    console.log(`captcha event: ${JSON.stringify(event)}`);
});
```

Each event contains the following information:

* `duration`: Time taken to solve the Captcha (in milliseconds).
* `eventTime`: Date and Time of the event
* `id`: Captcha job ID
* `retryCount`: Retry count
* `status`: Captcha solving status (processing, completed, failed)
* `type`: Captcha type (recaptcha, hcaptcha, etc.)
* `url`: URL of the page containing the captcha challenge.
* `windowId`: Window ID

You can also unsubscribe from the event by calling the `unsubscribe` function.

```typescript
unsubscribe();
```

### Chrome Extension

If you want more flexibility, instead of using the built-in Captcha solver, you can use a Chrome extension to solve Captchas. There are several commercial Captcha solving extensions available. We recommend using the following:

* [NopeCHA](https://nopecha.com/)
* [CapSolver](https://www.capsolver.com)
* [2Captcha](https://2captcha.com/)

All these products offer a Chrome extension that can be used to solve Captchas and can be configured to be used with [Airtop's Chrome extension](/guides/how-to/using-chrome-extensions) integration.

#### NopeCHA Demo

We built a demo of using NopeCHA to solve a Captcha, which can be found [here](https://github.com/airtop-ai/captcha-extension-demo). To use it, follow these steps:

1. Clone the repository
2. Create an account on [NopeCHA](https://nopecha.com/) and get an API key
3. Install the dependencies
   ```bash
   npm install
   ```
4. Create a `.env` file and add your Airtop API key
5. Run the demo
   ```bash
   npm run dev
   ```
6. Select the option to configure the Chrome extension
7. Open the Live View and open the extension menu to configure the NopeCHA extension with the API key
8. Finish the Chrome extension setup in the command line
9. Select the option to Solve the Captcha
10. Click on the Live View URL to see the Captcha being solved and the form submitted.