VI | EN
Message us on Messenger
Developer resources

Queries video performance data for the specified shops within the selected time range — Shopee API

v2.principal.get_shop_video_performance · call it through Quantri360 with one API key for your own accounts / assets that you connected and authorized — 360 handles request signing and refreshing the authorization you granted.

v2.principal.get_shop_video_performance

POST/api/v2/principal/get_shop_video_performanceVia 360: POST https://partner.quantri360.com/v1/shopee/api/v2/principal/get_shop_video_performance
Description

CẤP PRINCIPAL: Tra cứu hiệu quả video, trả tổng hợp và chi tiết theo gian hàng.

  • HIỆN CHƯA GỌI ĐƯỢC QUA 360: đây là API cấp principal, 360 hiện ký theo gian hàng nên Shopee trả error_param "There is no principal_id in query.". Cần dùng API này → liên hệ 360.
  • Áp dụng: tài khoản principal (chủ thể quản lý nhiều gian hàng).
  • API chỉ đọc; error rỗng mới là thành công.
  • Khoảng ngày và biên kỳ kiểm theo timezone; xem start_date, end_date, granularity.
  • unique_viewers và total_unique_buyers không có với customize, month, quarter, year hoặc tuần không đủ cả tuần.

Request

Endpoint

POST https://partner.quantri360.com/v1/shopee/api/v2/principal/get_shop_video_performance

Authentication & shop

NameInTypeSampleDescription
AuthorizationheaderheaderBearer q360_live_ab12cd34_…Khóa API của brand (tạo ở mục API key). Bắt buộc với mọi request. Brand suy từ key — không truyền mã brand.
platform_shop_idquerystring100001Gian hàng (lấy ở GET /v1/platforms → shops[].platform_shop_id). BẮT BUỘC khi brand có > 1 gian hàng trên nền tảng; 360 bỏ tham số này trước khi chuyển tiếp.

Request parameters

NameInTypeRequiredSampleDescription
start_datebodystringYes2026-10-01Ngày bắt đầu hợp lệ YYYY-MM-DD, không sau end_date; tính theo timezone. Mốc sớm nhất = ngày hiện tại theo timezone − 1 ngày − 2 năm. customize không được trước mốc này; day cùng ngày với end_date; week bắt đầu Chủ nhật; month ngày đầu tháng; quarter ngày đầu quý; year ngày đầu năm.
end_datebodystringYes2026-10-07Ngày kết thúc hợp lệ YYYY-MM-DD, không trước start_date. customize: không sau hôm qua theo timezone, tối đa 366 ngày tính cả hai đầu. day: bằng start_date. week: từ start_date đến min(start_date + 6 ngày, hôm qua). month/quarter/year: trong tháng/quý/năm đã chọn, không quá min(ngày cuối kỳ, hôm qua).
timezonebodystringYesGMT+7Múi giờ tính biên ngày, kiểm khoảng ngày và chuyển đổi dấu thời gian; chỉ GMT+7, GMT+8, GMT-3. Mọi kiểm tra ngày dùng múi giờ này.
granularitybodystringYescustomizeĐộ chi tiết: customize, day, week, month, quarter, year. customize là khoảng ngày tùy chọn. day là một ngày; week theo tuần bắt đầu Chủ nhật; month/quarter/year theo tháng/quý/năm lịch. Giá trị khác bị từ chối với invalid_parameter.
shop_listbodyobject[]NoBỏ qua hoặc [] lấy tất cả gian hàng thuộc principal; tối đa 50 gian hàng, không trùng và đều phải thuộc principal.
shop_list[].shop_idbodyint64Yes100001Mã gian hàng; bắt buộc trong mỗi phần tử khi gửi danh sách không rỗng, phải thuộc principal.
shop_list[].currencybodystringNoUSDTiền tệ LOCAL hoặc USD; bỏ qua mặc định USD, giá trị khác bị từ chối với invalid_parameter.

Request examples

curl -s -X POST "https://partner.quantri360.com/v1/shopee/api/v2/principal/get_shop_video_performance" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"start_date":"2026-10-01","end_date":"2026-10-07","timezone":"GMT+7","granularity":"customize","shop_list":[]}'
Python
import requests

