Skip to content

Cloudflare Turnstile Bypass: How to Solve Cloudflare Captcha Automatically

logo

Cloudflare Turnstile has quietly become one of the most common obstacles in web automation. Unlike old school captchas that make you click on fire hydrants, Turnstile runs silently in the background and often requires no user interaction at all. That sounds nice for regular visitors, but it is a headache if you are building scrapers, testing tools, or any kind of automation that touches a Cloudflare protected site. This guide walks through how the turnstile captcha actually works, why it blocks your scripts, and how to get around it using a token solving API.

How to Bypass Cloudflare Turnstile Step by Step

The process is straightforward. You extract two parameters from the page, send them to the solver, get a token back, and inject it into the form. No image recognition involved.

How to solve it?

You need (click here for details)

The solution is similar to hCaptcha. The parameters you need for recognition can be obtained through the developer mode in the browser:

  1. Find the sitekey in the source code of the page or js file. This is usually found in the div element named "data-sitekey" or in the sitekey property. It can also be in an iframe. https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/b/turnstile/if/ov2/av0/rcv0/0/iqiy3/1x00000000000000000000AA/light/normal

We need to Link to the page where to locate Cloudflare Turnstile: https://react-turnstile.vercel.app/basic Key (site-key): 1x00000000000000000000AA

Sending

http://api2.cap.guru/in.php

ParameterTypeRequiredDescription
keyStringYesYou can see the key here
methodStringYesturnstile - determines what you solved Cloudflare Turnstile
sitekeyStringYesThe value of the data-sitekey parameter you found in the page code. For example 1x00000000000000000000AA
pageurlStringYesURL of the page you are solving Cloudflare Turnstile. For example https://react-turnstile.vercel.app/basic
jsonNumber, Default: 0No0 - the server will return the answer as plain text. 1 - the server will return the answer in the format JSON
Example request
http://api2.cap.guru/in.php?key=YOUR_APIKEY&method=turnstile&sitekey=1x00000000000000000000AA&pageurl=https://react-turnstile.vercel.app/basic
Example answer

After sending the job to us, you should receive a response if the request is successful:

 'OK|65787087'  and {"status":1,"request":"65787087"}

Option json:

json
{
 "status":1,
 "request":"65787087"
}

Please read the full list of possible errors in case you do not get the job number.

Getting the result

Wait about 10 to 15 seconds, then send a GET request to get the token.

Example query:

https://api2.cap.guru/res.php?key=key&action=get&id=id

If the task is solved, you get the Turnstile token in the response. If not, you get CAPCHA_NOT_READY, wait 5 seconds and try again. Typical solve time for a turnstile captcha is 10 to 30 seconds.

Injecting the token

Find the hidden input or textarea with the name cf-turnstile-response on the page and set its value to the received token. If you are using a browser automation tool, execute JavaScript to insert the token and trigger the Turnstile callback function. If you are working with direct HTTP requests, include the token as a form parameter in your POST submission.

What Cloudflare Turnstile Actually Does

Turnstile is Cloudflare's replacement for traditional captchas. The company launched it in late 2022 with a simple pitch: verify humans without making them solve puzzles. Instead of showing image grids or text challenges, the turnstile captcha runs a series of silent checks inside the browser. It collects canvas and WebGL fingerprints, checks the TLS handshake signature, runs proof of work computations, probes browser APIs, and tracks behavioral signals. All of that happens in the background while the user sees nothing, or at most a brief spinning widget.

There are three deployment modes, and you will run into all of them depending on the site:

ModeWhat the user seesWhat happens under the hood
ManagedNothing, or a brief widgetTurnstile decides automatically whether to pass, challenge silently, or escalate
Non-InteractiveA brief check indicatorBrowser side verification runs without user action
InteractiveA checkbox to clickFalls back to a clickable challenge when silent checks are inconclusive

The important thing to understand is that regardless of mode, the end result is the same: a signed token that the server validates. If your automation cannot produce that token, the request gets blocked. That is why a cloudflare turnstile bypass always comes down to obtaining a valid token.

Why Your Scripts Get Blocked

If you have tried hitting a Turnstile protected page with requests or a basic Selenium setup, you already know it does not work. Here is why.

Turnstile requires real JavaScript execution. It is not just checking headers or cookies. The widget runs actual code in the browser, performs cryptographic proof of work, and builds a fingerprint from dozens of signals that only exist in a real rendering engine. A raw HTTP request cannot do any of that.

Even headless browsers struggle. Turnstile checks for automation signals like navigator.webdriver, inspects the WebGL renderer string (headless Chrome on a VPS returns llvmpipe instead of a real GPU), and compares the canvas fingerprint against known patterns. If anything looks off, the challenge fails silently and the token never gets issued.

On top of that, Cloudflare scores the IP address. Datacenter IPs from AWS, Hetzner, DigitalOcean, and similar providers carry a high risk score before your code even loads. The cloudflare captcha challenge gets harder or outright fails for traffic from these ranges.

This is where a dedicated solver API becomes the practical solution. Instead of trying to make your headless browser pass every fingerprint check, you offload the token generation to a service that handles it reliably.

