Shopee Video Check API
REST API để đếm số lượng video affiliate của một sản phẩm Shopee. Hỗ trợ 7 quốc gia (VN, MY, PH, ID, TW, TH, SG).
Base URL:
https://api-video.toolshopee.vnGiới thiệu
API cho phép bạn kiểm tra số lượng video affiliate của bất kỳ sản phẩm Shopee nào.
Đặc điểm
- Xác thực qua API key (header
X-API-Key) - Response luôn là JSON với field
success,message,error - Hỗ trợ single URL & batch (tối đa 50 URLs/request)
- 7 quốc gia: VN, MY, PH, ID, TW, TH, SG
Quốc gia hỗ trợ
| Code | Tên | Domain |
|---|---|---|
vn | Vietnam | shopee.vn |
my | Malaysia | shopee.com.my |
ph | Philippines | shopee.ph |
id | Indonesia | shopee.co.id |
tw | Taiwan | shopee.tw |
th | Thailand | shopee.th |
sg | Singapore | shopee.sg |
Xác thực
Hầu hết endpoint yêu cầu API key. Gửi kèm 1 trong 2 header sau:
X-API-Key: sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# hoặc
Authorization: Bearer sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
| Prefix | Loại | Dùng cho |
|---|---|---|
sk_ | User API key | Gọi các endpoint /api/v1/* |
Định dạng response
Tất cả response đều là JSON với cấu trúc chung:
Success
{
"success": true,
"message": "Kiểm tra thành công",
...data
}
Error
{
"success": false,
"message": "Thiếu trường 'url'",
"error": "Thiếu trường 'url'"
}
Lỗi Shopee (không phải HTTP error — status 200)
{
"success": false,
"cookie_captcha": true, // hoặc sign_error: true
"message": "Cookie đã bị Shopee chặn/captcha. Vui lòng lấy cookie mới!",
"error": "..."
}
Danh sách thông báo (message field)
Toàn bộ message mà API có thể trả về — dùng để hiển thị lên UI hoặc so khớp logic:
Auth
| Badge | Message | Khi nào |
|---|---|---|
| 401 | Thiếu API key. Vui lòng gửi header 'X-API-Key' hoặc 'Authorization: Bearer <key>' | Không gửi kèm key |
| 401 | API key không hợp lệ hoặc đã bị vô hiệu hoá | Key sai hoặc bị disable |
Validation
| Badge | Message | Khi nào |
|---|---|---|
| 400 | Thiếu trường 'url' | Body thiếu url |
| 400 | Thiếu trường 'cookie' | Body thiếu cookie |
| 400 | Trường 'urls' phải là mảng và không rỗng | Batch không hợp lệ |
| 400 | Vượt quá tối đa 50 URLs mỗi batch | Batch > 50 URL |
| 400 | Thiếu trường 'name' | Tạo key không có tên |
Shopee
| Badge | Message | Khi nào |
|---|---|---|
| OK | Kiểm tra thành công | Check 1 URL thành công |
| OK | Batch check hoàn tất | Batch xong không lỗi |
| 200 | URL sản phẩm không hợp lệ hoặc không thuộc quốc gia hỗ trợ | URL sai format |
| 200 | Cookie đã bị Shopee chặn/captcha. Vui lòng lấy cookie mới! | Shopee trả HTTP 418. Response có cookie_captcha: true |
| 200 | Lỗi lấy chữ ký từ Sign server. Liên hệ Admin! | Sign API down. Response có sign_error: true |
Health Check
GET
/health
Public
Kiểm tra service còn sống hay không.
Response
{
"success": true,
"message": "OK",
"status": "healthy",
"service": "Shopee Video Check API",
"version": "1.0.0"
}
Danh sách quốc gia
GET
/api/v1/countries
Public
Trả về 7 quốc gia được hỗ trợ.
{
"success": true,
"message": "Danh sách các quốc gia hỗ trợ",
"countries": [
{"code": "vn", "name": "Vietnam", "domain": "shopee.vn"},
{"code": "sg", "name": "Singapore", "domain": "shopee.sg"},
...
]
}
Kiểm tra 1 URL
POST
/api/v1/check
API Key
Đếm số video affiliate của 1 sản phẩm Shopee.
Request body
{
"url": "https://shopee.sg/product/91542691/22701912059",
"cookie": "csrftoken=...; SPC_F=...; SPC_U=...; ..."
}
Response — thành công
{
"success": true,
"message": "Kiểm tra thành công",
"url": "https://shopee.sg/product/91542691/22701912059",
"shop_id": 91542691,
"item_id": 22701912059,
"country": "sg",
"country_name": "Singapore",
"total_videos": 1,
"sample_videos": [
{
"video_id": "gMTnK_rlCAAjfT5fAAAAAA==",
"video_url": "https://sv.shopee.sg/share-video/gMTnK_rlCAAjfT5fAAAAAA==",
"cover_url": "sg-11110170-6v9b2-...",
"width": 1080,
"height": 1920
}
],
"has_more_pages": false
}
Response — cookie bị chặn (status 200)
{
"success": false,
"cookie_captcha": true,
"message": "Cookie đã bị Shopee chặn/captcha. Vui lòng lấy cookie mới!",
"error": "...",
"url": "..."
}
Kiểm tra nhiều URL (batch)
POST
/api/v1/check/batch
API Key
Chạy đồng thời 3 worker. Tối đa
50 URLs / request.Request body
{
"urls": [
"https://shopee.sg/product/91542691/22701912059",
"https://shopee.vn/product/1096806130/28056936521"
],
"cookie": "csrftoken=...; SPC_F=...; ..."
}
Lưu ý về cookie
Cookie phải phù hợp với quốc gia bạn check. Ví dụ check
shopee.sg thì gửi cookie đăng nhập Shopee Singapore.
Response
{
"success": true,
"message": "Batch check hoàn tất",
"cookie_captcha": false,
"sign_error": false,
"summary": {
"total_urls": 2,
"successful": 2,
"failed": 0,
"total_videos": 15
},
"results": [
{ "success": true, "url": "...", "total_videos": 8, "sample_videos": [...] },
{ "success": true, "url": "...", "total_videos": 7, "sample_videos": [...] }
]
}
Ví dụ — cURL
# Check 1 URL
curl -X POST https://api-video.toolshopee.vn/api/v1/check \
-H "X-API-Key: sk_xxxxx" \
-H "Content-Type: application/json" \
-d '{
"url": "https://shopee.sg/product/91542691/22701912059",
"cookie": "csrftoken=...; SPC_F=...;"
}'
Ví dụ — JavaScript (browser / Node)
const res = await fetch('https://api-video.toolshopee.vn/api/v1/check', {
method: 'POST',
headers: {
'X-API-Key': 'sk_xxxxx',
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: 'https://shopee.sg/product/91542691/22701912059',
cookie: 'csrftoken=...; SPC_F=...;'
})
});
const data = await res.json();
if (data.success) {
console.log(`Có ${data.total_videos} video`);
} else {
alert(data.message); // hiển thị message lên UI
}
Ví dụ — Python
import requests
r = requests.post(
'https://api-video.toolshopee.vn/api/v1/check',
headers={'X-API-Key': 'sk_xxxxx'},
json={
'url': 'https://shopee.sg/product/91542691/22701912059',
'cookie': 'csrftoken=...; SPC_F=...;',
},
timeout=60,
)
data = r.json()
print(data['message'])
if data['success']:
print(f"{data['total_videos']} videos")
Shopee Video Check API v1.0.0 · Code by MLS@2026 · Health