Cloudflare Turnstile API
This page introduces how to display Cloudflare Turnstile and how to use our API.
Get websiteKey
Open your website, then press F12 to open the developer console of the browser. Find the element with the
data-sitekey
attribute. For example: https://peet.ws/turnstile-test/managed.html<div class="cf-turnstile" data-sitekey="0x4AAAAAAABS7TtLxsNa7Z2e">
Send
websiteURL
andwebsiteKey
to our API.
Use the API
Create Task: Submit a POST request to the following URL: https://solver.nstbrowser.io/api/v1/createTask. Please use the Body parameters below:
{ "clientKey": "{{clientKey}}", "task": { "type": "cloudflare_turnstile", "websiteURL": "https://xxx.com/turnstile-test/managed.html", "websiteKey": "0x4AAAAAAABS7TtLxsNa7Z2e", "metadata": { "action": "", "cdata":"" } }
If the request is successful, the server will return
taskId
:{ "taskId": "f25c40c0-5fd8-44a8-a0c1-462e2c35c6b7", "taskType": "cloudflare_turnstile" }
Get Task Result: After waiting for 1 to 2 seconds, you can use the following Body parameter link: https://solver.nstbrowser.io/api/v1/getTaskResult
If
turnstile
completes execution, you will get atoken
```json
{
"data": {
"id": "60ffe655-b95d-4d31-addc-2fc09aab6a48",
"type": "cloudflare_turnstile",
"state": "success",
"solution": {
"err": false,
"msg": "success",
"token": "0.laQWon3LoxofXQ3_mFfMCedzLTtpg9Uh61VUFiAJvkkQg3rW2RdzfIVZwZ1gl7bPQso88emN6LCn3IzaGkUxn2VvFqbGaOmCvjTONSGjDbg6O-EdEvagiGGFUwOuv0uc7nISrZjKQixa480dV-iy3H7dDqeDpOvfj_8Orvqlkd2hXLSNwL_PiSdc1j7qqpoppYpoOxqYgQFyoVtsRzjBX54a2LXE4XGllRGuB45_VE-6j7YL1RjOndmPuBBLxbg8IT0K1oPcOMkcrq1i6OqNf69gCiDsvfcxfvUP9aZxW2ZScpt9X_jmCDN1aPaaZ1pvpV9Vtde9WafRz7AEmIBoaYFgPBRIpSyw7NlwMh5j1BY33mv6pduw3O0vQ_e-9Les4j4akqJ08kS-idjTHyNaMMIu-XbX9RnNBKcew0azSWk.iVg30iJrrpH7HM46L_YKHg.07db2dc435f6836684bf6cdeaf19865c6a345f9042e2732d18dbf854c63251f7",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
}
},
"err": false,
"msg": "success",
"code": 200
}
![](https://assets.apidog.com/app/apidoc-image/custom/20240507/7fb0949c-346d-40a1-b8e8-b2962cfaf3d7.png)