Giải captcha cloudflare turnstile
Endpoint
POST https://api.anticaptcha.pro/v1/createTask
Các tham số body
Tên trường
Kiểu dữ liệu
Bắt buộc
Mô tả
apiKey
string
✔️
Api key sử dụng dịch vụ
method
string
✔️
Giá trị turnstile
sitekey
string
✔️
Sitekey của website cần giải, ví dụ: 0x4AAAAAAA-SoSQqf-xXxxX
pageurl
string
✔️
version
string
Giá trị default
Request mẫu
curl --location 'https://api.anticaptcha.pro/v1/createTask' \
--header 'Content-Type: application/json' \
--data '{
"apiKey": "d7aro666cxlpjx822ctvzwmq09x3y6mc",
"method": "turnstile",
"sitekey": "XXXX.DUMMY.TOKEN.XXXX",
"pageurl": "https://demo.turnstile.workers.dev/",
"version": "default"
}'
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
const raw = JSON.stringify({
"apiKey": "d7aro666cxlpjx822ctvzwmq09x3y6mc",
"method": "turnstile",
"sitekey": "XXXX.DUMMY.TOKEN.XXXX",
"pageurl": "https://demo.turnstile.workers.dev/",
"version": "default"
});
const requestOptions = {
method: "POST",
headers: myHeaders,
body: raw,
redirect: "follow"
};
fetch("https://api.anticaptcha.pro/v1/createTask", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
import requests
import json
url = "https://api.anticaptcha.pro/v1/createTask"
payload = json.dumps({
"apiKey": "d7aro666cxlpjx822ctvzwmq09x3y6mc",
"method": "turnstile",
"sitekey": "XXXX.DUMMY.TOKEN.XXXX",
"pageurl": "https://demo.turnstile.workers.dev/",
"version": "default"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.anticaptcha.pro/v1/createTask");
var content = new StringContent("{\r\n \"apiKey\": \"d7aro666cxlpjx822ctvzwmq09x3y6mc\",\r\n \"method\": \"turnstile\",\r\n \"sitekey\": \"XXXX.DUMMY.TOKEN.XXXX\",\r\n \"pageurl\": \"https://demo.turnstile.workers.dev/\",\r\n \"version\": \"default\"\r\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Kết quả trả về
{
"success": true,
"data": {
"status": "idle",
"taskId": "add42add-02c3-431b-91ce-e8646bd7eea4" //Bạn cần lưu taskId để có thể lấy kết quả của captcha
}
}
{
"success": false,
"code": 404,
"msg": "Apikey is invalid"
}
{
"success": false,
"code": 400,
"msg": "Insufficient balance"
}
{
"success": false,
"code": 400,
"msg": [
"sitekey must be a string",
"pageurl must be a string",
"version must be one of the following values: default"
]
}
Last updated