Cloudflare Turnstile: solving Cloudflare Turnstile
TIP Create the task with createTask method and get the result with getTaskResult method.
Already using Anti-Captcha/CapSolver style APIs? Switch provider URLs to https://captcha.scrappey.com and keep the same flow.
Pricing: 1 EUR / 1000 requests. Volume pricing gets cheaper the more you buy.
Create Task
Create a recognition task with the createTask method.
Task Object Structure
| Properties | Type | Required | Description |
|---|---|---|---|
type | String | Required | AntiTurnstileTaskProxyLess |
websiteURL | String | Required | Web address of the target page. |
websiteKey | String | Required | Domain public key / captcha sitekey. |
metadata.action | String | Optional | Turnstile data-action value. |
metadata.cdata | String | Optional | Turnstile data-cdata value. |
metadata.invisible | Boolean | Optional | Set true for invisible challenges. |
Example Request
POST https://captcha.scrappey.com/createTask
Host: captcha.scrappey.com
Content-Type: application/json
{
"clientKey": "YOUR_SCRAPPEY_API_KEY",
"task": {
"type": "AntiTurnstileTaskProxyLess",
"websiteURL": "https://stake.com/",
"websiteKey": "0x4AAAAAAAGD4gMGOTFnvupz",
"metadata": {
"action": "login"
}
}
}Example Response
{
"errorId": 0,
"errorCode": "",
"errorDescription": "",
"status": "idle",
"taskId": "61138bb6-19fb-11ec-a9c8-0242ac110006"
}Getting Results
Submit the returned taskId to get recognition results.
Example Request
POST https://captcha.scrappey.com/getTaskResult
Host: captcha.scrappey.com
Content-Type: application/json
{
"clientKey": "YOUR_SCRAPPEY_API_KEY",
"taskId": "61138bb6-19fb-11ec-a9c8-0242ac110006"
}Example Response
{
"errorId": 0,
"taskId": "61138bb6-19fb-11ec-a9c8-0242ac110006",
"status": "ready",
"errorCode": null,
"errorDescription": null,
"solution": {
"token": "TOKEN_VALUE",
"type": "turnstile"
}
}Use SDK Request (Node.js)
// npm install axios
import axios from "axios";
const baseURL = "https://captcha.scrappey.com";
const clientKey = process.env.SCRAPPEY_API_KEY;
const { data: created } = await axios.post(`${baseURL}/createTask`, {
clientKey,
task: {
"type": "AntiTurnstileTaskProxyLess",
"websiteURL": "https://stake.com/",
"websiteKey": "0x4AAAAAAAGD4gMGOTFnvupz",
"metadata": {
"action": "login"
}
}
});
const taskId = created.taskId;
while (true) {
await new Promise((r) => setTimeout(r, 1500));
const { data: result } = await axios.post(`${baseURL}/getTaskResult`, {
clientKey,
taskId
});
if (result.status === "ready") {
console.log("Token:", result.solution.token);
break;
}
if (result.status === "failed") {
throw new Error(`${result.errorCode}: ${result.errorDescription}`);
}
}