npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

playwright-recaptcha-solver

v1.0.1

Published

Solve reCAPTCHA v2 audio challenge using Playwright

Readme

playwright-recaptcha-solver

Solves reCAPTCHA v2 audio challenges automatically using Playwright. No paid services required — uses wit.ai for speech-to-text.

How it works

  1. Clicks the reCAPTCHA checkbox
  2. If a challenge appears, switches to the audio challenge
  3. Downloads the audio file and sends it to wit.ai for transcription
  4. Types the transcript and submits
  5. Retries automatically if Google requests more solutions
  6. Returns the g-recaptcha-response token

Installation

npm install playwright-recaptcha-solver
npx playwright install chromium

Usage

Pass a URL

The library manages the browser lifecycle for you.

import { solve } from 'playwright-recaptcha-solver';

const token = await solve('https://www.google.com/recaptcha/api2/demo');
console.log(token);

Pass a Playwright Page

Use this when you already have a browser open and need to submit the form or do other actions after solving.

import { chromium } from 'playwright';
import { solve } from 'playwright-recaptcha-solver';

const browser = await chromium.launch({ headless: false });
const page = await browser.newPage();

await page.goto('https://www.google.com/recaptcha/api2/demo');

const token = await solve(page);

// token is already set in g-recaptcha-response — submit the form
await page.click('#recaptcha-demo-submit');
await page.waitForSelector('.recaptcha-success');

await browser.close();

API

solve(input: string | Page, options?: SolveOptions): Promise<string>

Returns the g-recaptcha-response token.

SolveOptions

| Option | Type | Default | Description | | ------------- | ---------- | ----------- | ---------------------------------------------------------------------------------- | | headless | boolean | true | Run browser in headless mode. Only used when input is a URL. | | proxy | string | undefined | Proxy server URL, e.g. socks5://127.0.0.1:9060. Only used when input is a URL. | | browserArgs | string[] | [] | Extra Chromium launch arguments. Only used when input is a URL. | | verbose | boolean | false | Enable logging. | | logger | Logger | console | Custom logger. Only used when verbose is true. |

Logger interface

interface Logger {
  log(message: string): void;
  error(message: string): void;
}

Compatible with console, winston, pino, or any custom logger.

Examples

With proxy

const token = await solve('https://example.com', {
  proxy: 'socks5://127.0.0.1:9060',
});

With verbose logging

const token = await solve('https://example.com', {
  verbose: true,
});

With custom logger (e.g. pino)

import pino from 'pino';

const logger = pino();

const token = await solve('https://example.com', {
  verbose: true,
  logger: {
    log: (msg) => logger.info(msg),
    error: (msg) => logger.error(msg),
  },
});

Multiple concurrent solves

import { chromium } from 'playwright';
import { solve } from 'playwright-recaptcha-solver';

const browser = await chromium.launch();

const tokens = await Promise.all(
  Array.from({ length: 5 }, async () => {
    const page = await browser.newPage();
    await page.goto('https://www.google.com/recaptcha/api2/demo');
    const token = await solve(page);
    await page.close();
    return token;
  })
);

await browser.close();

Building from source

git clone https://github.com/danielgatis/playwright-recaptcha-solver
cd playwright-recaptcha-solver
npm install
npx playwright install chromium
npm run build

Buy me a coffee

Liked some of my work? Buy me a coffee (or more likely a beer)

License

MIT