Skip to content

Cloudflare challenge page

The Cloudflare challenge page replaces a whole site with “Just a moment…” / “Checking your browser” before letting you in. YesCaptcha opens the page through the proxy you provide, passes the check, and returns the cookies (such as cf_clearance) and the User-Agent it used. CloudFlareTaskS3 costs 20 points (¥0.02) per task and is asynchronous. Failed and timed-out tasks are refunded automatically.

POSThttps://api.yescaptcha.com/createTaskGlobal endpoint
POSThttps://cn.yescaptcha.com/createTaskChina endpoint
  • The page source contains __cf_chl_rt_tk or cdn-cgi/challenge-platform, and the title is Just a moment...: this is the challenge page.
  • If only a Cloudflare widget is embedded in a form, it is Turnstile instead.
  • If your HTTP library gets a 403 with “Just a moment…” but a browser opens the page directly, you are probably only being blocked by TLS fingerprinting. A library that imitates a browser’s TLS fingerprint (such as curl_cffi) usually fixes it without solving anything.
Task typePriceModeNotes
CloudFlareTaskS225 points (¥0.025)AsynchronousNot recommendedOwn proxy
CloudFlareTaskS320 points (¥0.02)AsynchronousNot recommendedOwn proxy
FieldTypeRequiredDescription
typestringYesTask type; see "Task types and pricing" on this page
websiteURLstringYesFull URL of the page that shows the captcha. Use the site you see the captcha on, not the captcha vendor's domain
proxystringYesProxy as one string, e.g. http://user:[email protected]:8080 or socks5://proxy.example.com:1080. SOCKS5 with a password is not supported; local or private addresses will not work
waitLoadbooleanNoWait until the page has fully loaded before returning. Set to true if you need the full page content; it takes longer
requiredCookiesarrayNoCookie names you want returned, default ["cf_clearance"]. You can list several, but they are not guaranteed
blockImagebooleanNoSkip loading images to save proxy traffic
postDataobjectNoIf set, the target URL is opened with a POST request carrying this object, e.g. {"name": "hi"}

Don’t send a custom User-Agent; use the user_agent the API returns for later requests.

POST https://api.yescaptcha.com/createTask
{
"clientKey": "YOUR_CLIENT_KEY",
"task": {
"type": "CloudFlareTaskS3",
"websiteURL": "https://example.com/",
"proxy": "http://user:[email protected]:8080",
"waitLoad": false,
"requiredCookies": [
"cf_clearance"
]
}
}

Then call getTaskResult every 5 seconds as for any asynchronous task; see getTaskResult.

{
"errorId": 0,
"status": "ready",
"solution": {
"cookies": { "cf_clearance": "zqKrlel6E6_SM2707VdArsu2c5.bYqLKU3DOl4tlkCE-1691687641-0-1-8d7f630c..." },
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
"request_headers": { "accept-language": "en-US,en;q=0.9", "user-agent": "Mozilla/5.0 ..." },
"headers": { "server": "cloudflare" },
"content": "<!DOCTYPE html>..."
}
}
FieldTypeDescription
cookiesobjectCookies obtained after passing the check, usually including cf_clearance. Use them together with the returned user_agent and the proxy you supplied
user_agentstringThe User-Agent used to pass the check; use it for all follow-up requests
request_headersobjectRequest headers sent when passing the check; reuse them in follow-up requests
headersobjectResponse headers from the target site
contentstringHTML source of the target page
  1. Make later requests with the returned cookies, the returned user_agent and the same proxy you used for the task. Cloudflare expects all three to match.
  2. Send the request_headers too where possible, and use a browser-like TLS fingerprint (for example curl_cffi’s impersonate option).
  3. cf_clearance stays valid for a while (up to an hour on some sites), so you don’t need to solve again within that time, but sending requests too fast may get the IP blocked by Cloudflare.