What is Cloudflare Turnstile?
Cloudflare Turnstile is the small box that says something like “Verifying you are human” and then shows a green check. You see it on login pages, sign-up forms, contact forms, comment boxes and checkout pages. Cloudflare built it as a friendlier replacement for picture puzzles. Most people never have to click anything. The box quietly checks the browser and then gives the page a token.
That token is the whole point. When you submit the form, the page sends the token along. The website then asks Cloudflare, “Is this token real?” If there is no token, or the token is fake, the form is refused.
This is why Turnstile stops scripts. A script that sends the form without a browser has no token to send. With DraxonCloud you ask for that token through an API, then send it with your form like a normal visitor would.
How to solve Cloudflare Turnstile with DraxonCloud
- Open the page with the Turnstile box and copy two things: the page address and the site key.
- Send them to our API in one request, with the type
turnstile. - Wait for the answer. You can ask us to hold the request open until the token is ready, so you don’t have to keep checking.
- Put the token in the form, or send it the way the page does, and submit.
That’s all. You don’t run a browser, and there is nothing to install. It is one HTTP request to start and one to collect the answer.
What you send
website_url: the full address of the page that shows the box, likehttps://example.com/login. Use the real page, not the address of the Cloudflare frame inside it.website_key: the Turnstile site key. This is a public ID that the website gives to its widget. It usually starts with0x4. You can find it in the page source asdata-sitekey="..."on the box, or inside aturnstile.render(...)call in the page’s scripts. In your browser, right-click the page, choose “View page source” and search forsitekey.action(optional): some sites tag their widget with an action name, likelogin. Look fordata-actionon the box oraction:in the render call. Send it only if the page sets one.cdata(optional): extra data the site attaches to the widget, up to 255 characters. Look fordata-cdataorcData:in the render call. Send it exactly as you find it.proxyanduser_agent(optional): most Turnstile setups don’t need them.
If you are unsure about action or cData, leave them out. Only send them when the page really sets them.
What you get back
When the task is solved, the answer has two parts:
solution.token: the Turnstile token. It is a long string of letters and numbers.solution.user_agent: the browser user agent that goes with the token.
Most sites read the token from a hidden form field named cf-turnstile-response. Put the token in that field and submit the form. Some sites send it in a JSON body or a custom header instead. If so, watch what the page sends in your browser’s network tab and do the same.
When you submit, use the user_agent we returned as your request’s User-Agent header. It keeps your request looking like the same browser that got the token.
One more thing: a token is good for one use and only for a short time. Create the task when you are ready to submit, not minutes before.
A quick example
Start a task:
curl -s -X POST https://draxon.one/api/captcha/v1/tasks \
-H "Authorization: Bearer $DRAXON_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "turnstile",
"website_url": "https://example.com/login",
"website_key": "0x4AAAAAAAxxxxxxxxxxxxxx"
}'
You get back a task with an id and the status queued. Now wait for the answer in one request:
curl -s -H "Authorization: Bearer $DRAXON_KEY" \
"https://draxon.one/api/captcha/v1/tasks/<id>?wait=30"
When it’s done, the answer looks like this (some fields left out):
{
"status": "solved",
"solution": {
"token": "1.Etxg0XQnz1f-JBQ6nf...",
"user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X)..."
}
}
Already using another service?
You don’t have to rewrite anything. Change the address your tool talks to and use your DraxonCloud key.
- CapSolver and Anti-Captcha style: send
createTaskwith the typeTurnstileTask,TurnstileTaskProxyless,AntiTurnstileTaskorAntiTurnstileTaskProxyLess. We read the action fromactionormetadata.action, and the cData frommetadata.cdata,cDataordata. - 2Captcha style: call
in.phpwithmethod=turnstile, plussitekeyandpageurl. Put the cData indataand the action inaction.
The full list of addresses and answer formats is in Compatible APIs.
What it costs
You pay for each solved Turnstile. The current price is shown in the box at the top of this page and on the pricing page. When you start a task, we set the price aside from your balance. If the task is solved, that amount is charged. If it fails or runs out of time, the full amount goes back to you. Each task is charged once at most, even if you ask for the result many times.
Tips that save you time
- Get the site key from the live page. Sites change keys sometimes. If tokens suddenly stop working, check the page source again.
- Send action and cData only when they exist. A wrong action is worse than no action.
- Ask for the token right before you submit. Tokens don’t last, so don’t build up a pile of them.
- Use the returned user agent for the request that sends the token.
- Use
?wait=30instead of checking every second. One request waits for you and answers the moment the token is ready. - Send an
Idempotency-Keyheader if your network is shaky. If you send the same request twice, you get the same task back and pay once.
Every field, error code and code sample is in the Cloudflare Turnstile docs.