reCAPTCHA v2 solver for Playwright Node.js
Inject a Sonic-issued reCAPTCHA v2 token from Playwright Node.js. Faster and more reliable than driving the widget — the page never sees mouse motion at all.
Runnable example
import { chromium } from 'playwright'
import { CaptchaSonic } from 'captchasonic'
const browser = await chromium.launch()
const page = await browser.newPage()
await page.goto('https://example.com/login')
const sonic = new CaptchaSonic('YOUR_API_KEY')
const { gRecaptchaResponse } = await sonic.solve({
type: 'RecaptchaV2TaskProxyless',
websiteURL: page.url(),
websiteKey: '6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-',
})
await page.evaluate(
(token) => { document.getElementById('g-recaptcha-response').value = token },
gRecaptchaResponse
)
await page.click('form button[type="submit"]')Replace YOUR_API_KEY with a real key from your dashboard. The token is good for one form submission.
FAQ
- Does Playwright trigger reCAPTCHA detection?
- Playwright is harder to fingerprint than Selenium by default — no navigator.webdriver, no automatic CDP markers. But Enterprise reCAPTCHA still scores the session; using a Sonic token avoids the scoring step entirely.
- Can I run this in headless mode?
- Yes. Token injection works the same in headless and headed Playwright sessions — the token lives in a DOM element, not in browser interaction history.
- How long is the token valid?
- reCAPTCHA v2 tokens are valid for around 120 seconds. Submit the form immediately after writing the token to maximize acceptance.
Other reCAPTCHA v2 stacks
- reCAPTCHA v2 · Selenium · PythonStep-by-step guide: solve Google reCAPTCHA v2 in a Selenium Python automation. Returns a valid gRecaptchaResponse token in under 3 seconds.
- GeeTest v4 · Playwright · Node.jsSolve GeeTest v4 slide, icon, space, and gobang puzzles from Playwright Node.js. One captchaId, one API call, verified token in 5–9 seconds.
How CaptchaSonic compares for this captcha
Feature-by-feature against the four most-mentioned alternatives. Independently benchmarked; numbers refresh quarterly.
| Feature | CaptchaSonic | 2Captcha | CapSolver | Anti-Captcha | CapMonster Cloud |
|---|---|---|---|---|---|
| AI / ML solver (no human relay) | |||||
| reCAPTCHA v2 / v3 / Enterprise | |||||
| Avg. solve time (reCAPTCHA v2) | < 3s | ~12s | ~8s | ~10s | ~7s |
| Success rate (trailing 30d) | 99.9% | ~95% | ~98% | ~95% | ~97% |
| Price per 1k — reCAPTCHA v2 | $0.80 | $2.99 | $0.90 | $2.00 | $1.00 |
| Proxy + proxyless modes | |||||
| Free trial credits | |||||
| SDK languages (Py, Node, Go, C#, Java, PHP) | 6 | 6 | 4 | 5 | 4 |
| Selenium / Puppeteer / Playwright examples | |||||
| Browser extension | |||||
| Webhook callbacks | |||||
| 99.9% uptime SLA |
Yes / No / Partial reflect publicly documented support. Pricing and solve-time figures snapshot the published rate at the time this page was last updated.
Related guides
- reCAPTCHA Solver
AI bypass for reCAPTCHA v2, v3 and Enterprise.
- hCaptcha Solver
Token solver for hCaptcha and hCaptcha Enterprise.
- API Docs
createTask, getTaskResult, getBalance — full reference.
- GeeTest v3 / v4
Slide, icon, space and gobang puzzles solved.
- MTCaptcha Solver
Token bypass for invisible and visible MTCaptcha.
- AWS WAF Captcha
AWS WAF token solver for the WAF-CAPTCHA challenge.