How to Solve Cloudflare Turnstile with DeathByCaptcha
Cloudflare Turnstile is an increasingly popular CAPTCHA alternative that many websites use to block automated traffic. Unlike traditional CAPTCHAs, Turnstile runs invisibly or with minimal user interaction, making it harder for standard automation tools to handle.
DeathByCaptcha's turnstile solver provides a reliable way to bypass Cloudflare Turnstile challenges programmatically.
How Turnstile Works
Cloudflare Turnstile presents a challenge token that must be solved before a website allows access. It operates in three modes:
- Non-interactive: Runs invisibly in the background with no user interaction.
- Checkbox: Shows a simple checkbox similar to reCAPTCHA's "I'm not a robot".
- Invisible: Triggers only when suspicious activity is detected.
DBC can solve all three modes through a unified API endpoint.
The solving flow looks like this:

Solving Turnstile with DBC
Python
import deathbycaptcha
client = deathbycaptcha.SocketClient("username", "password")
result = client.decode({
"sitekey": "YOUR_SITE_KEY",
"pageurl": "https://example.com"
}, type=12, timeout=60)
if result:
token = result.text # Turnstile response token
print(f"Token: {token}")
Node.js
const DBC = require('deathbycaptcha');
const client = new DBC.SocketClient('username', 'password');
const result = await client.decode({
sitekey: 'YOUR_SITE_KEY',
pageurl: 'https://example.com'
}, 60, 13);
console.log('Token:', result.text);
PHP
require_once 'deathbycaptcha.php';
$client = new DeathByCaptcha_HttpClient("username", "password");
$turnstile_params = json_encode([
'sitekey' => 'YOUR_SITE_KEY',
'pageurl' => 'https://example.com',
]);
$captcha = $client->decode(null, ['type' => 12, 'turnstile_params' => $turnstile_params]);
if ($captcha) {
echo "Token: " . $captcha["text"] . "\n";
}
Java
import com.DeathByCaptcha.Client;
import com.DeathByCaptcha.HttpClient;
import com.DeathByCaptcha.Captcha;
import org.json.JSONObject;
Client client = new HttpClient("username", "password");
JSONObject params = new JSONObject();
params.put("sitekey", "YOUR_SITE_KEY");
params.put("pageurl", "https://example.com");
Captcha captcha = client.decode(12, params);
if (captcha != null) {
System.out.println("Token: " + captcha.text);
}
Go
package main
import (
"encoding/json"
"fmt"
"log"
dbc "github.com/deathbycaptcha/deathbycaptcha-api-client-go/v4/deathbycaptcha"
)
func main() {
client := dbc.NewHttpClient("username", "password")
defer client.Close()
tokenParams, _ := json.Marshal(map[string]string{
"sitekey": "YOUR_SITE_KEY",
"pageurl": "https://example.com",
})
captcha, err := client.Decode(nil, dbc.DefaultTokenTimeout, map[string]string{
"type": "12",
"turnstile_params": string(tokenParams),
})
if err != nil {
log.Fatal(err)
}
if captcha != nil {
fmt.Println("Token:", *captcha.Text)
}
}
C
using System.Collections;
using DeathByCaptcha;
Client client = new DeathByCaptcha.HttpClient("username", "password");
string tokenParams = "{\"sitekey\":\"YOUR_SITE_KEY\",\"pageurl\":\"https://example.com\"}";
Captcha captcha = client.Decode(Client.DefaultTimeout,
new Hashtable { { "type", 12 }, { "turnstile_params", tokenParams } });
if (captcha != null)
Console.WriteLine("Token: " + captcha.Text);
cURL
curl --data-urlencode "username=YOUR_USERNAME" \
--data-urlencode "password=YOUR_PASSWORD" \
--data-urlencode "type=12" \
--data-urlencode 'turnstile_params={"sitekey":"YOUR_SITE_KEY","pageurl":"https://example.com"}' \
http://api.dbcapi.me/api/captcha
The response is JSON and the Turnstile token arrives in the text field.
Integrating Turnstile Solving into Selenium
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("https://example.com")
# Solve Turnstile via DBC
cid, token = client.decode({
"sitekey": "SITE_KEY",
"pageurl": "https://example.com"
}, type=12)
# Inject the token
driver.execute_script(
f"document.querySelector('[name=cf-turnstile-response]').value='{token}';"
)
driver.execute_script("turnstileCallback('{token}');")
Why Use DBC for Turnstile
- High success rate: DBC's hybrid model handles Turnstile's adaptive challenges.
- Fast solve times: Typically under 3 seconds for non-interactive mode.
- Broad compatibility: Works across all Turnstile modes and configurations.

Portuguese
English
Spanish
Russian
Chinese
French
Hindi
Arabic
Bengali
Indonesian
com, 