cf-clearance-scraper usually stops working for one of three reasons. Its single Chromium never starts (no Chrome, no Xvfb, or an amd64 image on ARM). The request body or the replay is wrong (schema errors, an exact-URL mismatch, cookies sent without the browser's User-Agent, IP and TLS fingerprint). Or Cloudflare changed and the project, whose README says it "will no longer receive updates", did not follow. Fix the first two with the steps below; for the third, move the challenge step to a maintained solver.
Below: how zfcsoftware's project (now github.com/ZFC-Digital/cf-clearance-scraper) works, the errors from its issues, and fixes.
Quick answer: match your cf-clearance-scraper response to the fix
Most failures come back as one of these JSON responses or symptoms. Find yours, then read the matching section below.
- {"code":500,"message":"The scanner is not ready yet. Please try again a little later."}
- The shared Chromium is not running yet, or keeps failing to launch. Retry after startup. If it persists, read the logs (missing Chrome or Xvfb) and do not set SKIP_LAUNCH=true.
- {"code":400,"message":"Bad Request","schema":[...]}
- The JSON body failed the schema check. Send mode and url, siteKey in camelCase, and a proxy object with an integer port. Any other key is rejected.
- {"code":500,"message":"Timeout Error"}
- Nothing finished within timeOut (default 60,000 ms). For waf-session and source, pass the final URL after redirects, then check the proxy and IP.
- {"code":429,"message":"Too Many Requests"}
- browserLimit contexts (default 20) are already open. Queue requests on your side; raise browserLimit only if you have the RAM.
- {"code":401,"message":"Unauthorized"}
- The server runs with authToken set. Send the same value as authToken in the JSON body, not as a header.
- No Chrome installations found.
- The launcher found no Chrome (issue #30). Install Chrome or Chromium and set CHROME_PATH, or use the Docker image, which ships Chromium.
- Could not start Xvfb.
- On Linux the browser runs headed in an Xvfb virtual display. Install xvfb. On Google Cloud Run this is an open issue (#62); a VM or plain Docker host is simpler.
- waf-session returns 200 but no cf_clearance, or the cookies get 403
- The visit was never challenged, or the replay does not match the browser. No cf_clearance is normal if the page loaded. Replay with the returned headers, the same IP and Chrome-like TLS (issues #19, #53).
JSON responses are quoted from src/index.js and the endpoint files; the other messages from the linked GitHub issues. All checked on 2026-12-01.
What cf-clearance-scraper is and how it works
cf-clearance-scraper is a Node.js Express server with about 740 GitHub stars and an MIT LICENSE.md. The old github.com/zfcsoftware URL redirects to the ZFC-Digital organisation. At startup it launches one Chromium through puppeteer-real-browser (headless: false, turnstile: true), inside an Xvfb virtual display on Linux. Each request gets a fresh browser context, closed when the job ends, and everything goes through POST /cf-clearance-scraper with a mode and a url:
- source: returns the page HTML as { source, code: 200 } once the document answers 200 or 302.
- waf-session: same navigation, but returns { cookies, headers, code: 200 }, the browser's cookies and request headers (including user-agent) to reuse in an HTTP client.
- turnstile-min: serves a minimal page that renders Turnstile with your siteKey (required) and returns { token }.
- turnstile-max: loads the real page and polls window.turnstile.getResponse() until a token exists.
- Settings are environment variables: browserLimit (default 20), timeOut (default 60000 ms), optional authToken, and PORT (default 3000).
Maintenance status: frozen since early 2025
The README opens with: "This repo will no longer receive updates. Thank you to everyone who supported it." The same notice tops the README of puppeteer-real-browser, its browser library. The repository is not archived, but the last code fixes landed on 2025-02-01; later commits up to 2025-09-03 only touched the sponsor section. On Docker Hub, latest is 2.1.3, pushed 2025-02-01 for linux/amd64. The only GitHub release is 2.0.3, "Repo Rewritten", from 2024-09-29.
Issue #54 (December 2024) reported renewals suddenly failing after a Cloudflare change and got a fix; issue #59 (February 2025), about bot checks no longer passing, is still open.
Why it breaks: the root causes
- The browser never starts: no Chrome, Xvfb failing in a restricted container (#62), or SKIP_LAUNCH=true, which skips the launch entirely (#63).
- Strict validation. Only mode, url, siteKey, proxy and authToken are allowed, and proxy.port must be an integer. FlareSolverr-style cmd or maxTimeout, a proxy URL string, or lower-case sitekey all return 400.
- Exact-URL matching. waf-session and source resolve only when a response URL equals your url (or url plus a trailing slash). A redirect to https, www or a locale path means "Timeout Error".
- IP reputation. Issues #42, #44 and #61 work without a proxy and fail with one. The maintainer pointed to the target blocking proxy IPs and, in #38, advised one static IP per concurrent request.
- Replay mismatch. Issue #19 got 403 with valid cookies until the TLS fingerprint matched too, which is why the README pairs waf-session with CycleTLS and a JA3 string.
Fix 1: get the server running (Docker, Xvfb, Chrome)
The README recommends Docker; the image bundles Chromium and Xvfb and runs under pm2. Pull the newest image. The latest tag is built for amd64 only, so on Apple Silicon or other ARM hosts run it emulated or build the Dockerfile yourself. Give the browser a few seconds after start-up: earlier requests get the "not ready" 500.
From source, install Chrome or Chromium and xvfb, and start from the repository root, because turnstile-min reads ./src/data/fakePage.html by relative path. puppeteer-real-browser launches Chrome through chrome-launcher, which honours CHROME_PATH.
# Newest published image: latest = 2.1.3, pushed 2025-02-01, linux/amd64 only
docker pull zfcsoftware/cf-clearance-scraper:latest
docker run -d --name cf-clearance-scraper --restart unless-stopped \
-p 3000:3000 \
-e PORT=3000 \
-e browserLimit=5 \
-e timeOut=90000 \
-e authToken=change-me \
--shm-size=1g \
zfcsoftware/cf-clearance-scraper:latest
# Apple Silicon / ARM hosts: add --platform linux/amd64 (emulated, slow)
# or build your own image from the repo's Dockerfile.
# The HTTP server starts before Chromium is ready: follow the logs first
docker logs -f cf-clearance-scraper
# --- From source on Debian (a headed browser on Linux needs Xvfb) ---
sudo apt-get install -y xvfb chromium
git clone https://github.com/ZFC-Digital/cf-clearance-scraper
cd cf-clearance-scraper # start from the repo root: turnstile-min reads ./src/data/fakePage.html
npm install
CHROME_PATH=/usr/bin/chromium npm run start # chrome-launcher reads CHROME_PATHFix 2: send a body the validator accepts
A 400 includes a schema array naming the exact validation error, so log it instead of retrying. The client below sends valid bodies for all four modes and retries only the "not ready" 500 and the 429. timeOut is also the server's HTTP timeout, so keep your client timeout higher to receive the JSON error. Both Turnstile modes also wait at most 60 seconds for the token (fixed in the source), so raising timeOut does not give Turnstile more time.
// Node 18+ (built-in fetch). One endpoint for every mode; only the body changes.
const SCRAPER = 'http://localhost:3000/cf-clearance-scraper'
async function callScraper(body, attempts = 5) {
for (let i = 1; i <= attempts; i++) {
const res = await fetch(SCRAPER, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(body),
signal: AbortSignal.timeout(120_000), // longer than the server's timeOut
})
const data = await res.json()
// 500 "scanner is not ready yet" and 429 "Too Many Requests": wait and retry
if (res.status === 429 || /not ready/.test(data.message || '')) {
await new Promise((r) => setTimeout(r, 3000 * i))
continue
}
if (res.status === 400) throw new Error('bad body: ' + JSON.stringify(data.schema))
return data
}
throw new Error('cf-clearance-scraper busy or not ready')
}
// Only these keys are accepted: mode, url, siteKey, proxy, authToken
const proxy = { host: 'proxy.example.com', port: 8080, username: 'user', password: 'pass' }
const page = await callScraper({ mode: 'source', url: 'https://example.com/' })
const session = await callScraper({ mode: 'waf-session', url: 'https://example.com/', proxy })
const full = await callScraper({ mode: 'turnstile-max', url: 'https://example.com/login' })
const min = await callScraper({
mode: 'turnstile-min',
url: 'https://example.com/login',
siteKey: '0x4AAAAAAA...', // camelCase, required for turnstile-min
// authToken: process.env.CCS_TOKEN, // goes in the BODY, not in a header
})
console.log(page.code, session.cookies?.length, full.token, min.token)Fix 3: waf-session gives no cf_clearance, or the cookies get 403
First check whether the visit was challenged at all. In issue #53, waf-session returned 200 with only __cf_bm and _cfuvid, which is what an unchallenged page looks like.
Then replay exactly as the browser did: all returned headers, the same proxy exit IP, and a Chrome-like TLS client. Issue #51 shows accept-language can come back null, so drop null headers. See our guide to the cf_clearance cookie for what the cookie is bound to, and the curl_cffi 403 guide for TLS impersonation.
# pip install requests curl_cffi
import requests
from curl_cffi import requests as cffi
SCRAPER = "http://localhost:3000/cf-clearance-scraper"
TARGET = "https://example.com/" # the FINAL URL, after any redirect
PROXY = {"host": "proxy.example.com", "port": 8080, "username": "user", "password": "pass"}
PROXY_URL = "http://user:pass@proxy.example.com:8080" # same exit IP for the replay
session = requests.post(SCRAPER, json={
"mode": "waf-session",
"url": TARGET,
"proxy": PROXY, # an object with an integer port, not a URL string
}, timeout=120).json() # longer than the server's timeOut (default 60000 ms)
if session.get("code") != 200:
raise SystemExit(session)
print("cookies:", [c["name"] for c in session["cookies"]])
# No cf_clearance here usually means this visit was never challenged.
# Reuse the browser's own headers (user-agent, client hints...); drop nulls such
# as accept-language when the server could not detect it.
headers = {k: v for k, v in session["headers"].items() if v}
headers["cookie"] = "; ".join(c["name"] + "=" + c["value"] for c in session["cookies"])
r = cffi.get(
TARGET,
headers=headers,
impersonate="chrome", # Chrome-like TLS, as the README recommends CycleTLS for Node
proxies={"http": PROXY_URL, "https": PROXY_URL},
timeout=30,
)
print(r.status_code)Fix 4: turnstile-min vs turnstile-max tokens
turnstile-min never loads the real page; it renders Turnstile with only your siteKey and sets no action or cData. If the real widget uses them and the site checks them, the token can be refused. Use turnstile-max there: it reads window.turnstile.getResponse() on the real page, so it fails after 60 seconds if the widget appears late or behind a click.
Submit each single-use token as cf-turnstile-response at once. Open issue #58 is a reminder that waf-session returns cookies, not a token. If tokens are still rejected, see cf-turnstile-response invalid and the Turnstile error codes.
Fix 5: proxies, concurrency and timeouts
- Proxy format: { host, port, username, password } with a numeric port. The server always builds http://host:port and authenticates per page, so use an HTTP proxy, not SOCKS.
- Use sticky, reputable IPs, and replay through the same exit IP that solved. Working without the proxy but not with it (#42, #61) points at the IP.
- Each request holds a context until it ends. Size browserLimit to your RAM and queue on the client instead of bursting from one IP (#38).
When to switch to an API
cf-clearance-scraper is fine for learning and small jobs on sites you control. It becomes the wrong layer when pages still loop after these fixes, or when you keep servers, Xvfb and proxies running, and patch an unmaintained browser stack, just to get one cookie or token per site. For self-hosted options, see our comparison of open-source Turnstile and Cloudflare solvers and Turnstile solvers from GitHub that stopped working.
Only automate sites you own or are explicitly authorised to access, and respect their terms and rate limits.
NSLSolver example: the same two outputs, no browser
The Cloudflare Challenge solver API replaces waf-session: send type challenge with the url, the challenge site_key (0x... widget id) and your proxy, and get cookies (including cf_clearance) plus the user_agent to replay through that proxy. Omit user_agent, because the clearance is issued for the solver's iPhone Safari browser. About 3.3 s on average, $1.00 per 1,000.
The Cloudflare Turnstile solver API replaces both Turnstile modes: send site_key and url (action and cdata only if the widget sets them) and submit the token as cf-turnstile-response. About 250 ms, $0.80 per 1,000. No browser runs on either side, failed solves (503) are not billed, and sign-ups with Google, Gmail or Proton get free trial credit, no card (pricing). NSLSolver does not solve reCAPTCHA v2, hCaptcha, image CAPTCHAs or DataDome.
// Node 18+. Replaces waf-session and turnstile-min with one HTTP call each.
const API = 'https://api.nslsolver.com/solve'
const HEADERS = { 'Content-Type': 'application/json', 'X-API-Key': process.env.NSLSOLVER_API_KEY }
const PROXY = 'http://user:pass@sticky-proxy.example.com:8080' // same IP for solve AND replay
// 1) Full-page "Just a moment..." challenge -> cf_clearance + user_agent
const challenge = await fetch(API, {
method: 'POST',
headers: HEADERS,
body: JSON.stringify({
type: 'challenge',
url: 'https://example.com/',
site_key: '0x4AAAAAAA...', // the challenge widget id (0x...) from the challenge page
proxy: PROXY,
// user_agent omitted: the clearance is issued for the solver's iPhone Safari
}),
signal: AbortSignal.timeout(120_000),
}).then((r) => r.json())
const cookie = Object.entries(challenge.cookies).map(([k, v]) => k + '=' + v).join('; ')
// Replay with challenge.user_agent and this cookie header through the SAME proxy.
// 2) Turnstile widget on a form -> token for cf-turnstile-response
const turnstile = await fetch(API, {
method: 'POST',
headers: HEADERS,
body: JSON.stringify({
type: 'turnstile',
site_key: '0x4AAAAAAA...',
url: 'https://example.com/login',
// action / cdata: only if the widget sets them
}),
}).then((r) => r.json())
console.log(challenge.user_agent, cookie.length, turnstile.token)See also
- Cloudflare Challenge solver API: cf_clearance and the matching user_agent from one call.
- Cloudflare Turnstile solver API: cf-turnstile-response tokens in about 250 ms on average.
- Pay-per-success pricing: failed solves are free, free credit with Google, Gmail or Proton sign-up.
- Puppeteer stealth not working: the same browser-fingerprint problems in plain Puppeteer.
- FlareSolverr not working: the other self-hosted cookie server, and its fixes.
Sources (checked 2026-12-01)
- cf-clearance-scraper README (modes, Docker, env vars, "no longer receive updates")
- src/index.js (endpoint, 400/401/429/500 responses, browserLimit, timeOut)
- src/module/reqValidate.js (accepted body keys, proxy schema)
- src/endpoints/wafSession.js (exact-URL match, cookies and headers)
- src/endpoints/solveTurnstile.min.js and src/data/fakePage.html
- Dockerfile (Chromium, Xvfb, pm2)
- Commit history (last code fixes 2025-02-01, last push 2025-09-03)
- Releases (2.0.3 "Repo Rewritten", 2024-09-29)
- Docker Hub tags (latest = 2.1.3, 2025-02-01, amd64)
- Issue #52: "The scanner is not ready yet"
- Issue #53: not returning cf_clearance
- Issue #19: 403 while using cf_clearance cookies (TLS fingerprint)
- Issue #62: unable to start Xvfb on Google Cloud Run
- Issue #59: unable to bypass bot check (open)
- puppeteer-real-browser README (same maintenance notice, xvfb requirement)
- chrome-launcher README (CHROME_PATH)