Cloudflare Turnstile
widget- Where you see it
- A widget inside a page or form
- What it returns
- A token in
cf-turnstile-response - CapMonster page
- This page: Cloudflare Turnstile Solver
Last updated:
A Cloudflare Challenge and a Turnstile widget can look the same. A Challenge is not always a separate “Just a moment…” page: it can be styled, embedded into the site or made to look like a regular Turnstile widget, so you cannot tell them apart by appearance.
cf-turnstile-responsechallenge-form with __cf_chl_f_tk=cf_clearance cookieThe table lists price, time to solve and solving success rate for four Cloudflare Turnstile solving services.
| Parameter | CapMonster Cloud | 2Captcha | Anti-Captcha | DeathByCaptcha |
|---|---|---|---|---|
Price per 1000 solves (from) | $ 1.30 | $1.45 | $2.00 | $2.89 |
Time to solve | 6.24 s* | 16.9 s | 20.33 s | ~13 s |
Solving success rate | 99%* | 96% | 96% | 96% |
2Captcha, Anti-Captcha, and DeathByCaptcha are trademarks of their respective owners. CapMonster Cloud is not affiliated with these entities. Performance metrics and pricing comparisons are based on publicly available data and internal benchmarking as of 02.10.2026.
Test the stability on your own target sites right now. We do not guarantee a 100% success rate: CAPTCHA types and target-site configuration may change at any time.
$0.10
New users get $0.10 in test balance to try CapMonster Cloud.
1. Register at CapMonster Cloud.
2. Message support via live chat or support@capmonster.cloud with the email tied to your account.
Run sign-up, checkout and form flows in CI/CD with Playwright, Puppeteer or Selenium on pages you own or are allowed to test.
Check that protected forms and endpoints keep working after releases and widget changes.
Collect publicly available data from open pages that use Cloudflare Turnstile.
Support automated assistive workflows on sites that rely on invisible bot checks.
Let an agent request a token through MCP when a workflow reaches a captcha.
Use CapMonster Cloud for publicly available data and on sites you own or are authorized to test. Collecting third-party data behind a login or paywall without permission is prohibited.
Cloudflare Turnstile verifies visitors through client-side browser signals and risk assessment instead of image puzzles. It ships in three widget modes: Managed (recommended), Non-Interactive and Invisible. CapMonster Cloud handles all of them automatically — you never specify the mode in the task.
Sources: Cloudflare documentation — Widget types · Get started · Turnstile in Cloudflare challenges
Turnstile automatically chooses between a non-interactive check and a checkbox based on the visitor's risk level. No images or text to decipher.
A visible widget with a loading spinner. The check runs without any visitor interaction.
The check runs completely in the background: no widget and no loading indicator are shown.
The page loads the widget init code; Cloudflare returns the required JS, and the widget renders.
Based on the widget mode and Cloudflare's risk signals, the widget decides whether to show an interactive challenge.
The client-side callback receives a token — single-use, valid for 300 seconds. If the widget is inside a <form>, the token is also added automatically as the hidden field cf-turnstile-response.
The page sends the token to the backend with the form data.
Your server calls Cloudflare's Siteverify API to confirm the token.
Sources: Cloudflare documentation — Embed the widget · Validate the token
A Turnstile token is the string the widget generates after it verifies a visitor. The widget stores it in a hidden form field named cf-turnstile-response and also passes it to the widget's callback. The site's server then sends the token to Cloudflare's Siteverify API to confirm it.
Properties of the token, according to Cloudflare's documentation:
Valid for 300 seconds (5 minutes) after generation.
Single-use: validating it a second time returns the timeout-or-duplicate error.
Up to 2048 characters long.
Validated on the server through the Siteverify API.
CapMonster Cloud accepts captcha parameters, processes them on its servers, and returns a ready-to-use token. Insert this token into the form to pass the check without user interaction.
At this stage, you send your API key, captcha type, and its parameters. The service returns a unique taskId which you can use later to get the result.
Required parameters
| Parameter | Description |
|---|---|
| type | TurnstileTask |
| websiteURL | The URL of the page where the captcha is solved |
| websiteKey | Turnstile site key. Format: 0x4AAAAAAABUYP0XeMJF0xoy |
Optional parameters
| Parameter | Description |
|---|---|
| userAgent | Browser User-Agent. Recommended: pass the current value supported by CapMonster Cloud. You can get the latest value at https://capmonster.cloud/api/useragent/actual |
| pageAction | The action field found in the callback function when the captcha is loaded |
| data | The value of the data field, taken from the cData parameter |
| proxyType | http — regular HTTP/HTTPS proxy; https — try this if http does not work (required for some custom proxies); socks4 — SOCKS4 proxy; socks5 — SOCKS5 proxy |
| proxyAddress | IP address of the proxy (IPv4/IPv6). Transparent proxies and proxies on local machines are not allowed |
| proxyPort | Proxy port |
| proxyLogin | Proxy username |
| proxyPassword | Proxy password |
The same TurnstileTask type is used with and without a proxy.
Endpoint:
https://api.capmonster.cloud/createTaskRequest:
{
"clientKey": "API_KEY",
"task": {
"type": "TurnstileTask",
"websiteURL": "https://yourwebsite.com/page-with-turnstile",
"websiteKey": "your-website-key"
}
}Response:
{
"errorId": 0,
"taskId": 407533072
}After creating the task, poll the solution status.
Endpoint:
https://api.capmonster.cloud/getTaskResultRequest:
{
"clientKey": "API_KEY",
"taskId": 407533072
}Response:
{
"errorId": 0,
"status": "ready",
"solution": {
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/156.0.0.0 Safari/537.36",
"token": "0.iGX3xsyFCkbGePM3jP4P4khLo6TrLukt8ZzBvwuQOvbC...f61f3082"
}
}| Property | Type | Description |
|---|---|---|
| token | String | Use the token in an input field or when calling a callback function. |
Insert the returned token into the cf-turnstile-response field or pass it to the widget's callback, then submit the form within five minutes: Cloudflare tokens expire after 300 seconds and can be validated only once. Code examples for Playwright, Puppeteer and Selenium are in the FAQ below.
To create a Turnstile task you need two values from the page where the widget runs: the site key (websiteKey) and, if the page sets it, the action name (pageAction).
<div class="cf-turnstile" data-sitekey="SITE_KEY"← websiteKey
data-action="ACTION"></div>← pageActionturnstile.render('#container', {
sitekey: 'SITE_KEY',← websiteKey
action: 'ACTION',← pageAction
callback: function (token) { /* ... */ }
});Open the site with the captcha.
Right-click the captcha element and choose Inspect.
Find the site key. In the Elements tab it is the data-sitekey attribute (websiteKey). A Turnstile site key looks like 0x4AAAAAAABUYP0XeMJF0xoy.
Find the action: in the widget render call (the callback function that runs when the captcha loads) or in the data-action attribute. The sitekey can also be found in that callback function. If the page does not set an action, leave the parameter out.
To collect the values automatically, load the page in a headless browser such as Playwright and read them from the rendered widget. Ready examples in JavaScript, Python and C# are in the CapMonster Cloud documentation.
Some values change every time the page loads, so solve the task right after you collect them.
createTask and retrieve the result with getTaskResult using our client libraries.For low-code workflows, use the official CapMonster Cloud n8n node.
websiteURL and websiteKey from the same render of the page.getTaskResult returned the ready status and that you took solution.token before inserting it.Errors returned by Cloudflare Siteverify (timeout-or-duplicate, invalid-input-secret and others) concern site owners — see “Siteverify error codes” below.
If you run the website protected by Turnstile: verify tokens and test your setup
POST https://challenges.cloudflare.com/turnstile/v0/siteverify
secret=YOUR_SECRET_KEY
response=TOKENIf you run the site, your server validates every Turnstile token by sending a POST request to https://challenges.cloudflare.com/turnstile/v0/siteverify. The endpoint accepts application/x-www-form-urlencoded and JSON and always returns JSON. Required parameters: secret (your widget's secret key) and response (the token). Optional: remoteip and idempotency_key. Check success and, if you set them, also action and hostname in the response.
A token is valid for 300 seconds and can be validated only once. Read more in Cloudflare's validation guide.
Cloudflare provides dummy sitekeys and secret keys so you can test a Turnstile implementation without triggering real challenges. Test sitekeys work on any domain, including localhost, and generate the dummy token XXXX.DUMMY.TOKEN.XXXX. Dummy tokens are accepted only by dummy secret keys, and production secret keys reject them.
<div class="cf-turnstile"
data-sitekey="1x…AA">
</div>
cf-turnstile-response:
"XXXX.DUMMY.TOKEN.XXXX"Always passes
Always fails
Always passes
Always fails
Forces an interactive challenge
Always passes validation
Always fails validation
Returns the "token already spent" error (timeout-or-duplicate)
Cloudflare's full reference: Turnstile testing.
When validation fails, Cloudflare's Siteverify API returns an error-codes array. The table below lists each code and what it means.
{
"success": false,
"error-codes": [
"timeout-or-duplicate"
]
}The secret parameter was not provided
The secret key is invalid or expired
The response parameter (token) was not provided
The token is invalid, malformed or expired
The request is malformed
The token has already been validated or has expired
An internal error occurred; retry the request
Siteverify can return success: true and your server should still reject the token if hostname or action do not match what you expect.
Short answers about solving Cloudflare Turnstile with CapMonster Cloud: modes, proxies, tokens, testing and Siteverify errors.
Cloudflare Turnstile is a CAPTCHA alternative from Cloudflare that verifies visitors through browser signals and risk assessment instead of image puzzles. It has three widget modes. Managed (recommended): Cloudflare chooses between a non-interactive check and a checkbox based on visitor risk. Non-interactive: a visible widget with a loading spinner that never requires interaction. Invisible: no widget at all. CapMonster Cloud handles all three automatically, so you do not specify the mode in the task.
No. TurnstileTask works without a proxy, and the proxy fields (proxyType, proxyAddress, proxyPort, proxyLogin, proxyPassword) are optional. A proxy that matches the geography of the target site can improve results on geo-sensitive pages, so it is worth testing both configurations. Transparent proxies and proxies on local machines are not allowed. Without your own proxy, CapMonster Cloud solves the task through its built-in proxies (IP address 65.21.190.34).
Open DevTools, find the element with the data-sitekey attribute (and data-action, if the page sets an action) and copy the values; a Turnstile site key looks like 0x4AAAAAAABUYP0XeMJF0xoy. Some values change every time the page loads, so extract them right before creating the task. Step-by-step instructions are in the section above.
cf-turnstile-response is the hidden form field that holds the Turnstile token. The token is valid for 300 seconds (5 minutes) and can be validated only once; after that Siteverify returns the timeout-or-duplicate error. Submit the token you received from CapMonster Cloud right away and request a new one for every submission.
To insert a Turnstile token, find the hidden response field (an input named cf-turnstile-response) and set it to the token retrieved from CapMonster Cloud. Here is how to do it across the three automation frameworks.
Playwright / Puppeteer (Node.js):
const token = "YOUR_TOKEN";
await page.evaluate((t) => {
document.querySelector('[name="cf-turnstile-response"]').value = t;
}, token);
await page.click('#submit-btn');Selenium (Python):
token = "YOUR_TOKEN"
driver.execute_script("document.querySelector('[name=\"cf-turnstile-response\"]').value = arguments[0];", token)
driver.find_element("id", "submit-btn").click()If the form validates the token through a callback function (the data-callback attribute of the widget), call that function with the token instead.
Use Cloudflare's dummy keys. On the client, set the sitekey to 1x00000000000000000000AA (always passes), 2x00000000000000000000AB (always fails) or 3x00000000000000000000FF (forces an interactive challenge); on the server, use a dummy secret key such as 1x0000000000000000000000000000000AA. Dummy sitekeys work on any domain, including localhost, and produce the token XXXX.DUMMY.TOKEN.XXXX, which only dummy secret keys accept. The full list is in the test section above.
Siteverify returns success: false when the token is older than 300 seconds, has already been validated, or the secret key is wrong, and your server may also reject it if the returned hostname or action does not match what you expect. Check the error-codes array in the response and see the Siteverify error code table. Request a new token for every submission and send it right after you receive it.
* We do not guarantee a 100% success rate: CAPTCHA types and target-site configuration may change at any time. CapMonster Cloud delivers a high success rate for Cloudflare Turnstile solving. Based on CapMonster Cloud Team's internal monthly benchmarking. Actual solving speed and success rate vary depending on the target site, server load, and network conditions.
Cloudflare and Turnstile are trademarks of Cloudflare, Inc. CapMonster Cloud is not affiliated with or endorsed by Cloudflare. The Service is intended for publicly available data, testing your own or authorized websites, image recognition and accessibility. Collecting third-party data behind a login or paywall without permission is prohibited; your own accounts are not affected. You determine the legal status of your data before starting work.