hCaptcha solver for Puppeteer Node.js
Solve hCaptcha from Puppeteer in two API calls — no headed mode, no click solver, no fingerprint nuisance. Works for both standard and Enterprise widgets.
Runnable example
import puppeteer from 'puppeteer'
import { CaptchaSonic } from 'captchasonic'
const browser = await puppeteer.launch()
const page = await browser.newPage()
await page.goto('https://accounts.hcaptcha.com/demo')
const sonic = new CaptchaSonic('YOUR_API_KEY')
const result = await sonic.solve({
type: 'HCaptchaTaskProxyless',
websiteURL: page.url(),
websiteKey: '10000000-ffff-ffff-ffff-000000000001',
})
await page.evaluate(
(token) => {
document.querySelector('[name="h-captcha-response"]').value = token
document.querySelector('[name="g-recaptcha-response"]').value = token
},
result.token,
)
await page.click('button[type="submit"]')Replace YOUR_API_KEY with a real key from your dashboard. The token is good for one form submission.
FAQ
- Why two hidden fields for hCaptcha?
- hCaptcha emits both h-captcha-response and g-recaptcha-response so sites that originally integrated reCAPTCHA can drop hCaptcha in with no backend change. Setting both ensures the form post validates regardless of which field the backend reads.
- Can the solver handle Enterprise hCaptcha?
- Yes — pass the rqdata field if the page provides one (it's embedded in the widget bootstrap JS as data-rqdata). Sonic returns a token that validates against the Enterprise verify endpoint.
- Does this work with puppeteer-extra-plugin-stealth?
- Yes. Stealth helps the surrounding page navigate without flagging the bot, and the Sonic token handles the captcha step. The two stack cleanly.
Other hCaptcha stacks
- Cloudflare Turnstile · Puppeteer · Node.jsBypass Cloudflare Turnstile with Puppeteer in Node.js. Sonic returns the cf-turnstile-response token in under 7 seconds.
- hCaptcha · Selenium · PythonBypass hCaptcha from a Selenium Python script. Drop the Sonic token into the form's hidden field; no clicking the widget.
- hCaptcha · Playwright · PythonSolve hCaptcha from Playwright Python with a Sonic-issued token. Drop-in for both standard and Enterprise widgets.
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) | |||||
| hCaptcha (incl. Enterprise) | |||||
| Success rate (trailing 30d) | 99.9% | ~95% | ~98% | ~95% | ~97% |
| Price per 1k — hCaptcha | $0.90 | $2.99 | $1.20 | $2.00 | $1.50 |
| 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
- hCaptcha Solver
Token solver for hCaptcha and hCaptcha Enterprise.
- reCAPTCHA Solver
AI bypass for reCAPTCHA v2, v3 and 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.