VI
Nhắn Messenger
API TikTok Shop
Dành cho developer

Lấy xếp hạng danh mục bán chạy ACC — API TikTok Shop

tiktok.analytics.202610.acc.preferences.product.categories · gọi qua Quantri360 bằng một API key cho chính tài khoản / tài sản bạn đã kết nối và ủy quyền — 360 lo việc ký request và làm mới phiên đăng nhập bạn đã cấp.

tiktok.analytics.202610.acc.preferences.product.categories

GET/analytics/202610/acc/preferences/product/categoriesGọi qua 360: GET https://partner.quantri360.com/v1/tiktok/analytics/202610/acc/preferences/product/categories
Mô tả API

KHÔNG HỖ TRỢ VIỆT NAM: Lấy xếp hạng doanh số theo danh mục sản phẩm của khán giả, thương hiệu và khoảng ngày đã chọn. Kết quả gồm danh mục cấp 2 kèm danh mục cấp 3; sắp xếp và phân trang áp dụng cho danh mục cấp 2.

Request

Địa chỉ

GET https://partner.quantri360.com/v1/tiktok/analytics/202610/acc/preferences/product/categories

Xác thực & gian hàng

TênVị tríKiểuMẫuMô tả
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.

Tham số request

TênVị tríKiểuBắt buộcMẫuMô tả
brand_idquerystringCó1000001ACC brand ID. Use a brand_id returned by Get ACC Brands (GET /analytics/202610/acc/brands) for the same shop.
industry_idquerystringCó9000001ACC industry ID used with brand_id to determine available data dates. Use the industry_id returned alongside that brand by Get ACC Brands (GET /analytics/202610/acc/brands).
datequerystringKhông2026-09-20Inclusive end date of the data window, in UTC using YYYY-MM-DD format. Defaults to the latest available date when omitted. The entire trend_days window, including its start date, must fall between earliest_available_date and latest_available_date. Use the same date and trend_days as the Product Preference List request that will consume these category IDs.
trend_daysqueryintKhông30Number of days in the data window, including date. Valid values: 7, 14, 30. Default: 30. The start date is date - (trend_days - 1) days.
audience_typequerystringCóCONVERSIONACC audience segment used for the category ranking. Valid values: SHOP_NON_EXPOSED, SHOP_CLICKED_NOT_PURCHASED, CONVERSION, NEW_CONVERSION, REPEAT_CONVERSION, DTC_NEW_CONVERSION, DTC_REPEAT_CONVERSION. Segment definitions: SHOP_NON_EXPOSED means people not exposed to the shop; SHOP_CLICKED_NOT_PURCHASED means people who clicked the shop without purchasing; CONVERSION means people who completed a purchase; NEW_CONVERSION means first-time shop buyers; REPEAT_CONVERSION means repeat shop buyers. DTC_NEW_CONVERSION and DTC_REPEAT_CONVERSION select the corresponding DTC new-conversion and repeat-conversion cohorts. ACC, AWARENESS, CONSIDERATION, and the DRC-prefixed values are not supported by the preference APIs.
scopequerystringKhôngMY_SHOPScope of the category metrics. Valid values: MY_SHOP (shop data), MARKET (market data). Default: MY_SHOP.
keywordquerystringKhôngMakeupFilter categories by a case-insensitive substring of a category ID or category name. The filter is applied before the category tree is built and paginated. Omit this parameter to disable keyword filtering.
sort_fieldquerystringKhôngGMVMetric used to sort the level-2 categories. Valid values: GMV, CUSTOMERS, ORDERS. Default: GMV. Categories with equal values are ordered by category ID in ascending numeric order. Level-3 children are ordered separately by category ID.
sort_orderquerystringKhôngDESCSort direction for level-2 categories. Valid values: ASC (ascending), DESC (descending). Default: DESC.
page_sizequeryintKhông10Maximum number of level-2 categories per page. Allowed values: 10, 20, 50, 100. Default: 10. Level-3 children do not count toward this limit.
page_tokenquerystringKhôngcGFnZV9udW1iZXI9MQ==Pagination token from next_page_token in the previous response. Omit this parameter for the first page. For subsequent pages, pass the returned token unchanged as page_token and keep all other request parameters unchanged.

Ví dụ request

curl -s "https://partner.quantri360.com/v1/tiktok/analytics/202610/acc/preferences/product/categories?brand_id=1000001&industry_id=9000001&date=2026-09-20&trend_days=30&audience_type=CONVERSION&scope=MY_SHOP&keyword=Makeup&sort_field=GMV&sort_order=DESC&page_size=10&page_token=cGFnZV9udW1iZXI9MQ%3D%3D" \
  -H "Authorization: Bearer $KEY"
Python
import requests

