VI | EN
Message us on Messenger
Developer resources

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

v2.principal.get_clip_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_clip_video_performance

POST/api/v2/principal/get_clip_video_performanceVia 360: POST https://partner.quantri360.com/v1/shopee/api/v2/principal/get_clip_video_performance
Description

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

  • 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_clip_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.
video_listbodyobject[]NoBỏ qua hoặc [] để lấy tất cả đối tượng; nếu gửi danh sách thì có 1–100 gian hàng, không trùng và đều phải thuộc principal. Mỗi gian hàng phải có danh sách mã không rỗng; không nhận mã null hoặc mã trùng trong toàn yêu cầu, tổng số mã duy nhất không quá 100.
video_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.
video_list[].video_idsbodyint64[]Yes[10001]Danh sách mã thuộc gian hàng đã chỉ định, 1–100 mã; không trùng trong toàn yêu cầu. Không nhận mã null; tổng mã duy nhất trong toàn yêu cầu không quá 100.
video_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.
page_sizebodyint64No100Số chi tiết mỗi trang, mặc định 100, từ 1 đến 200; chỉ dùng khi danh sách lọc bỏ qua hoặc rỗng.
cursorbodyint64No0Vị trí bắt đầu chi tiết tính từ 0; mặc định 0, không âm; chỉ dùng khi danh sách lọc bỏ qua hoặc rỗng.

Request examples

curl -s -X POST "https://partner.quantri360.com/v1/shopee/api/v2/principal/get_clip_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","video_list":[],"page_size":100,"cursor":0}'
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_clip_video_performance",
    params={},
    json={
        "start_date": "2026-10-01",
        "end_date": "2026-10-07",
        "timezone": "GMT+7",
        "granularity": "customize",
        "video_list": [],
        "page_size": 100,
        "cursor": 0
    },
    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_clip_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","video_list":[],"page_size":100,"cursor":0}),
});
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_clip_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","video_list":[],"page_size":100,"cursor":0}');
$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.
currencystringUSDMã tiền tệ cho các chỉ số tiền; LOCAL hoặc USD.
total_viewsint6410Tổng lượt xem.
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.
video_durationfloat10Thời lượng video, phút.
average_views_durationfloat10Thời gian xem trung bình mỗi video, phút.
likesint6410Tổng lượt nhấn thích.
commentsint6410Tổng bình luận.
shareint6410Tổng lượt chia sẻ.
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.
atc_unitsint6410Số lượt nhấn Thêm vào giỏ của các sản phẩm trong giỏ cam.
units_soldint6410Số đơn vị sản phẩm bán từ các đơn đã đặt.
ordersint6410Số đơn đã đặt, gồm đã và chưa thanh toán, kể cả đơn hủy.
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.
conversion_ratefloat0.1Số đơn video / tổng lượt xem video.
detailsobject[]Chi tiết trong kỳ của từng đối tượng. Theo video; sắp tăng dần shop_id rồi video_id.
regionstringSGMã khu vực.
currencystringUSDMã tiền tệ cho các chỉ số tiền; LOCAL hoặc USD.
shop_idint64100001Mã gian hàng.
shop_namestringGian hàng mẫuTên gian hàng.
video_idint64100001Mã video.
video_namestringVideo mẫuTên video.
total_viewsint6410Tổng lượt xem.
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.
video_durationfloat10Thời lượng video, phút.
average_views_durationfloat10Thời gian xem trung bình mỗi video, phút.
likesint6410Tổng lượt nhấn thích.
commentsint6410Tổng bình luận.
shareint6410Tổng lượt chia sẻ.
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.
atc_unitsint6410Số lượt nhấn Thêm vào giỏ của các sản phẩm trong giỏ cam.
units_soldint6410Số đơn vị sản phẩm bán từ các đơn đã đặt.
ordersint6410Số đơn đã đặt, gồm đã và chưa thanh toán, kể cả đơn hủy.
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.
conversion_ratefloat0.1Số đơn video / tổng lượt xem video.
next_cursorint6410Vị trí bắt đầu trang sau, chỉ trả khi danh sách lọc bỏ qua hoặc rỗng; bằng cursor cộng số chi tiết trả về. Số chi tiết nhỏ hơn page_size có thể là hết trang. Khi vượt cuối kết quả, trả 0 chi tiết và giữ next_cursor bằng cursor đã gửi.

Response sample

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

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