Skip to Content
AnySolver logo
AnySolver
Cookie

CloudflareChallengeCookie

Get past a Cloudflare "Just a moment..." challenge page through your proxy and receive the cf_clearance cookie to replay on the protected site.

CloudflareChallengeCookie passes Cloudflare's "Just a moment..." challenge and returns the cookies, including cf_clearance. When Cloudflare answers a request with that page, with HTTP status 403, the client has to pass a challenge before the origin answers, and requests that carry the cookie reach the site. You send a URL and a proxy, and the solve reads the challenge from the live page.

Use it when the page you request is replaced by the challenge. For other Cloudflare mechanisms, pick the task from this table.

Which Cloudflare task do I need?

What you seeTask
"Just a moment..." instead of the pageCloudflareChallengeCookie (this task)
The page loads, and cf_clearance is set silently in the backgroundCloudflareJsdCookie
A queue page saying you are in lineCloudflareWaitingRoom
A Turnstile widget in a form on a page that loads normallyTurnstileTokenProxyLess
The same widget, and the site ties the token to your IPTurnstileToken

Managed and interactive challenges

The same page can hold a managed challenge, which completes on its own, or an interactive one that waits for a click on a Turnstile checkbox. window._cf_chl_opt.cType on the page tells them apart (managed, interactive or non-interactive). You do not send it.

Proxy

task.proxy is required on this task type, and the provider solves from that address. cf_clearance is tied to that IP and to the User-Agent, so replay the cookie through the same proxy with the userAgent from the response, and keep one IP for the whole solve: see Keep the same IP for the whole solve. Use a static or sticky proxy.

A different address or User-Agent is challenged again

A rotating endpoint can change the address between the solve and your request. Use a static or sticky proxy.

Parameters

  • websiteURL is the URL that returns the challenge. Cloudflare applies challenges per route, so use the page you request, not the site root.
  • userAgent is the User-Agent of the client you replay the cookie from. Providers can accept only some browsers: check the provider's documentation.
  • targetMethod is the HTTP method used to fetch websiteURL: GET (the default) or POST.
  • htmlPageBase64 is the challenge page you already hold, base64-encoded. It is optional for most providers and required by some. It must be the challenge page (it contains _cf_chl_opt), not the site's real content.
  • websiteKey is the 0x... Turnstile key of the challenge. It is optional for most providers; Nslsolver needs it. Find it in the Network tab as the path segment after /rch/.../ in the challenges.cloudflare.com request, or in window._cf_chl_opt.

To capture the page in a browser:

const html = new XMLSerializer().serializeToString(document);
const htmlPageBase64 = new TextEncoder().encode(html).toBase64();

Use the cookies

Attach the whole cookie jar from solution.cookies, not only cf_clearance, with the userAgent from the solution and the proxy you submitted:

import requests

# solution is the "solution" object from getTaskResult
solution = {"cookies": {"cf_clearance": "..."}, "userAgent": "Mozilla/5.0 ..."}
proxy_url = "http://user:pass@proxy.example.com:8080"  # the proxy you submitted

response = requests.get(
    "https://example.com/",
    cookies=solution["cookies"],
    headers={"User-Agent": solution["userAgent"]},
    proxies={"http": proxy_url, "https": proxy_url},
)
print(response.status_code)

cf_clearance has a lifetime the site owner configures in Cloudflare. When the site challenges you again, solve again.

Check Provider stats for live success rates and solve times before you pick a provider.

Supported Providers

ProviderPrice per 1,000Routing
CapSolver
$1.20
CapMonster
$1.30
RiskBypass
$1.00
Nslsolver
$1.00
EZCaptcha
$1.20
AnyFlare
$0.20
Solverify
$0.20
PeakFO
$1.00
Iso
$1.00
VoidCaptcha
$1.20

Request Schema

FieldTypeRequiredDescription
clientKey*
stringYes

Your API key. Create one in a workspace of the AnySolver dashboard.

Example: your-api-key-from-dashboard

task*
objectYes

The task body. Required fields depend on the task type. See Tasks for per-task schemas.

View task properties
settings
objectNo

Per-request settings for routing, Auto Retry, Auto Fallback, proxy reuse, response statistics and detailed analytics. Each field overrides the API key's value. See Routing modes.

View settings reference

Task Object Properties

The task field accepts an object with the following properties:

FieldTypeRequiredDescription
type*
Yes
websiteURL*
URLYes

Full URL of the page where the CAPTCHA is displayed.

Example: https://example.com/

proxy*
string | objectYes

Proxy the provider solves through, as a string or an object. See Proxy configuration.

View proxy configuration

Example: http://user:pass@1.2.3.4:8080

websiteKey
stringNo

Challenge sitekey: the 0x… Turnstile widget id from the path segment after /rch/…/ of the challenges.cloudflare.com request, or _cf_chl_opt on the interstitial. Required by some providers (Nslsolver).

Example: 0x4AAAAAAA…

htmlPageBase64
stringNo

Base64-encoded HTML of the "Just a moment..." challenge page (usually a 403 response), fetched through the same proxy. Optional for most providers; some require it.

Example: PCFET0NUWVBFIGh0bWw+…

userAgent
stringNo

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: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36

targetMethod
No

HTTP method to use when fetching the protected URL. Defaults to GET.

Example: GET

{
    "clientKey": "YOUR_API_KEY",
    "task": {
        "type": "CloudflareChallengeCookie",
        "websiteURL": "https://example.com/",
        "proxy": "http://user:pass@1.2.3.4:8080"
    }
}

Optional fields are not guaranteed across providers

Required fields are guaranteed across every provider that supports this task. Optional fields may be honored by some providers and silently ignored by others. AnySolver does not document per-provider parameter support, so before relying on an optional field, check that provider's own docs for the task you are using.

Response Schema

FieldTypeRequiredDescription
status*
Yes

Task status: "processing", "ready", or "failed".

Example: ready

errorId*
Yes

0 on success; 1 or 2 on an error. Branch on errorCode: Error IDs explains the two error groups.

Example: 0

taskId
stringNo

Unique identifier returned when the task was created.

Example: 01KFNDF328KAN2AJ3BNHCQYE88

errorCode
No

Machine-readable error code.

Example: CAPTCHA_UNSOLVABLE

errorDescription
stringNo

Human-readable error message with resolution hints.

Example: The captcha could not be solved.

cost
numberNo

Actual cost charged for this task in USD.

Example: 0.002

taskType
No

The type of CAPTCHA task to solve.

Example: ReCaptchaV2TokenProxyLess

provider
No

Provider that handled this task. While processing, the provider currently solving it.

Example: Multibot

solution
objectNo

Solution Object Properties

The solution field contains an object with the following properties:

FieldTypeRequiredDescription
cookies*
Record<string, unknown>Yes

Session cookies earned by the solve, including cf_clearance. Replay them with the same proxy and the returned User-Agent.

Example: {"cf_clearance":"Bcg6jNLzTVaa3IsFhtDI.e4_LX8p7q7zFYHF7wiHPo...uya1bbdfwBEi3tNNQpc"}

raw*
Record<string, unknown>Yes

Raw provider response data for advanced use cases.

token
stringNo

The solved CAPTCHA token to submit with your form.

Example: 0.zrSnRHO7h0HwSjSCU8oyzbjEtD8p.d62306d4ee00c77dda697f959ebbd7bd97

userAgent
stringNo

User-Agent string used during solving.

Example: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36