Skip to content

Cloudflare Turnstile

A Cloudflare Turnstile task returns a token (token) that you submit to the target site to pass the check. TurnstileTaskProxyless costs 25 points (¥0.025) per task and is asynchronous: createTask, then getTaskResult every 5 seconds. Failed and timed-out tasks are refunded automatically.

POSThttps://api.yescaptcha.com/createTaskGlobal endpoint
POSThttps://cn.yescaptcha.com/createTaskChina endpoint

The request body is JSON authenticated with your clientKey. Query results on the same endpoint you created the task on.

A Cloudflare verification widget (“Verify you are human”) is embedded in a form on the page, and the page loads a script from challenges.cloudflare.com/turnstile.

If the whole page is replaced by Cloudflare’s “Just a moment…” / “Checking your browser” screen, that is the challenge page, not Turnstile; use Cloudflare challenge page. See Identify the captcha type.

Task typePriceModeNotes
TurnstileTaskProxyless25 points (¥0.025)Asynchronous
TurnstileTaskProxylessM130 points (¥0.03)Asynchronous
TurnstileTask25 points (¥0.025)AsynchronousOwn proxy
  • TurnstileTaskProxyless and TurnstileTaskProxylessM1 take the same parameters on different routes; use either as a fallback for the other.
  • TurnstileTask loads the captcha through your own proxy and needs the proxy fields.
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
websiteKeystringYesThe Turnstile site key (sitekey), usually starting with 0x
proxyTypestringRequired for TurnstileTaskProxy protocol: http, https, socks4 or socks5
proxyAddressstringRequired for TurnstileTaskProxy IP address or hostname. Local or private addresses such as 127.0.0.1 or 192.168.x.x will not work because our servers cannot reach them
proxyPortintegerRequired for TurnstileTaskProxy port
proxyLoginstringNoProxy username, if the proxy requires authentication (TurnstileTask only)
proxyPasswordstringNoProxy password, if the proxy requires authentication (TurnstileTask only)
userAgentstringNoBrowser User-Agent. If the result contains a userAgent, use that value when you submit the token (TurnstileTask only)

websiteKey usually starts with 0x. How to find it: Find Turnstile parameters.

POST https://api.yescaptcha.com/createTask
{
"clientKey": "YOUR_CLIENT_KEY",
"task": {
"type": "TurnstileTaskProxyless",
"websiteURL": "https://example.com/login",
"websiteKey": "0x4AAAAAAA_SITE_KEY"
}
}
终端窗口
curl -s https://api.yescaptcha.com/createTask \
-H 'Content-Type: application/json' \
-d '{
"clientKey": "YOUR_CLIENT_KEY",
"task": {
"type": "TurnstileTaskProxyless",
"websiteURL": "https://example.com/login",
"websiteKey": "0x4AAAAAAA_SITE_KEY"
}
}'
# Returns {"errorId":0,"taskId":"..."}; then poll every 5 seconds:
curl -s https://api.yescaptcha.com/getTaskResult \
-H 'Content-Type: application/json' \
-d '{"clientKey": "YOUR_CLIENT_KEY", "taskId": "TASK_ID"}'

Replace websiteURL and websiteKey with the target site’s values.

{
"errorId": 0,
"status": "ready",
"solution": {
"token": "0.ufq5RgSVZd11DPSX1brdrxnEs28KcVlKj2ORchqxSy2q9yAW6ciq3hriXDF4x...",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36"
}
}
FieldTypeDescription
tokenstringThe token to submit to the target site. Single use; submit it as soon as possible
userAgentstringThe User-Agent used to obtain the token. Use this value when you submit the token, even if it differs from the one you sent

Put the token in the page’s cf-turnstile-response field (or the field the site’s API expects) and submit, using the returned userAgent as the User-Agent.

While in progress you get {"errorId": 0, "status": "processing"}; check again 5 seconds later. Handle errors by errorCode as described in Error codes.

Single use. Submit it as soon as possible; Turnstile tokens usually expire within a few minutes (Cloudflare decides).

Check that websiteURL is the page with the widget and websiteKey is correct, and submit with the returned userAgent. If the site also checks the IP, use TurnstileTask and submit through the same proxy.