Glossary
Cloudflare Turnstile
Turnstile is the CAPTCHA alternative Cloudflare offers to any website, including sites that do not route traffic through Cloudflare.
What Turnstile does
Turnstile is a widget that runs a set of small browser checks, decides whether the visitor looks human, and writes a token into the form. Cloudflare positions it as a replacement for image puzzles: most visitors see a spinner and a green tick, and some see nothing. Any site can use it for free, whether or not its DNS is on Cloudflare, so you will find it on many forms that have no other link to the company.
Turnstile is a separate product from the full-page managed challenge. The widget sits inside a page you can already load; the challenge page stands in front of the whole site. They also need different tasks.
The three widget modes
- Managed. Cloudflare decides per visitor whether a click on a checkbox is needed. This is the default.
- Non-interactive. The widget is visible and shows progress, but never asks for a click.
- Invisible. Nothing is shown; the checks run in the background and the token appears when they finish.
The mode is set by the site owner in the Cloudflare dashboard and does not change how you solve the widget. The same task covers all three.
How to recognise it
Look for a script loaded from challenges.cloudflare.com/turnstile/v0/api.js and a div with the class cf-turnstile. Its data-sitekey attribute holds a key that starts with 0x4, which is the quickest way to tell it apart from a reCAPTCHA key. Some sites render it from code with turnstile.render(), in which case the key is in the JavaScript call instead of the HTML.
Optional attributes to note are data-action and data-cdata. When the site sets them, the server can check them, so a solve should carry the same values.
The cf-turnstile-response token
After a pass, Turnstile writes its token into a hidden input named cf-turnstile-response. The site's backend sends that token to Cloudflare's siteverify endpoint with its secret. A token is valid for about five minutes and can be redeemed only once, so request it close to the moment you submit. Pages built as single page apps often read the token in a callback and send it in a JSON request rather than a form post.
Solving Turnstile through GateSolver
Create an AntiTurnstileTaskProxyLess task with the page URL and the site key, and add a metadata object with action and cdata if the widget defines them. The result holds solution.token and the user agent it was produced with.
const signupTask = { type: "AntiTurnstileTaskProxyLess", websiteKey: "0x4AAAAAAA...",
websiteURL: "https://example.com/signup", metadata: { action: "signup" } };
// send it as {clientKey: "YOUR_API_KEY", task: signupTask} to /createTask
Cloudflare Turnstile costs $0.84 per 1,000 solved tasks and usually returns under 3 seconds. Put the token into the cf-turnstile-response field, or into the field the site's request actually uses, then submit.
Common mistakes
The most frequent one is treating a full Cloudflare interstitial as Turnstile. If the whole page is replaced by "Verifying you are human" and you get a 403 or 503 status, you need the challenge task that returns a cf_clearance cookie. The second is ignoring data-action, which leads to tokens the site rejects even though they are fresh.
A third trap is timing. Scripts that solve a batch of widgets up front and then submit forms one by one will find the later tokens expired. Solve one token per submission, start the task right before the form is ready, and let the polling loop hand it straight to the request.
Common questions
Is Turnstile only on sites behind Cloudflare?
No. Any website can embed the widget for free, even if its traffic does not pass through Cloudflare.
What does a Turnstile site key look like?
It starts with 0x4 followed by a string of letters and digits, for example 0x4AAAAAAA plus more characters.
How long can I wait before using a Turnstile token?
Cloudflare accepts it for about five minutes and only once, so submit soon after the task returns.
Do I need a proxy for Turnstile tasks?
No. The Turnstile task is proxyless; only the full Cloudflare challenge task requires your own proxy.
Why is my fresh Turnstile token rejected?
Check that action and cdata match the widget, that the token went into the field the site reads, and that it was not used twice.
Keep reading
- Managed challengeCloudflare's full-page check that picks between a silent test and an interactive one, ending in a cf_clearance cookie.
- Find Turnstile site key, action and cDataWhere Turnstile keeps its site key, action and cData: widget attributes, turnstile.render options and explicit rendering setups.
- Solve Cloudflare Turnstile in PythonAn asyncio and aiohttp client for Turnstile tasks, with action and cData passed through and the token posted as cf-turnstile-response.
- Cloudflare Turnstile solver$0.84 per 1,000 tasks, answers under 3 seconds.