Cloudflare Turnstile solver for Puppeteer Node.js
Pair Puppeteer with Sonic to clear Cloudflare Turnstile without rendering the widget. Works inside the WAF managed-challenge fallback and the silent JS-only mode.
Runnable example
import puppeteer from 'puppeteer'
import { CaptchaSonic } from 'captchasonic'
const browser = await puppeteer.launch()
const page = await browser.newPage()
await page.goto('https://target.example.com/login')
const sonic = new CaptchaSonic('YOUR_API_KEY')
const { token } = await sonic.solve({
type: 'TurnstileTaskProxyless',
websiteURL: page.url(),
websiteKey: '0x4AAAAAAA...',
})
await page.evaluate(
(t) => { document.querySelector('[name=cf-turnstile-response]').value = t },
token,
)
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 Cloudflare detect Puppeteer immediately?
- Default Puppeteer sessions trigger Cloudflare's bot-shield within a couple of requests. Stealth plugins help with TLS / navigator markers; a Sonic token handles the captcha challenge itself.
- How fast is Turnstile via Sonic + Puppeteer?
- End-to-end solve is 4–7 seconds in production. The Puppeteer round-trip itself is dominated by page navigation; the captcha hop adds minimal extra latency.
- What if I don't know the sitekey?
- Inspect the page for cf-turnstile or [data-sitekey] elements. For pages that load Turnstile via JS, search the document for "0x4" — that's the Turnstile sitekey prefix.
Other Cloudflare Turnstile stacks
- hCaptcha · Puppeteer · Node.jsBypass hCaptcha in Puppeteer Node.js scripts with a Sonic-issued token. Drop-in replacement for the manual click flow.
- Cloudflare Turnstile · Playwright · PythonPass Cloudflare Turnstile from Playwright Python. Sonic returns the cf-turnstile-response token in under 7 seconds, ready to drop into the page.
- Cloudflare Turnstile · HTTP / requests · PythonPass Cloudflare Turnstile from a pure-requests Python script — no headless browser. Sonic returns the cf-turnstile-response token to POST directly.
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) | |||||
| Cloudflare Turnstile | |||||
| Success rate (trailing 30d) | 99.9% | ~95% | ~98% | ~95% | ~97% |
| Price per 1k — Turnstile | $0.50 | $1.99 | $0.80 | $1.50 | $0.80 |
| 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.
- Cloudflare Turnstile
Bypass Cloudflare Turnstile in under 7 seconds.
- 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.