Các kiểu Captcha GeeTest hỗ trợ
1. Tìm captcha id của Geetest Captcha V4
Copy POST HTTP
Url : https://2captcha.net/in.php
Content-Type : application/json
{
"key" : "YOUR_API_KEY" ,
"method" : "geetest_v4" , // id cho GeeTest Captcha V4
"captcha_id" : "fcd636b4514bf7ac4143922550b3008b" , // thay bằng captcha_id geetest của bạn
"pageurl" : "https://www.geetest.com/en/adaptive-captcha-demo" // thay bằng url của bạn
}
3. Lấy kết quả giải captcha/Response
Copy GET HTTP
Url : https://2captcha.net/res.php?key=[apikey của bạn]&id=[task id]&json=1
Đang xử lý Thành công Thất bại
Copy {
"status" : 0 ,
"request" : "CAPCHA_NOT_READY"
}
Copy dạng text: OK|[kết quả giải ra]
Ví dụ: OK|{"captcha_id":"fcd636b4514bf7ac4143922550b3008b","captcha_output":"rF8vMuXmInfqVcmw160zbF9zgafrm6UdsShw1uDx5MEqc-pb7GaxVebGOm5PRIW7J6MwTon3gDi5oWmtsaijmKH8SSvGyLPkFwl2tllq5yEkZRN4gCrFnAqzniG5zgVdIVvgdbvChuOz4INoXj_uuFhUIG5fVW676iIQb0Ex_2OX14z--SbrcARHmD8wYFGbFxAfncFxBRtwMsc5vMKBSz9_yqNElKKI3A5t1ByxQfv8TPmg5epSyIm-304YcXIFaKWhE160DMgrcibmfFbrK96Wo46WMXM0GcoJkOXDyGZHwC1sigcgNZdTDQ0J-U0mNzbBSvqaHGYFBahwH0Ah7mQ8PiRvFkWeEb2z0_hBkpwz_8a-ChI_RDJJSveaaMmBqX5WPPshvBk4B9uHhZqZec09uXuNXMx0Cxnck1Nu7Bo=","gen_time":"1702645283","lot_number":"4741122537184ea9a42d0aece03d7562","pass_token":"7a6c4754b0fc8c5b42a83dbbe43c98e8d960c26a368ee22ca898c4df9f926a84","risk_type":"slide"}
dạng JSON
{
"status" : 1 ,
"request" : {
"captcha_id" : "fcd636b4514bf7ac4143922550b3008b" ,
"captcha_output": "rF8vMuXmInfqVcmw160zbF9zgafrm6UdsShw1uDx5MEqc-pb7GaxVebGOm5PRIW7J6MwTon3gDi5oWmtsaijmKH8SSvGyLPkFwl2tllq5yEkZRN4gCrFnAqzniG5zgVdIVvgdbvChuOz4INoXj_uuFhUIG5fVW676iIQb0Ex_2OX14z--SbrcARHmD8wYFGbFxAfncFxBRtwMsc5vMKBSz9_yqNElKKI3A5t1ByxQfv8TPmg5epSyIm-304YcXIFaKWhE160DMgrcibmfFbrK96Wo46WMXM0GcoJkOXDyGZHwC1sigcgNZdTDQ0J-U0mNzbBSvqaHGYFBahwH0Ah7mQ8PiRvFkWeEb2z0_hBkpwz_8a-ChI_RDJJSveaaMmBqX5WPPshvBk4B9uHhZqZec09uXuNXMx0Cxnck1Nu7Bo=",
"gen_time" : "1702645283" ,
"lot_number" : "4741122537184ea9a42d0aece03d7562" ,
"pass_token" : "7a6c4754b0fc8c5b42a83dbbe43c98e8d960c26a368ee22ca898c4df9f926a84" ,
"risk_type" : "slide"
}
}
Copy {
"status" : 0 ,
"request" : "Apikey incorrect"
}
hoặc
Copy {
"status" : 0 ,
"request" : "Id does not exist"
}
C# PHP Curl Javascript Jquery AJAX Python NodeJS
Copy var client = new HttpClient ();
var request = new HttpRequestMessage ( HttpMethod . Post , "https://2captcha.net/in.php" );
var content = new StringContent ( "{\r\n \"key\": \"[api key]\",\r\n \"method\": \"geetest_v4\",\r\n \"captcha_id\": \"fcd636b4514bf7ac4143922550b3008b\",\r\n \"pageurl\": \"https://www.geetest.com/en/adaptive-captcha-demo\"\r\n}" , null , "application/json" );
request . Content = content;
var response = await client .SendAsync(request);
response .EnsureSuccessStatusCode();
Console .WriteLine( await response . Content .ReadAsStringAsync());
Copy <? php
$curl = curl_init () ;
curl_setopt_array ( $curl , array(
CURLOPT_URL => 'https://2captcha.net/in.php' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_ENCODING => '' ,
CURLOPT_MAXREDIRS => 10 ,
CURLOPT_TIMEOUT => 0 ,
CURLOPT_FOLLOWLOCATION => true ,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1 ,
CURLOPT_CUSTOMREQUEST => 'POST' ,
CURLOPT_POSTFIELDS => '{
"key": "[api key]",
"method": "geetest_v4",
"captcha_id": "fcd636b4514bf7ac4143922550b3008b",
"pageurl": "https://www.geetest.com/en/adaptive-captcha-demo"
}' ,
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
) ,
) ) ;
$response = curl_exec ( $curl ) ;
curl_close ( $curl ) ;
echo $response;
?>
Copy var settings = {
"url" : "https://2captcha.net/in.php" ,
"method" : "POST" ,
"timeout" : 0 ,
"headers" : {
"Content-Type" : "application/json"
} ,
"data" : JSON .stringify ({
"key" : "[api key]" ,
"method" : "geetest_v4" ,
"captcha_id" : "fcd636b4514bf7ac4143922550b3008b" ,
"pageurl" : "https://www.geetest.com/en/adaptive-captcha-demo"
}) ,
};
$ .ajax (settings) .done ( function (response) {
console .log (response);
});
Copy import requests
import json
url = "https://2captcha.net/in.php"
payload = json . dumps ({
"key" : "[api key]" ,
"method" : "geetest_v4" ,
"captcha_id" : "fcd636b4514bf7ac4143922550b3008b" ,
"pageurl" : "https://www.geetest.com/en/adaptive-captcha-demo"
})
headers = {
'Content-Type' : 'application/json'
}
response = requests . request ( "POST" , url, headers = headers, data = payload)
print (response.text)
Copy var request = require ( 'request' );
var options = {
'method' : 'POST' ,
'url' : 'https://2captcha.net/in.php' ,
'headers' : {
'Content-Type' : 'application/json'
} ,
body : JSON .stringify ({
"key" : "[api key]" ,
"method" : "geetest_v4" ,
"captcha_id" : "fcd636b4514bf7ac4143922550b3008b" ,
"pageurl" : "https://www.geetest.com/en/adaptive-captcha-demo"
})
};
request (options , function (error , response) {
if (error) throw new Error (error);
console .log ( response .body);
});
5. Sử dụng kết quả token nhận được
Sử dụng các giá trị được trả về trên trang web mục tiêu của bạn giống như cách chúng được sử dụng khi bạn giải hình ảnh xác thực theo cách thủ công. Có thể có một biểu mẫu với một tập hợp các input ẩn hoặc callback JavaScript. Hoặc bạn có thể chỉ cần xây dựng một yêu cầu HTTP với dữ liệu cần thiết
Lưu ý : Nên sử dụng phần mềm PostMan để kiểm tra chạy test trước