Skip to Content
AnySolver logo
AnySolver
Cookie

CloudflareJsdCookie

Run Cloudflare's JavaScript detections (JSD) sensor for a page through your proxy and get the cf_clearance cookie to replay on the protected site.

CloudflareJsdCookie runs Cloudflare's JavaScript detections (JSD) sensor for a page through your proxy and returns the cookies it earns, including cf_clearance. JSD is invisible: the page loads normally, and a Cloudflare script injected into it fingerprints the browser, then posts the result to a one-shot endpoint. The response sets cf_clearance, and later requests are judged on whether they carry it.

You send a URL and a proxy. The one-shot URL, ray and timestamp are read from a live load of the page, so there is nothing to extract by hand.

Does the site use JSD?

JSD leaves no visible trace. Open the site with DevTools on the Network tab and filter for challenge-platform. A JSD site makes two requests:

GET   /cdn-cgi/challenge-platform/h/g/scripts/jsd/<hash>/main.js
POST  /cdn-cgi/challenge-platform/h/g/jsd/oneshot/<hash>/<stamp>

The POST .../jsd/oneshot/... is the script submitting its result, and the response sets cf_clearance. You can also check the console before the script clears it:

window['__CF$cv$params']; // { r: '<ray>', t: '<timestamp>', ... }

A "Just a moment..." page or a checkbox is a challenge page: use CloudflareChallengeCookie. A visible Turnstile widget that needs a token: use TurnstileTokenProxyLess, or TurnstileToken when the site ties the token to your IP.

Proxy

task.proxy is required on this task type, and the provider solves from that address. The cookie is tied to the address that earned it, so replay it 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 a page that serves the script. JSD applies per route, so if a solve reports that the page served no JSD script, check the Network tab of the route you want.
  • userAgent is optional: the User-Agent of the client you replay the cookie from.
  • htmlPageBase64 is optional. If you already fetched the page, send it base64-encoded and the provider uses your copy instead of loading the page again. It must still contain __CF$cv$params, which the script reads. A page saved after the script ran no longer has it and is rejected.
import base64

import requests

proxy_url = "http://user:pass@proxy.example.com:8080"  # the proxy you submit with the task

html = requests.get("https://example.com/", proxies={"http": proxy_url, "https": proxy_url}).text
html_page_base64 = base64.b64encode(html.encode()).decode()

Why there is no one-shot URL parameter

The one-shot URL contains a per-load random component, a timestamp and a signature tied to the ray of the request that served the page. A copy captured by hand cannot be reused. The same holds for r and t in __CF$cv$params. The task reads them from its own load of the page.

Use the cookies

Attach the cookies from solution.cookies with the returned userAgent and the same proxy. 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
AnyFlare
$0.10

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

The page protected by the JSD sensor. This is the only parameter the challenge needs: the one-shot URL, ray and timestamp are all read from a live load of this page.

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

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

htmlPageBase64
stringNo

Optional. The protected page, base64-encoded, if you already fetched it. Served to the provider in place of fetching it again, which removes the largest transfer from the solve. It must still contain __CF$cv$params.

Example: PCFET0NUWVBFIGh0bWw+…

{
    "clientKey": "YOUR_API_KEY",
    "task": {
        "type": "CloudflareJsdCookie",
        "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 sensor, including cf_clearance. Replay them with the same proxy and the returned User-Agent.

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

userAgent*
stringYes

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

raw*
Record<string, unknown>Yes

Raw provider response data for advanced use cases.