VI | EN
Message us on Messenger
Developer resources

Get info about videos — TikTok Business API

Get info about videos · 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 info about videos

GET/file/video/ad/info/Via 360: GET https://partner.quantri360.com/v1/tiktok_business/file/video/ad/info/
Description

Use this endpoint to get the information about a list of videos that can be used in ads from the Asset Library.

Request

Endpoint

GET https://partner.quantri360.com/v1/tiktok_business/file/video/ad/info/

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
video_idsquerystring[]YesVideo ID list. Max size: 60. Note: If the video cannot be used in ads, the video ID will be ignored.

Request examples

curl -s "https://partner.quantri360.com/v1/tiktok_business/file/video/ad/info/?video_ids=%5B%5D" \
  -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/file/video/ad/info/",
    params={
        "video_ids": []
    },
    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/file/video/ad/info/');
for (const [k, v] of Object.entries({"video_ids":[]})) 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/file/video/ad/info/' . '?' . http_build_query(['video_ids' => '[]']);
$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
codenumberReturn code, see Appendix-Return code.
messagestringReturn Message, see Appendix-Return Information.
dataobjectReturned data.
listlistVideo data.
displayablebooleanWhether it can be displayed on the platform.
widthnumberVideo width.
video_cover_urlstringTemporary URL for video cover, valid for six hours and needs to be re-acquired after expiration. The expiration time is included in the URL after the `x-expires` parameter, in the format of an Epoch/Unix timestamp in seconds. Example: `
bit_ratenumberBit rate in bps.
formatstringVideo format.
preview_urlstringVideo preview link, valid for six hours and needs to be re-acquired after expiration. To find out the expiration time of the preview link, see `preview_url_expire_time`.
preview_url_expire_timestringThe expiration time of the video preview link, in the format of `YYYY-MM-DD HH:MM:SS` (UTC+0).
durationfloatVideo duration, in seconds.
heightnumberVideo height.
signaturestringVideo file MD5.
video_idstringVideo ID, can be used to create ad in ad delivery.
sizenumberVideo size in bytes.
material_idstringMaterial ID
allowed_placementsstring[]Available placements. Due to the music copyright, some materials generated by creative tools can only be shown on TikTok. It won't pass when they are created on other placements. For enum values, see Enumerations-Ad Management-Placement.
allow_downloadbooleanWhether the video is downloadable. Due to the music copyright, some materials generated by creative tools are only allowed to preview. It is prohibited to download and disseminate them.
file_namestringVideo name.
create_timestringCreation time. UTC time. Format: 2020-06-10T07:39:14Z.
modify_timestringModification time. UTC time. Format: 2020-06-10T07:39:14Z.
request_idstringThe log id of a request, which uniquely identifies the request.

Response sample

HTTPS/1.1 200 OK
{
    "message": "OK",
    "code": 0,
    "data": {
        "list": [
            {
                "format": "mp4",
                "preview_url": "http://v16-tiktokcdn-com.akamaized.net/2a19f67683ed9aa54b3df2e5c842f15d/5fccd703/video/tos/alisg/tos-alisg-v-0000/9a0033884eab42248ad6b46f7b11e44c/?a=0&br=3114&bt=1557&cd=0%7C0%7C0&cr=0&cs=0&dr=0&ds=3&er=&l=2020120607050201011517615618A693BE&lr=ad&mime_type=video_mp4&qs=0&rc=anNlbnRuOWU2eDMzZjYzM0Apdjh3ZHJuOWZzZTMzNDY6eWdwMnFebGgzYG1fLS0uMDRzc2RtX2huaDNfMHItLWAwLS06Yw%3D%3D&vl=&vr=",
                "file_name": "wanfadong_tagging_test.mp4",
                "video_cover_url": "http://p16-sign-sg.tiktokcdn.com/v0201/94ebe1a3e6734559a16f3e81c43787ec~tplv-noop.image?x-expires=1607259907&x-signature=Oy4%2FyYvkw%2FLTWz97pFCDx0Y6o4g%3D",
                "height": 720,
                "width": 1280,
                "bit_rate": 1594584,
                "create_time": "2020-11-16T08:19:57Z",
                "modify_time": "2020-11-16T08:19:57Z",
                "signature": "b24f08f569b73a33eec93edb8f4423e2",
                "duration": 5.312,
                "video_id": "v070331c0000bup3cb66kkoqaktb5psg",
				"material_id": "6895633277416374000",
            	"allowed_placements": [
                    "PLACEMENT_TOPBUZZ",
                    "PLACEMENT_TIKTOK",
                    "PLACEMENT_HELO",
                    "PLACEMENT_PANGLE"
            	],
            	"allow_download": true,
                "size": 1058804
            }
        ]
    },
    "request_id": "2020120607050201011517615618A693BE"
}
(/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