KEY = "q360_live_..."  # khóa API của brand
r = requests.get(
    "https://partner.quantri360.com/v1/tiktok/analytics/202610/acc/preferences/product/categories",
    params={
        "brand_id": "1000001",
        "industry_id": "9000001",
        "date": "2026-09-20",
        "trend_days": 30,
        "audience_type": "CONVERSION",
        "scope": "MY_SHOP",
        "keyword": "Makeup",
        "sort_field": "GMV",
        "sort_order": "DESC",
        "page_size": 10,
        "page_token": "cGFnZV9udW1iZXI9MQ=="
    },
    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/tiktok/analytics/202610/acc/preferences/product/categories');
for (const [k, v] of Object.entries({"brand_id":"1000001","industry_id":"9000001","date":"2026-09-20","trend_days":30,"audience_type":"CONVERSION","scope":"MY_SHOP","keyword":"Makeup","sort_field":"GMV","sort_order":"DESC","page_size":10,"page_token":"cGFnZV9udW1iZXI9MQ=="})) url.searchParams.set(k, typeof v === 'object' ? JSON.stringify(v) : String(v));
const r = await fetch(url, {
  method: 'GET',
  headers: { Authorization: `Bearer ${KEY}` },
});
console.log(r.status, await r.json());
PHP
<?php
$key = 'q360_live_...'; // khóa API của brand
$url = 'https://partner.quantri360.com/v1/tiktok/analytics/202610/acc/preferences/product/categories' . '?' . http_build_query(['brand_id' => '1000001', 'industry_id' => '9000001', 'date' => '2026-09-20', 'trend_days' => 30, 'audience_type' => 'CONVERSION', 'scope' => 'MY_SHOP', 'keyword' => 'Makeup', 'sort_field' => 'GMV', 'sort_order' => 'DESC', 'page_size' => 10, 'page_token' => 'cGFnZV9udW1iZXI9MQ==']);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $key]);
$res = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $status, "\n", $res;

Response

Tham số phản hồi (nguyên của TikTok Shop)

TênKiểuMẫuMô tả
codeint0The success or failure status code returned in API response.
messagestringSuccessThe success or failure messages returned in API response. Reasons of failure will be described in the message.
request_idstring202203070749000101890810281E8C70B7Request log
dataobjectSpecific return information
categories[]objectCurrent page of level-2 category rankings, with their level-3 children after scope and keyword filtering. Sorting, page_size and page_token apply to this top-level list.
category_idstring848648ID of the level-2 product category. Pass this ID as l2_category_id when querying PRODUCT in Get ACC Audience Preference List. These product category IDs are not the Market category IDs used for LIVE, VIDEO, or PHOTO.
category_levelint2Product category level. The value is 2 for this node.
category_namestringMakeupName of the level-2 product category.
children[]objectLevel-3 categories under this level-2 category, after scope and keyword filtering, ordered by category ID in ascending numeric order. This list is not paginated.
category_idstring601529ID of the level-3 product category. To query PRODUCT preferences for this node, pass this ID as l3_category_id together with the parent level-2 category_id as l2_category_id.
category_levelint3Product category level. The value is 3 for this node.
category_namestringMakeup SetsName of the level-3 product category.
metricsobjectSales metrics reported for this level-3 category and the selected audience, scope and date window.
customersstring4210Reported customer count for this category and the selected audience, scope and date window.
gmv_rangestring$331,451.00 ~ $331,500.00Formatted gross merchandise value (GMV) range for this category, in the shop's currency. Zero is shown as a formatted zero amount.
ordersstring8566Reported order count for this category and the selected audience, scope and date window.
metricsobjectSales metrics reported for this level-2 category and the selected audience, scope and date window, when available.
customersstring4210Reported customer count for this category and the selected audience, scope and date window.
gmv_rangestring$331,451.00 ~ $331,500.00Formatted gross merchandise value (GMV) range for this category, in the shop's currency. Zero is shown as a formatted zero amount.
ordersstring8566Reported order count for this category and the selected audience, scope and date window.
earliest_available_datestring2026-08-21Earliest available UTC data date for the requested shop, brand and industry, in YYYY-MM-DD format. The start_date must not precede this date.
end_datestring2026-09-20Inclusive end date of the data window used for the ranking, in UTC using YYYY-MM-DD format. It is the requested date, or the latest available date when date is omitted.
latest_available_datestring2026-09-20Latest available UTC data date for the requested shop, brand and industry, in YYYY-MM-DD format. Used as end_date when date is omitted.
next_page_tokenstringcGFnZV9udW1iZXI9MQ==Token for the next page. Pass this value unchanged as page_token in the next request and keep all other request parameters unchanged. An empty string means there are no more pages.
start_datestring2026-08-22Inclusive start date of the data window used for the ranking, in UTC using YYYY-MM-DD format. It is end_date - (trend_days - 1) days.
total_countint1Total number of matching level-2 categories before pagination. Level-3 children are excluded.

Mẫu phản hồi

{"code":0,"data":{"categories":[{"category_id":"848648","category_level":2,"category_name":"Makeup","children":[{"category_id":"601529","category_level":3,"category_name":"Makeup Sets","metrics":{"customers":"4210","gmv_range":"$331,451.00 ~ $331,500.00","orders":"8566"}}],"metrics":{"customers":"4210","gmv_range":"$331,451.00 ~ $331,500.00","orders":"8566"}}],"earliest_available_date":"2026-08-21","end_date":"2026-09-20","latest_available_date":"2026-09-20","next_page_token":"cGFnZV9udW1iZXI9MQ==","start_date":"2026-08-22","total_count":1},"message":"Success","request_id":"202203070749000101890810281E8C70B7"}

Bắt đầu dùng

  1. Đăng ký tài khoản Partner
  2. Mở loại dữ liệu thuộc nhóm Sản phẩm ở trang nền tảng
  3. Tạo API key (tick kênh TikTok Shop)
  4. Gọi theo ví dụ ở trên