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 see | Task |
|---|---|
| "Just a moment..." instead of the page | CloudflareChallengeCookie (this task) |
The page loads, and cf_clearance is set silently in the background | CloudflareJsdCookie |
| A queue page saying you are in line | CloudflareWaitingRoom |
| A Turnstile widget in a form on a page that loads normally | TurnstileTokenProxyLess |
| The same widget, and the site ties the token to your IP | TurnstileToken |
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
websiteURLis the URL that returns the challenge. Cloudflare applies challenges per route, so use the page you request, not the site root.userAgentis the User-Agent of the client you replay the cookie from. Providers can accept only some browsers: check the provider's documentation.targetMethodis the HTTP method used to fetchwebsiteURL:GET(the default) orPOST.htmlPageBase64is 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.websiteKeyis the0x...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 thechallenges.cloudflare.comrequest, or inwindow._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
| Provider | Price per 1,000 | Routing |
|---|---|---|
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
| Field | Type | Required | Description |
|---|---|---|---|
clientKey* | string | Yes | Your API key. Create one in a workspace of 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, 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:
| Field | Type | Required | Description |
|---|---|---|---|
type* | Yes | ||
websiteURL* | URL | Yes | Full URL of the page where the CAPTCHA is displayed. Example: |
proxy* | string | object | Yes | Proxy the provider solves through, as a string or an object. See Proxy configuration. View proxy configurationExample: |
websiteKey | string | No | Challenge sitekey: the 0x… Turnstile widget id from the path segment after Example: |
htmlPageBase64 | string | No | 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: |
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. Defaults to GET. Example: |
{
"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
Response Schema
| Field | Type | Required | Description |
|---|---|---|---|
status* | Yes | Task status: "processing", "ready", or "failed". Example: | |
errorId* | Yes |
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 | Session cookies earned by the solve, including cf_clearance. Replay them with the same proxy and the returned User-Agent. 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. Example: |