CloudflareChallengeCookie
Get past a Cloudflare "Just a moment…" interstitial and receive the cf_clearance cookie to replay on the protected origin.
When Cloudflare answers a request with "Just a moment…" and a 403, it wants the client to complete a challenge before the origin will answer. Clearing it sets a cf_clearance cookie, and requests carrying that cookie are served normally.
This task performs the challenge and hands back that cookie jar. You send a URL and a proxy; the challenge parameters are read from the live page, so there is nothing to extract by hand.
Managed, interactive, and which one you have
Cloudflare serves two kinds of interstitial through the same URL, and this task handles both:
- Managed clears itself after a moment of scripted checks. Nothing is displayed to click.
- Interactive shows a "Verify you are human" checkbox and waits. It asks in rounds, so more than one press is normal.
You can tell them apart on the interstitial with:
window._cf_chl_opt.cType; // "managed" | "interactive" | "non-interactive"You do not need to send this. It matters only when you are debugging why a solve is slow: interactive challenges take longer because Cloudflare deliberately pauses between rounds.
cf_clearance is bound to the exit IP and the user agent
Replay it through the same proxy you submitted, with the userAgent from the response. Change either and
Cloudflare re-challenges as though you had no cookie. Use a static or sticky exit; a rotating endpoint can hand your
replay a different address than the solve used.
Choosing the URL
Send the URL that is actually being challenged, not the site root. Cloudflare applies challenges per route, so a homepage may be open while the endpoint you want is gated. If a solve reports that no challenge was present, that is usually what happened.
htmlPageBase64
Optional. If you already hold the 403 interstitial, send it base64-encoded and the solve reads the challenge type from your copy instead of inferring it. It is a small optimisation, not a requirement, and it must be the challenge page rather than the site's real content:
const html = new XMLSerializer().serializeToString(document);
const htmlPageBase64 = btoa(unescape(encodeURIComponent(html)));A capture with no _cf_chl_opt in it is rejected up front, since that is the marker that makes a page a challenge page.
Using the cookie
Attach the whole returned jar, not just cf_clearance, because sites frequently pair it with __cf_bm:
requests.get(url, cookies=solution['cookies'],
headers={'User-Agent': solution['userAgent']}, proxies=proxies)The cookie is good for the whole origin, so one solve covers the pages you visit afterwards rather than one request.
Cookies expire, and can be revoked early
cf_clearance usually lasts from around thirty minutes to a few hours. Cloudflare can invalidate it sooner if your
request pattern changes sharply. When the origin starts challenging you again, solve once more.
Related tasks
- The page loads normally but sets
cf_clearancein the background:CloudflareJsdCookie. - The widget is embedded in a page you can already load:
TurnstileTokenProxyLess.
Supported Providers
| Provider | Price per 1,000 | Routing |
|---|---|---|
| $1.20 | ||
| $1.30 | ||
| $1.00 | ||
| $0.70 | ||
| $1.00 | ||
| $1.20 | ||
| $0.20 | ||
| $0.20 |
Request Schema
| Field | Type | Required | Description |
|---|---|---|---|
clientKey* | string | Yes | Your API key. Create one in the AnySolver dashboard. Example: |
task* | object | Yes | The task body. Required fields depend on the task type. See Tasks for per-task schemas. View task properties |
settings | object | No | Per-request settings for routing, auto retry, auto fallback, and proxy behavior. See Routing Strategies. View settings reference |
Task Object Properties
The task field accepts an object with the following properties:
| Field | Type | Required | Description |
|---|---|---|---|
type* | Yes | ||
websiteURL* | URL | Yes | Full URL of the page where the CAPTCHA is displayed. Example: |
proxy* | string | object | Yes | |
websiteKey | string | No | Optional Cloudflare site key, when the challenge exposes one. Example: |
htmlPageBase64 | string | No | Base64-encoded HTML of the challenge page, when solving from a captured page. Example: |
userAgent | string | No | Browser User-Agent string. Must match the browser used on the target page. Not all providers properly support this parameter. Verify the compatibility with the provider you are using. Example: |
targetMethod | No | HTTP method to use when fetching the protected URL. Example: |
Optional fields are not guaranteed across providers
Response Schema
| Field | Type | Required | Description |
|---|---|---|---|
status* | Yes | Task status: "processing", "ready", or "failed". Example: | |
errorId* | Yes | 0 = success, 1 = external error, 2 = internal error. Example: | |
taskId | string | No | Unique identifier returned when the task was created. Example: |
errorCode | No | Machine-readable error code. Example: | |
errorDescription | string | No | Human-readable error message with resolution hints. Example: |
cost | number | No | Actual cost charged for this task in USD. Example: |
taskType | No | The type of CAPTCHA task to solve. Example: | |
provider | No | Provider that handled this task. While processing, the provider currently solving it. Example: | |
solution | object | No |
Solution Object Properties
The solution field contains an object with the following properties:
| Field | Type | Required | Description |
|---|---|---|---|
cookies* | Record<string, unknown> | Yes | Cleared session cookies, including cf_clearance, to replay on the target. Example: |
raw* | Record<string, unknown> | Yes | Raw provider response data for advanced use cases. |
token | string | No | The solved CAPTCHA token to submit with your form. Example: |
userAgent | string | No | User-Agent string used during solving (if applicable). Example: |