← Back to full docs
POST /solve

Cloudflare Turnstile

Solves Cloudflare Turnstile widgets and returns a token you submit as the cf-turnstile-response field.

Authentication

Pass your API key via the X-API-Key header on every request.

Keep your key secret. Never expose it in client-side code or commit it to version control.

Endpoint

POST/solve

Parameters

ParameterTypeRequiredDescription
task_typestringyesMust be "turnstiletask"
sitekeystringyesCloudflare Turnstile sitekey for the target site
urlstringyesTarget page URL — must end with a trailing slash (/)
proxystringyesProxy in http://user:pass@ip:port format
actionstringnoTurnstile action value — must match the value configured on the target site
cdatastringnoTurnstile cdata value — must match the value configured on the target site
The URL must end with a trailing slash: https://example.com/

Request / Response

Request

{
  "task_type": "turnstiletask",
  "url": "https://example.com/",
  "sitekey": "0x4AAAAAAAxxxxx",
  "proxy": "http://user:pass@1.2.3.4:8080"
}

Response

{
  "success": true,
  "data": {
    "token": "0.AgAAABBqzz..."
  }
}

Code Examples

import requests

url = "https://api.peak.fo/solve"
headers = {
    "X-API-Key": "pk_your_api_key",
    "Content-Type": "application/json"
}
payload = {
    "task_type": "turnstiletask",
    "sitekey": "0x4AAAAAAA...",
    "url": "https://example.com/",
    "proxy": "http://user:pass@1.2.3.4:8080"
}

response = requests.post(url, json=payload, headers=headers)
data = response.json()

if data["success"]:
    token = data["data"]["token"]
    print(f"Token: {token}")
else:
    print(f"Error: {data['error']}")