KEY = "q360_live_..."  # khóa API của brand
r = requests.post(
    "https://partner.quantri360.com/v1/shopee/api/v2/principal/get_shop_video_performance",
    params={},
    json={
        "start_date": "2026-10-01",
        "end_date": "2026-10-07",
        "timezone": "GMT+7",
        "granularity": "customize",
        "shop_list": []
    },
    headers={"Authorization": f"Bearer {KEY}"},
    timeout=60,
)
print(r.status_code)
print(r.json())
Node.js
const KEY = 'q360_live_...'; // khóa API của brand
const url = new URL('https://partner.quantri360.com/v1/shopee/api/v2/principal/get_shop_video_performance');
for (const [k, v] of Object.entries({})) url.searchParams.set(k, typeof v === 'object' ? JSON.stringify(v) : String(v));
const r = await fetch(url, {
  method: 'POST',
  headers: { Authorization: `Bearer ${KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({"start_date":"2026-10-01","end_date":"2026-10-07","timezone":"GMT+7","granularity":"customize","shop_list":[]}),
});
console.log(r.status, await r.json());
PHP
<?php
$key = 'q360_live_...'; // khóa API của brand
$url = 'https://partner.quantri360.com/v1/shopee/api/v2/principal/get_shop_video_performance' . '?' . http_build_query([]);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $key, 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"start_date":"2026-10-01","end_date":"2026-10-07","timezone":"GMT+7","granularity":"customize","shop_list":[]}');
$res = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $status, "\n", $res;

Response

Response fields (as returned by Shopee)

Mẫu thành công chỉ dùng số liệu minh họa; kiểm error/message trước khi đọc response. response.summary và response.details là mảng.

NameTypeSampleDescription
request_idstringd52ca43b277a4f9292fb8be658bfd33dMã request của Shopee để tra lỗi.
errorstringMã lỗi Shopee; rỗng = thành công.
messagestringMô tả lỗi.
responseobjectKết quả nghiệp vụ.
summaryobject[]Tổng hợp trong kỳ của các đối tượng đã chọn. Tiền tệ USD khi có dữ liệu.
currencystringUSDMã tiền tệ cho các chỉ số tiền; LOCAL hoặc USD.
ordersint6410Số đơn đã đặt, gồm đã và chưa thanh toán, kể cả đơn hủy.
likesint6410Tổng lượt nhấn thích.
commentsint6410Tổng bình luận.
shareint6410Tổng lượt chia sẻ.
salesfloat10Giá trị đơn đã đặt, đã và chưa thanh toán, sau khoản giảm giá người bán chịu; gồm đơn hủy và trả hàng/hoàn tiền.
units_soldint6410Số đơn vị sản phẩm bán từ các đơn đã đặt.
effective_viewsint6410Lượt xem video kéo dài hơn 3 giây.
unique_viewersint6410Số người xem duy nhất. Không có khi chọn customize, month, quarter, year hoặc tuần không đủ cả tuần.
total_video_durationfloat10Tổng thời lượng video, phút; chỉ có ở summary.
atc_unitsint6410Số lượt nhấn Thêm vào giỏ của các sản phẩm trong giỏ cam.
average_video_durationfloat10Thời lượng video trung bình, phút.
average_views_durationfloat10Thời gian xem trung bình mỗi video, phút.
total_unique_buyersint6410Số người mua duy nhất đặt đơn từ video. Không có khi chọn customize, month, quarter, year hoặc tuần không đủ cả tuần.
conversion_ratefloat0.1Số đơn video / lượt xem video hiệu quả.
detailsobject[]Chi tiết trong kỳ của từng đối tượng. Theo gian hàng.
regionstringSGMã khu vực.
currencystringUSDMã tiền tệ cho các chỉ số tiền; LOCAL hoặc USD.
ordersint6410Số đơn đã đặt, gồm đã và chưa thanh toán, kể cả đơn hủy.
likesint6410Tổng lượt nhấn thích.
commentsint6410Tổng bình luận.
shareint6410Tổng lượt chia sẻ.
shop_idint64100001Mã gian hàng.
shop_namestringGian hàng mẫuTên gian hàng.
salesfloat10Giá trị đơn đã đặt, đã và chưa thanh toán, sau khoản giảm giá người bán chịu; gồm đơn hủy và trả hàng/hoàn tiền.
units_soldint6410Số đơn vị sản phẩm bán từ các đơn đã đặt.
effective_viewsint6410Lượt xem video kéo dài hơn 3 giây.
unique_viewersint6410Số người xem duy nhất. Không có khi chọn customize, month, quarter, year hoặc tuần không đủ cả tuần.
atc_unitsint6410Số lượt nhấn Thêm vào giỏ của các sản phẩm trong giỏ cam.
average_video_durationfloat10Thời lượng video trung bình, phút.
average_views_durationfloat10Thời gian xem trung bình mỗi video, phút.
total_unique_buyersint6410Số người mua duy nhất đặt đơn từ video. Không có khi chọn customize, month, quarter, year hoặc tuần không đủ cả tuần.
conversion_ratefloat0.1Số đơn video / lượt xem video hiệu quả.

Response sample

{
  "request_id": "demo-request",
  "error": "",
  "message": "",
  "response": {
    "summary": [
      {
        "currency": "USD",
        "orders": 10,
        "likes": 10,
        "comments": 10,
        "share": 10,
        "sales": 10,
        "units_sold": 10,
        "effective_views": 10,
        "unique_viewers": 10,
        "total_video_duration": 10,
        "atc_units": 10,
        "average_video_duration": 10,
        "average_views_duration": 10,
        "total_unique_buyers": 10,
        "conversion_rate": 0.1
      }
    ],
    "details": [
      {
        "region": "SG",
        "currency": "USD",
        "orders": 10,
        "likes": 10,
        "comments": 10,
        "share": 10,
        "shop_id": 100001,
        "shop_name": "Gian hàng mẫu",
        "sales": 10,
        "units_sold": 10,
        "effective_views": 10,
        "unique_viewers": 10,
        "atc_units": 10,
        "average_video_duration": 10,
        "average_views_duration": 10,
        "total_unique_buyers": 10,
        "conversion_rate": 0.1
      }
    ]
  }
}

Shopee error codes (5)

Show
CodeMeaning
error_paramTham số sai / thiếu / sai kiểu — xem `message` để biết tham số nào.
error_permissionGian hàng không có quyền xem dữ liệu này (vd yêu cầu trả / đơn không thuộc gian hàng).
error_authỦy quyền gian hàng cho 360 đã hết hạn hoặc bị thu hồi (360 đã tự làm mới token một lần) — chủ gian hàng kết nối lại Shopee trong Partner.
error_limitChạm hạn mức gọi Shopee trong ngày của kết nối — 360 trả kèm thời điểm thử lại; giảm tần suất gọi.
error_rate_limitGọi quá nhanh — chờ vài giây rồi gọi lại (360 cũng giới hạn theo key: 429 + Retry-After).

Get started

  1. Sign up for Partner
  2. Enable a data type of the Sản phẩm group on the platform page
  3. Create an API key (tick the Shopee channel)
  4. Call it as in the examples above