Skip to content

Cloudflare Challenge

Pass the Cloudflare 'Just a moment' page with the cloudflare_challenge type and get a cf_clearance cookie plus user agent. Proxy required.

Use the cloudflare_challenge type when a site shows Cloudflare’s full-page check (“Just a moment…”) before it lets you in. You send the page and your proxy. You get the cf_clearance cookie and the user agent that earned it.

Overview

When Cloudflare isn’t sure about a visitor, it answers with a challenge page instead of the site. A browser passes the check and gets a cf_clearance cookie. Requests that carry the cookie get the real site.

type cloudflare_challenge
Needs a site key No
Needs a proxy Yes
You get solution.cookies.cf_clearance, solution.cookie_header, solution.user_agent, solution.token

Which type do I need?

  • The whole page is replaced by “Just a moment…” or “Verifying you are human”: cloudflare_challenge (this page).
  • A small Cloudflare box sits inside a form on a normal page: turnstile.
  • The page says “Sorry, you have been blocked” or “Attention Required!”: that is a firewall block, not a challenge. No type can get past it.

Before you start

  1. Create an API key in the dashboard under API keys (it starts with drx_) and add funds.

  2. Check that the page really is a challenge. Request it and look at the answer:

    curl -s -o /dev/null -D - https://shop.example/products | grep -i -E "^HTTP|cf-mitigated"

    A challenge answers 403 with cf-mitigated: challenge. If you get 200, there is nothing to solve.

  3. Get a proxy that can keep the same IP for several minutes (often called a sticky session). The cookie only works from the IP that earned it.

Request fields

Field Required What to put
type Yes cloudflare_challenge
website_url Yes The full address of the protected page, starting with https://.
proxy Yes Your proxy: user:pass@host:port, or with a scheme such as http://, https://, socks5://. A proxy without a scheme is used as http://.

There is no site key for this type. Fields like website_key, rqdata and cdata are not used.

About the proxy

The check runs through your proxy, and Cloudflare ties the cookie to that IP. That means:

  • Use a proxy session that keeps one IP for at least a few minutes. A solve usually takes 25 to 40 seconds, and you need the same IP afterwards too.
  • If your provider sets the session length in the username (for example ...-session-abc-time-10), choose several minutes. In testing, a 1-minute session changed IP during the solve and the cookie was refused with a 403. A 10-minute session worked.
  • Use the exact same proxy string for the solve and for your requests later.

Create the task

curl

curl -s -X POST https://draxon.one/api/captcha/v1/tasks \
  -H "Authorization: Bearer $DRAXON_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "cloudflare_challenge",
    "website_url": "https://shop.example/products",
    "proxy": "user-session-abc123-time-10:[email protected]:8080"
  }'

Python

import os
import requests

API = "https://draxon.one/api/captcha/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['DRAXON_KEY']}"}
PROXY = "user-session-abc123-time-10:[email protected]:8080"
PAGE = "https://shop.example/products"

task = requests.post(f"{API}/tasks", headers=HEADERS, timeout=30, json={
    "type": "cloudflare_challenge",
    "website_url": PAGE,
    "proxy": PROXY,
}).json()

while task["status"] in ("queued", "processing"):
    task = requests.get(f"{API}/tasks/{task['id']}", params={"wait": 60},
                        headers=HEADERS, timeout=90).json()

if task["status"] != "solved":
    raise SystemExit(f"not solved: {task['error']}")

solution = task["solution"]
proxies = {"http": f"http://{PROXY}", "https": f"http://{PROXY}"}
page = requests.get(PAGE, proxies=proxies, timeout=30, headers={
    "User-Agent": solution["user_agent"],
    "Cookie": solution["cookie_header"],
})
print(page.status_code)

Node.js

const API = "https://draxon.one/api/captcha/v1";
const headers = {
  Authorization: `Bearer ${process.env.DRAXON_KEY}`,
  "Content-Type": "application/json",
};

let task = await (await fetch(`${API}/tasks`, {
  method: "POST",
  headers,
  body: JSON.stringify({
    type: "cloudflare_challenge",
    website_url: "https://shop.example/products",
    proxy: "user-session-abc123-time-10:[email protected]:8080",
  }),
})).json();

