API referenceTask typesCloudflare Challenge
Cloudflare Challenge
The interstitial page that says "Just a moment..." and returns 403 before it lets you through. What comes back is a cookie, not a form token, and it is tied to one address and one user agent.
Task types
| Type string | Proxy | Use it for |
|---|---|---|
AntiCloudflareTask | Required | The full page interstitial, managed or JavaScript challenge. |
Task object
| Field | Type | Required | What it is |
|---|---|---|---|
type | String | Yes | AntiCloudflareTask. |
websiteURL | String | Yes | The address that returned the interstitial. |
proxy | String | Yes | A static or sticky address, in either shape. See using proxies. |
userAgent | String | No | The user agent you will present afterwards. Chrome only. If you leave it out we pick one and return it. |
html | String | No | The body of the 403 you received. Passing it saves us a round trip and usually a few seconds. |
Example
POST/createTask
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "AntiCloudflareTask",
"websiteURL": "https://example.com/",
"proxy": "http:192.0.2.40:8080:user:pass",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"html": "<!DOCTYPE html><html lang=\"en-US\"><head><title>Just a moment...</title>..."
}
}JSON
{
"errorId": 0,
"taskId": "df944101-64ac-468d-bc9f-41baecc3b8ca",
"status": "ready",
"solution": {
"cookies": {
"cf_clearance": "Bcg6jNLzTVaa3IsFhtDI.e4_LX8p7q7zFYHF7wiHPo...bbdfwBEi3tNNQpc"
},
"token": "Bcg6jNLzTVaa3IsFhtDI.e4_LX8p7q7zFYHF7wiHPo...bbdfwBEi3tNNQpc",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36"
}
}| Solution field | What to do with it |
|---|---|
cookies | Merge into your session cookie jar. cf_clearance is the one that matters. |
token | The same clearance value on its own, for clients that set cookies by hand. |
userAgent | Send every later request with this exact string. A mismatch voids the cookie. |
Using the cookie
Three things have to match on every request after the solve, or the challenge comes back: the clearance cookie, the address, and the user agent. Change any one and the other two stop counting.
Python
import requests, jevcha
jevcha.api_key = "YOUR_API_KEY"
PROXY = "http://user:pass@192.0.2.40:8080"
UA = ("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 "
"(KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36")
s = requests.Session()
s.proxies = {"http": PROXY, "https": PROXY}
s.headers["User-Agent"] = UA
first = s.get("https://example.com/")
if first.status_code == 403:
solution = jevcha.solve({
"type": "AntiCloudflareTask",
"websiteURL": "https://example.com/",
"proxy": PROXY,
"userAgent": UA,
"html": first.text,
})
s.cookies.update(solution["cookies"])
print(s.get("https://example.com/").status_code)
Last updated 21 September 2026