Turnstile
Solve a Cloudflare Turnstile widget through your own proxy.
Solves a Cloudflare Turnstile widget and returns the token the site expects. The solve runs through your proxy.
Request
POST https://api.peak.fo/solve
| Field | Type | Required | Description |
|---|---|---|---|
task_type | string | Yes | turnstiletask |
url | string | Yes | The page the widget is on. |
sitekey | string | Yes | The widget's sitekey. See Find the sitekey. |
proxy | string | Yes | Your proxy, as protocol://user:pass@host:port. Or send it in proxy parameters. |
action | string | No | The widget's data-action, if the page sets one. |
cdata | string | No | The widget's data-cdata, if the page sets one. |
Example
The Python examples use requests (pip install requests). The Go examples use tls-client (go get github.com/bogdanfinn/tls-client, Go 1.27+).
curl https://api.peak.fo/solve \
-H "X-API-Key: pk_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"task_type": "turnstiletask",
"url": "https://example.com/login",
"sitekey": "0x4AAAAAAA...",
"proxy": "http://user:pass@1.2.3.4:8080"
}'Response
| Field | Type | Description |
|---|---|---|
data.token | string | The Turnstile token. |
data.secondary_token | string | Only returned when the widget also issues a second token. |
cost | number | What the solve was charged, in USD. |
error | string | On failure: what went wrong, in words. |
error_code | string | On failure: what went wrong, as a stable code. |
{
"success": true,
"data": {
"token": "0.AgAAAB..."
},
"cost": 0.0009
}Errors
A failed solve returns HTTP 200 with "success": false, and is not charged.
error_code | What to do |
|---|---|
invalid_sitekey | Check the sitekey belongs to that page. |
invalid_action | Send the exact data-action from the page, or leave it out. |
invalid_cdata | Send the exact data-cdata from the page, or leave it out. |
challenge_flagged | Retry with a proxy that has a cleaner IP. |
proxy_error | Check the proxy format and that the proxy is reachable. |
timeout | Retry, or use a faster proxy. |
solve_failed | Retry, if needed with a different proxy. |
solver_error | Retry. |
A request missing sitekey, url or proxy is rejected with HTTP 400 and missing_fields. For rejections like insufficient_balance, see Error codes.