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
websiteURLis 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.userAgentis optional: the User-Agent of the client you replay the cookie from.htmlPageBase64is 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
| Provider | Price per 1,000 | Routing |
|---|---|---|
AnyFlare | $0.10 |
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 | 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: |
proxy* | string | object | Yes | Proxy the provider solves through, as a string or an object. See Proxy configuration. View proxy configurationExample: |
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: |
htmlPageBase64 | string | No | 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: |
{
"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
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 sensor, including cf_clearance. Replay them with the same proxy and the returned User-Agent. Example: |
userAgent* | string | Yes | User-Agent string used during solving. Example: |
raw* | Record<string, unknown> | Yes | Raw provider response data for advanced use cases. |