Solves Cloudflare Turnstile widgets and returns a token you submit as the cf-turnstile-response field.
Pass your API key via the X-API-Key header on every request.
task_typestringyesMust be "turnstiletask"sitekeystringyesCloudflare Turnstile sitekey for the target siteurlstringyesTarget page URL — must end with a trailing slash (/)proxystringyesProxy in http://user:pass@ip:port formatactionstringnoTurnstile action value — must match the value configured on the target sitecdatastringnoTurnstile cdata value — must match the value configured on the target sitehttps://example.com/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..."
}
}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']}")