TIP

Turnstile tokens are single use and expire within a few minutes. Always use the token immediately after receiving it. Stale tokens are the number one cause of failed submissions.

Turnstile vs Cloudflare Challenge Page

These are two different things, and people mix them up constantly.

Turnstile is a widget that site owners embed directly into their pages. It sits inside a form, validates the user, and produces a token. You can encounter it on any website, including sites that are not even on the Cloudflare network. The sitekey is in the page HTML, and the solving approach described above works for it.

Cloudflare Challenge Page is the full page interstitial that Cloudflare shows before letting you access a site. It is the "Checking your browser" screen. This uses the same underlying technology as Turnstile but works differently from an automation perspective. The challenge page sets a cf_clearance cookie that you need to carry in subsequent requests, and it is tied to specific IP, User Agent, and TLS fingerprint combinations.

Both can be solved via API, but the parameters and flow differ. Make sure you know which one you are dealing with before writing your integration code.

Integrating with Selenium, Puppeteer, and Playwright

Once you have the token from the API, getting it into the page is the easy part.

With Selenium, switch to the frame containing the Turnstile widget if it is inside an iframe, then use execute_script to set the value of the cf-turnstile-response field and call the callback:

driver.execute_script('document.querySelector("[name=cf-turnstile-response]").value = "TOKEN"')

With Puppeteer or Playwright, use page.evaluate() to do the same thing. If the site uses a JavaScript callback on successful verification, you will need to trigger that function after injecting the token. Check the network tab to identify the callback name.

For server side workflows where you submit forms via direct HTTP requests, simply include the cf-turnstile-response parameter in your POST data alongside the other form fields. No browser required.

The key detail that matters: use the same IP address and User Agent for both the solve request and the token submission. Cloudflare cross checks these values during validation. If the token was generated from one IP and submitted from another, it may get rejected.

Mistakes That Cost You Time and Money

After working with enough Turnstile integrations, certain patterns keep showing up. Here are the ones that cause the most wasted tokens and failed requests.

Expired tokens. Turnstile tokens have a short lifespan, typically a few minutes. If your automation pipeline has a delay between getting the token and submitting the form, the token may already be dead by the time it reaches the server. Solve and submit as fast as possible.

Wrong sitekey. Some sites load the sitekey dynamically via JavaScript, so it does not appear in the static HTML source. In those cases, you need to check the network tab for requests to challenges.cloudflare.com that contain the sitekey, or render the page first and then extract it from the DOM.

Missing action or cdata. These optional parameters are not always required, but when they are, a token generated without them will fail server side validation every time. Always check whether the site passes data-action or data-cdata attributes to the Turnstile widget.

IP mismatch. As mentioned above, if you solve from one IP and submit from another, expect failures. Use a proxy pass through or make sure your solver and your submission requests route through the same IP.

Datacenter IPs. Cloudflare assigns risk scores to IP ranges. A fresh datacenter IP from a cloud provider starts at a disadvantage. Residential or mobile proxies produce significantly better results for cloudflare turnstile bypass workflows.

WARNING

If tokens keep getting rejected after submission, check three things: token freshness (use immediately), IP consistency (solve and submit from the same IP), and whether the site requires action or cdata parameters.

Making It Work at Scale

For high volume cloudflare captcha solving, a few optimizations make a real difference.

Pipeline your requests. Do not wait for one token before requesting the next. Cap.Guru supports concurrent task submissions, so you can queue up multiple solve requests and process tokens as they come in. This cuts the effective wait time dramatically when you are running parallel sessions.

Rotate residential proxies. Cloudflare tracks IP reputation over time. Hitting the same site from the same IP repeatedly will gradually increase the difficulty and failure rate. Rotate IPs across a residential pool, and use sticky sessions long enough to complete each individual form submission.

Cache the sitekey. It rarely changes for a given site. Extracting it once and reusing it across sessions saves you from loading the full page every time.

Monitor your success rate. If it starts dropping, the most likely cause is either Cloudflare updating their validation logic or the site changing its Turnstile configuration. Check whether the sitekey, action, or cdata values have changed before debugging anything else.

Why Cap.Guru for Cloudflare Turnstile

Turnstile is a fundamentally different challenge from image based captchas. There are no pictures to classify, no tiles to click, no objects to rotate. It is all about generating a valid token that passes Cloudflare's server side verification. Cap.Guru handles this through a solver API that produces working Turnstile tokens compatible with all three deployment modes: managed, non interactive, and interactive.

The API follows a standard request and poll pattern that integrates with any language or framework. Python, Node.js, PHP, Go, Java, whatever you are building with. It supports optional parameters like action and cdata for sites that use them, and handles both standalone Turnstile widgets and Cloudflare Challenge pages. Solve times typically range from 10 to 30 seconds, and the pricing stays competitive even at high volume.

If your scraper, testing tool, or automation pipeline is getting blocked by the cloudflare captcha, this is the straightforward way to get past it without fighting fingerprint detection or maintaining your own browser farm.