VI | EN
Message us on Messenger
Developer resources

Get ad benchmarks — TikTok Business API

Get ad benchmarks · 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 ad benchmarks

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

Use this endpoint to get the performance data of ads against benchmarks.

> Note

All data returned via this endpoint has a latency of 30-48 hours.

Request

Endpoint

GET https://partner.quantri360.com/v1/tiktok_business/report/ad_benchmark/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
compare_time_windowquerystringNoTime window for comparison (in days). Enum: 7 (default), 14, 30, 60
dimensionsquerystring[]YesList of dimensions to compare. 1-4 dimensions are allowed. Enum: LOCATION, AD_CATEGORY, EXTERNAL_ACTION, PLACEMENT
metrics_fieldsquerystring[]NoMetrics that you want to get. By default, all metrics will be returned. See the Supported metrics section for supported metrics.
filteringqueryobjectYesFiltering conditions. You must specify one and only one out of the three conditions allowed
sort_fieldquerystringNoField to sort by. By default, results will be sorted by CREATE_TIME
sort_typequerystringNoSorting type. Enum: ASC (starting from the one that was created earliest), DES (starting from the one that was created latest)
pagequerynumberNoPage number
page_sizequerynumberNoPage size

Request examples

curl -s "https://partner.quantri360.com/v1/tiktok_business/report/ad_benchmark/get/?dimensions=%5B%5D&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/ad_benchmark/get/",
    params={
        "dimensions": [],
        "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/ad_benchmark/get/');
for (const [k, v] of Object.entries({"dimensions":[],"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/ad_benchmark/get/' . '?' . http_build_query(['dimensions' => '[]', '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
compare_datestringDate when the comparison is performed
listobjectList of results. Note: If an ad accumulates fewer than 1,000 impressions within the comparison window (`compare_time_window`), the benchmark metric data will be empty.
infoobjectInformation about the subject to get benchmark data for
ad_idstringAd ID
locationstringTwo-letter country or region code
placementstringPlacement
ad_categorynumberLevel 2 interest category ID. For the list of categories, see Get interest categories. To determine the corresponding names for gaming-related interest category IDs, see Interest category.
external_actionstringExternal action (conversion event) for the ad
metricsobjectMetrics and values
metric_namenumberThe returned metrics, determined by the setting via `metrics_fields` in the request. After the metric name, you can see a number with one decimal place, in the value range of [0.0,1.0]. The number indicates how the current metric of the ad performs compared with other ads in terms of dimensions (`dimensions`) you specify in the request. For instance, `"video_watched_6s": 0.6` means the "video_watched_6s" metric data of the ad outperforms about 60% of all ads in terms of specified dimensions. 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": "2021120912121801024524603910501234",
    "data": {
        "compare_date": "2021-12-05",
        "list": [
            {
                "info": {
                    "placement": "TIKTOK",
                    "ad_id": "1234943678835714",
                    "location": "VN",
                    "ad_category": "0",
                    "external_action": "FORM_BUTTON"
                },
                "metrics": {
                    "video_watched_6s": 0.6,
                    "video_views_p25": 0.4,
                    "click": 0.8,
                    "video_views_p100": 0.4,
                    "average_video_play": 0.2,
                    "video_views_p50": 0.4,
                    "cpm": 0.1,
                    "profile_visits_rate": 0.9,
                    "cost": 0.7,
                    "impression": 0.8,
                    "cpa": 0.8,
                    "video_views_p75": 0.4,
                    "cpv": 0.0,
                    "cpc": 0.1,
                    "cvr": 0.2,
                    "ctr": 0.4,
                    "video_watched_2s": 0.7,
                    "pvr": 0.2,
                    "conversion": 0.6,
                    "video_views": 0.8
                }
            },
            {
                "info": {
                    "ad_id": "1234003068951586"
                }
            }
        ],
        "page_info": {
            "page": 1,
            "total_page": 1,
            "page_size": 10,
            "total_number": 2
        }
    }
}
(/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