Kết nối với dịch vụ giải captcha thông qua REST API đơn giản
API sử dụng phương thức POST với dữ liệu dạng JSON hoặc form-data. Mọi yêu cầu đều cần xác thực bằng API Key.
Tất cả các request cần gửi kèm api_key trong body của request.
api_key (required) string - API Key của bạn img_base64 (required) string - Ảnh captcha encode base64
https://clonev6.shopcode.top/api/captcha.php?bank=bidv
<?php
$curl = curl_init();
$dataPost = [
"api_key" => "YOUR_API_KEY_HERE",
"img_base64" => base64_encode(file_get_contents("captcha.png")),
];
curl_setopt_array($curl, [
CURLOPT_URL => "https://clonev6.shopcode.top/api/captcha.php?bank=bidv",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => $dataPost,
]);
$response = curl_exec($curl);
curl_close($curl);
$result = json_decode($response, true);
// $result["captcha"] => "ab3k9"
echo $result["captcha"];https://clonev6.shopcode.top/api/captcha.php?bank=mbbank
import requests, base64
with open("captcha.png", "rb") as f:
img_b64 = base64.b64encode(f.read()).decode()
response = requests.post(
"https://clonev6.shopcode.top/api/captcha.php?bank=mbbank",
data={
"api_key": "YOUR_API_KEY_HERE",
"img_base64": img_b64,
}
)
result = response.json()
print(result["captcha"]) # e.g. "KmC3-Aq"https://clonev6.shopcode.top/api/captcha.php?bank=vcb
// Node.js example
const fs = require('fs');
const FormData = require('form-data');
const form = new FormData();
form.append('api_key', 'YOUR_API_KEY_HERE');
form.append('img_base64', fs.readFileSync('captcha.png').toString('base64'));
const res = await fetch('https://clonev6.shopcode.top/api/captcha.php?bank=vcb', {
method: 'POST',
body: form
});
const data = await res.json();
console.log(data.captcha); // "94627"Response thành công:
{
"status": "success",
"captcha": "94627",
"time_ms": 245
}Response lỗi:
{
"status": "error",
"message": "Insufficient balance",
"code": 402
}| Code | Message | Mô tả |
|---|---|---|
| 200 | success | Giải captcha thành công |
| 400 | bad_request | Thiếu tham số api_key hoặc img_base64 |
| 401 | unauthorized | API Key không hợp lệ hoặc bị vô hiệu hóa |
| 402 | insufficient_balance | Số dư tài khoản không đủ |
| 500 | server_error | Lỗi máy chủ, vui lòng thử lại |