VI | EN
Message us on Messenger
Developer resources

Get in-second performance — TikTok Business API

Get in-second 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.

Get in-second performance

GET/report/video_performance/get/Via 360: GET https://partner.quantri360.com/v1/tiktok_business/report/video_performance/get/
Description

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

GET https://partner.quantri360.com/v1/tiktok_business/report/video_performance/get/

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_idquerystring7000000000000000001Tà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

NameInTypeRequiredSampleDescription
report_typequerystringNoReport 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_fieldsquerystring[]NoMetrics 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.
filteringqueryobjectYesFiltering 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_fieldquerystringNoField to sort by. By default, results will be sorted by CREATE_TIME.
sort_typequerystringNoSorting type. Enum values: ASC (starting from the one that was created earliest), DES (starting from the one that was created latest).
pagequerynumberNoPage number. Default value: 1.
page_sizequerynumberNoPage 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)

NameTypeSampleDescription
codenumberResponse code. For the complete list of error codes and descriptions, see Appendix - Return Codes.
messagestringResponse message. For details, see Appendix - Return Codes.
request_idstringUnique ID of the request.
dataobjectReturned data.
listobjectList of results.
infoobjectInformation about the subject to get benchmark data for.
ad_idstringAd ID.
video_idstringVideo ID.
durationnumberVideo duration, in seconds.
metricsobjectMetrics and values.
metric_namenumber[]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_infoobjectPagination information.
pagenumberCurrent page number.
total_pagenumberTotal number of pages.
page_sizenumberPage size. Default: 10.
total_numbernumberTotal 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

  1. Sign up for Partner
  2. Enable a data type of the Ads (Marketing API) group on the platform page
  3. Create an API key (tick the TikTok Business channel)
  4. Call it as in the examples above