Docs / Guides

How to Solve Cloudflare Challenges in Python

Get past Cloudflare's Managed Challenge and JS challenges in Python: fetch a valid cf_clearance cookie, matching User-Agent, and a proxy, then load the page with requests or httpx.

If your Python scraper gets an HTTP 403or a “Checking your browser” interstitial, the site is behind a Cloudflare challenge (Managed Challenge, a JS challenge, or Turnstile). requests and httpxcan’t pass it on their own because Cloudflare wants a real browser to run JavaScript and set a cf_clearance cookie.

The fix: solve once, then send the clearance

RaptorWayz runs a real browser on a real IP, solves the challenge, and hands you the three things Cloudflare checks: the cf_clearance cookie, the exact User-Agent, and a proxy on the same exit IP. Because the cookie is bound to that IP + User-Agent + TLS fingerprint, you send all three together and the page loads for your own client.

solve
curl -X POST https://raptorwayz.com/v1/solve \
  -H "Authorization: Bearer $API_KEY" \
  -d '{"domain":"example.com"}'
# → { "cf_clearance": "...", "user_agent": "Mozilla/5.0 ...",
#     "proxy": "http://$API_KEY:x@raptorwayz.com:8080", "expires_at": 1750000000 }

Full Python example

python
import requests

# 1. Ask RaptorWayz to solve the challenge.
r = requests.post(
    "https://raptorwayz.com/v1/solve",
    headers={"Authorization": f"Bearer {API_KEY}"},
    json={"domain": "example.com"},
).json()

# 2. Use the cookie + User-Agent + proxy TOGETHER on your own request.
resp = requests.get(
    "https://example.com/",
    headers={"User-Agent": r["user_agent"]},
    cookies={"cf_clearance": r["cf_clearance"]},
    proxies={"https": r["proxy"]},
)
print(resp.status_code)  # 200

Why not just use undetected-chromedriver?

You can drive a headful browser yourself, but you then own the browser fleet, the residential IPs, and the constant cat-and-mouse when Cloudflare updates. RaptorWayzkeeps a warm solver so a cache hit returns in milliseconds, and failed solves don’t cost you a quota token. See the API docs for the full contract, or read what a cf_clearance cookie is.

Try it on your target domain

3 free solves on signup, no card required.

Get a free key