Turnstile
Solves Cloudflare Turnstile in managed, non-interactive and invisible modes. Costs $0.80 per 1,000 tokens.
Task object
Send this as task in createTask.
| Field | Type | Description |
|---|---|---|
type Required | string | Always TurnstileTask. |
websiteURL Required | string | The full URL of the page where the widget appears. |
websiteKey Required | string | The Turnstile site key. It starts with 0x. |
action Optional | string | The action value the site sets on the widget, if any. |
cdata Optional | string | The cData value the site sets on the widget, if any. |
proxy Optional | string | Optional. Turnstile tasks work without a proxy. |
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "TurnstileTask",
"websiteURL": "https://example.com/login",
"websiteKey": "0x4AAAAAAABkMYinukE8nzY",
"action": "login",
"cdata": "session-7f3a"
}
}Finding the site key
Look in the page source for either of these:
- A
data-sitekeyattribute on thecf-turnstileelement. - A
sitekeyoption passed toturnstile.render().
The same element or call holds data-action and data-cdata (or action and cData) when the site uses them. Send them exactly as they
appear, or the site will reject the token.
Solution
| Field | Type | Description |
|---|---|---|
token Required | string | The Turnstile response token. |
{
"errorId": 0,
"status": "ready",
"solution": {
"token": "0.xK3fQ9...Lm2"
}
}Submitting the token
Most sites read the token from a form field named cf-turnstile-response. Put the
token there and submit the form as usual.
<input type="hidden" name="cf-turnstile-response" value="TOKEN" />