Skip to Content
Peak Solutions

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

FieldTypeRequiredDescription
task_typestringYesturnstiletask
urlstringYesThe page the widget is on.
sitekeystringYesThe widget's sitekey. See Find the sitekey.
proxystringYesYour proxy, as protocol://user:pass@host:port. Or send it in proxy parameters.
actionstringNoThe widget's data-action, if the page sets one.
cdatastringNoThe 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

FieldTypeDescription
data.tokenstringThe Turnstile token.
data.secondary_tokenstringOnly returned when the widget also issues a second token.
costnumberWhat the solve was charged, in USD.
errorstringOn failure: what went wrong, in words.
error_codestringOn 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_codeWhat to do
invalid_sitekeyCheck the sitekey belongs to that page.
invalid_actionSend the exact data-action from the page, or leave it out.
invalid_cdataSend the exact data-cdata from the page, or leave it out.
challenge_flaggedRetry with a proxy that has a cleaner IP.
proxy_errorCheck the proxy format and that the proxy is reachable.
timeoutRetry, or use a faster proxy.
solve_failedRetry, if needed with a different proxy.
solver_errorRetry.

A request missing sitekey, url or proxy is rejected with HTTP 400 and missing_fields. For rejections like insufficient_balance, see Error codes.

On this page