# Cloudflare Turnstile

Cloudflare's privacy-preserving captcha alternative.


# Overview

Turnstile is Cloudflare's user-friendly captcha that often works without user interaction.


# Task Types

Task Type Description Price
TurnstileTaskProxyless Without proxy (recommended) $0.00
TurnstileTask With your proxy $0.00

# Parameters

Parameter Type Required Description
websiteURL string Page URL with Turnstile
websiteKey string Turnstile site key
proxy string Required for TurnstileTask

# Finding the Site Key

Look for the Turnstile widget in page source:

<div class="cf-turnstile" data-sitekey="0x4AAAAAAAB..."></div>

Or search for:

  • data-sitekey
  • turnstile.render
  • cf-turnstile

# Example

import requests

response = requests.post("https://v1.captchasolv.com/solve", json={
    "clientKey": "YOUR_API_KEY",
    "task": {
        "type": "TurnstileTaskProxyless",
        "websiteURL": "https://example.com",
        "websiteKey": "0x4AAAAAAAB..."
    }
}, timeout=130)

token = response.json()["solution"]["token"]
const response = await axios.post('https://v1.captchasolv.com/solve', {
    clientKey: 'YOUR_API_KEY',
    task: {
        type: 'TurnstileTaskProxyless',
        websiteURL: 'https://example.com',
        websiteKey: '0x4AAAAAAAB...'
    }
}, { timeout: 130000 });

const token = response.data.solution.token;
curl -X POST https://v1.captchasolv.com/solve \
  -H "Content-Type: application/json" \
  -d '{
    "clientKey": "YOUR_API_KEY",
    "task": {
      "type": "TurnstileTaskProxyless",
      "websiteURL": "https://example.com",
      "websiteKey": "0x4AAAAAAAB..."
    }
  }'

# Using the Token

Submit the token in the cf-turnstile-response field:

# After solving
token = solve_turnstile(url, site_key)

# Submit with form
response = requests.post("https://example.com/submit", data={
    "cf-turnstile-response": token,
    # ... other form data
})

# Response

{
  "errorId": 0,
  "solution": {
    "token": "0.x7rN1bQ9...",
    "userAgent": "Mozilla/5.0..."
  },
  "cost": "0.00100"
}
Field Description
token Turnstile token to submit
userAgent User agent used (use same in your requests)

# Turnstile Modes

Turnstile has different modes - all are supported:

Mode Description
Managed Cloudflare decides when to show challenge
Non-Interactive Never shows a challenge
Invisible Widget is hidden

All modes use the same API call.


# Tips

  1. Token expiry - Tokens expire in ~5 minutes
  2. Use same User-Agent - Use the returned userAgent in subsequent requests
  3. Check for Cloudflare - Look for challenges.cloudflare.com in network requests