REST · JSON · CORS · UTF-8 · v1.1.0
Header X-API-Key: dhm_xxx hoặc query ?key=dhm_xxx. Lấy key tại Dashboard.
Tìm sản phẩm Shopee theo từ khóa. Tham số: q (bắt buộc), shop (tuỳ chọn — link shop Shopee để tìm trong 1 shop), limit (1–60, mặc định 20), page. Trường source = live (dữ liệu trực tiếp) hoặc cache (dữ liệu lưu gần nhất khi Shopee giới hạn).
GET https://shopee.duchuymedia.com/api/v1/search?q=op%20lung&limit=1
{
"ok": true, "source": "live", "q": "op lung", "page": 1, "count": 1,
"quota": { "used": 15, "limit": 1000, "remaining": 985 },
"items": [
{ "title": "Ốp lưng iPhone 16 Pro Max trong suốt", "price": 39000, "compare_price": 79000,
"sold": 1520, "hist_sold": 25800, "stock_n": 3400, "rating": 4.9, "rating_count": 9120,
"liked": 2100, "location": "TP. Hồ Chí Minh", "variations": "Màu: Trong/Đen",
"url": "https://shopee.vn/product/123/456", "image": "https://down-vn.img.susercontent.com/file/...",
"item_id": "456", "shop_id": "123" }
]
}Lấy danh sách sản phẩm + thông tin của 1 shop Shopee (tên, người theo dõi, đánh giá). Tham số: url (link shop hoặc link sản phẩm), limit (1–60), page.
Xem gói, quota, số request đã dùng hôm nay.
401 sai key · 402 gói hết hạn · 429 vượt quota ngày · 400 thiếu tham số.
const r = await fetch("https://shopee.duchuymedia.com/api/v1/search?q=" + encodeURIComponent("tai nghe"), {
headers: { "X-API-Key": "dhm_xxx" }
});
const data = await r.json();
console.log(data.items);$ch = curl_init("https://shopee.duchuymedia.com/api/v1/search?q=" . urlencode("laptop"));
curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ["X-API-Key: dhm_xxx"]]);
$data = json_decode(curl_exec($ch), true);