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 stringProxyUse it for
AntiCloudflareTaskRequiredThe full page interstitial, managed or JavaScript challenge.

Task object

FieldTypeRequiredWhat it is
typeStringYesAntiCloudflareTask.
websiteURLStringYesThe address that returned the interstitial.
proxyStringYesA static or sticky address, in either shape. See using proxies.
userAgentStringNoThe user agent you will present afterwards. Chrome only. If you leave it out we pick one and return it.
htmlStringNoThe 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 fieldWhat to do with it
cookiesMerge into your session cookie jar. cf_clearance is the one that matters.
tokenThe same clearance value on its own, for clients that set cookies by hand.
userAgentSend 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