while (task.status === "queued" || task.status === "processing") {
  task = await (await fetch(`${API}/tasks/${task.id}?wait=60`, { headers })).json();
}

if (task.status === "solved") {
  const { cookie_header, user_agent } = task.solution;
  // Send cookie_header and user_agent on your requests, through the same proxy.
}

Get the result

Ask for the task with ?wait=60 (any number from 0 to 120). The request stays open until the task finishes or the wait runs out.

curl -s -H "Authorization: Bearer $DRAXON_KEY" \
  "https://draxon.one/api/captcha/v1/tasks/<id>?wait=60"

A solved task looks like this (cost fields left out):

{
  "id": "0d4f6c1e-9a52-4b7e-8f19-3c2d1b0a9e87",
  "type": "cloudflare_challenge",
  "status": "solved",
  "website_host": "shop.example",
  "attempts": 1,
  "created_at": "2026-10-30T22:05:41Z",
  "completed_at": "2026-10-30T22:06:12Z",
  "solution": {
    "token": "Cq1BevBXrsMqyd22VGYT6qwW...",
    "cookies": {"cf_clearance": "Cq1BevBXrsMqyd22VGYT6qwW..."},
    "cookie_header": "cf_clearance=Cq1BevBXrsMqyd22VGYT6qwW...",
    "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.6.2 Mobile/15E148 Safari/604.1"
  },
  "error": null
}

Use the answer

Every request you send to the site must have all three of these:

  1. The same proxy you put in the task.
  2. The cookie: the Cookie: cf_clearance=... header from solution.cookie_header, or solution.cookies added to your HTTP client’s cookie jar for the site’s domain.
  3. The same user agent: solution.user_agent as your User-Agent header.

Keep using the same cookie for later requests to the site. You don’t need a new solve for every page. When the site starts answering with the challenge again, the cookie has run out. Create a new task then.

Compatible API names

Change your tool’s address to https://draxon.one/api/captcha/compat and use your DraxonCloud key as the client key.

Service style Name for this type
CapSolver / Anti-Captcha createTask AntiCloudflareTask, CloudflareChallengeTask

Send the proxy as task.proxy (scheme://user:pass@host:port) or split into proxyType, proxyAddress, proxyPort, proxyLogin and proxyPassword.

curl -s -X POST https://draxon.one/api/captcha/compat/createTask \
  -H "Content-Type: application/json" \
  -d '{
    "clientKey": "'"$DRAXON_KEY"'",
    "task": {
      "type": "AntiCloudflareTask",
      "websiteURL": "https://shop.example/products",
      "proxy": "http://user-session-abc123-time-10:[email protected]:8080"
    }
  }'

When getTaskResult says ready, the solution has token, cookies ({"cf_clearance": "..."}), cookie ("cf_clearance=...") and userAgent. Details on Compatible APIs.

Errors and fixes

When you create a task:

Error What it means What to do
422 validation_error on proxy No proxy was sent. Add your proxy. This type can’t run without one.
422 validation_error on website_url The address is not a full http(s):// address, or is too long. Send the full page address.
422 target_blocked This website is not served. Pick a site you are allowed to automate.
402 insufficient_balance Not enough money to hold the price. Add funds.
402 spend_cap_reached The key hit its daily limit. Raise the key’s limit or wait for the next day (UTC).

When a task ends without a cookie:

error.code What it means What to do
solve_failed The check could not be passed, or the page was not a challenge (for example a block page, or the proxy could not reach the site). Load the page through your proxy and check for cf-mitigated: challenge. Try another IP.
provider_timeout It took too long. Check that the proxy is fast and reachable, then try again.
expired Not finished within about 3 minutes. Try again.

The task was solved, but the site still shows the challenge. Almost always, the IP or the user agent changed. Make sure your proxy session kept the same IP, and send solution.user_agent exactly.

None of the failed tasks cost anything. More codes are on the errors page.

Price and billing

Each solved challenge costs the price shown on the pricing page and in GET /api/captcha/v1/families. Creating a task holds that amount. A solved task turns the hold into a charge. A failed or expired task releases it, and you pay nothing. A task is never charged twice.