Get in-second performance
Use this endpoint to get in-second performance data about ads, or Video Insights data about a video.
To find out about how Video Insights data can be used, see Creative insights-Video insights data.
> Note
> - Generally an ad video's duration is not longer than 60 seconds, and a video normally has the best performance within 60 seconds, so the performance data are provided for the first 60 seconds of a video. If a video is longer than 60 seconds, which may be the case for Pangle videos, all data after the 60th second will be attributed (added on) to the 60th second.
> - All data returned via this endpoint has a latency of one hour.
Request
Endpoint
Authentication & shop
| Name | In | Type | Sample | Description |
|---|---|---|---|---|
| Authorization | header | header | Bearer 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_id | query | string | 7000000000000000001 | Tài sản TikTok Business đã kết nối — "Mã tài sản" ở trang Nền tảng hoặc GET /v1/platforms (tài khoản quảng cáo cho Marketing API, tài khoản TikTok cho Organic / Messaging). Có thể bỏ khi chỉ kết nối một tài sản. |
Request parameters
| Name | In | Type | Required | Sample | Description |
|---|---|---|---|---|---|
| report_type | query | string | No | Report type.
Enum values:
- AD to-be-deprecated: A report that provides in-seconds performance data on ads.
- VIDEO: A Video Insights report on a video. Default value: AD.
Note: The enum value AD will be deprecated in the next API version. We recommend that you use VIDEO instead. | |
| metrics_fields | query | string[] | No | Metrics that you want to get. By default, all metrics supported for the report_type that you specify will be returned. See the Supported metrics section for supported metrics. | |
| filtering | query | object | Yes | Filtering conditions.
- When report_type is set to AD or not passed, you need to specify ad_ids, adgroup_ids, or campaign_ids.
- When report_type is set to VIDEO, you need to specify either material_ids or video_ids. | |
| sort_field | query | string | No | Field to sort by. By default, results will be sorted by CREATE_TIME. | |
| sort_type | query | string | No | Sorting type. Enum values: ASC (starting from the one that was created earliest), DES (starting from the one that was created latest). | |
| page | query | number | No | Page number. Default value: 1. | |
| page_size | query | number | No | Page size. Value range: 1-500. Default value: 10. |
Request examples
curl -s "https://partner.quantri360.com/v1/tiktok_business/report/video_performance/get/?filtering=%7B%7D" \ -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_business/report/video_performance/get/",
params={
"filtering": {}
},
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_business/report/video_performance/get/');
for (const [k, v] of Object.entries({"filtering":{}})) 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_business/report/video_performance/get/' . '?' . http_build_query(['filtering' => '{}']);
$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
Response fields (as returned by TikTok Business)
| Name | Type | Sample | Description |
|---|---|---|---|
| code | number | Response code. For the complete list of error codes and descriptions, see Appendix - Return Codes. | |
| message | string | Response message. For details, see Appendix - Return Codes. | |
| request_id | string | Unique ID of the request. | |
| data | object | Returned data. | |
| list | object | List of results. | |
| info | object | Information about the subject to get benchmark data for. | |
| ad_id | string | Ad ID. | |
| video_id | string | Video ID. | |
| duration | number | Video duration, in seconds. | |
| metrics | object | Metrics and values. | |
| metric_name | number[] | Metric name and the sequential in-seconds values. For instance, `"share_count": [0, 0, 0, 1]` means the ad receives 0 shares in the first two seconds, and one share in the third second. Note the first value is for the 0th second. See the Supported metrics section for the supported metrics. | |
| page_info | object | Pagination information. | |
| page | number | Current page number. | |
| total_page | number | Total number of pages. | |
| page_size | number | Page size. Default: 10. | |
| total_number | number | Total number of results. |
Response sample
HTTPS/1.1 200 OK
{
"code": 0,
"message": "OK",
"request_id": "202112091214160102452460391351BB20",
"data": {
"list": [
{
"info": {
"video_id": "123425gc0000c695b6bc77u1sho1s8g0",
"ad_id": "1234647413898242",
"duration": 18
},
"metrics": {
"slide_count": [
21,
7,
11,
2,
2,
1,
2,
0,
1,
0,
0,
1,
1,
0,
0,
0,
0,
0
],
"share_count": [
0,
0,
1,
0,
0,
0,
0,
0,
1,
0,
0,
0,
1,
0,
0,
0,
0,
0
],
"comment_count": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
"convert_count": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
"click_count": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
"view_count": [
19570,
14410,
6749,
4791,
3707,
2841,
2415,
1985,
1484,
1119,
858,
738,
658,
579,
505,
417,
311,
218
],
"break_count": [
5160,
7661,
1958,
1084,
866,
426,
430,
501,
365,
261,
120,
80,
79,
74,
88,
106,
93,
92
],
"like_count": [
65,
3567,
3981,
972,
413,
173,
140,
80,
86,
58,
26,
25,
14,
16,
14,
7,
14,
9
]
}
}
],
"page_info": {
"page": 1,
"total_page": 1,
"page_size": 10,
"total_number": 1
}
}
}
(/code);
Get started
- Sign up for Partner
- Enable a data type of the Ads (Marketing API) group on the platform page
- Create an API key (tick the TikTok Business channel)
- Call it as in the examples above