Get available contextual tags
GET/tool/contextual_tag/get/Via 360: GET https://partner.quantri360.com/v1/tiktok_business/tool/contextual_tag/get/
Description
Use this endpoint to get the contextual tags that you can target. You need to specify advertiser ID, advertising objective and region codes in your query to get the available tags.
See here to find out how to use contextual targeting.
>Note
Contextual targeting is currently an allowlist-only feature. If you would like to access it, please contact your TikTok representative.
Request
Endpoint
GET https://partner.quantri360.com/v1/tiktok_business/tool/contextual_tag/get/
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 |
|---|---|---|---|---|---|
| objective_type | query | string | Yes | Advertising objective.
Only supports REACH, VIDEO_VIEWS, RF_REACH. | |
| region_codes | query | string[] | No | Country or region codes. | |
| brand_safety_type | query | string | No | Brand safety type.
Default value: STANDARD_INVENTORY.
Enum values:
- EXPANDED_INVENTORY: Use TikTok's brand safety solution. Expanded inventory means that your ads will appear next to content where most inappropriate content has been removed, and may contain some mature themes. In the next API version, EXPANDED_INVENTORY will replace NO_BRAND_SAFETY and will be the default brand safety option.
- STANDARD_INVENTORY: Use TikTok's brand safety solution. Standard inventory means that ads will appear next to content that is appropriate for most brands.
- LIMITED_INVENTORY: Use TikTok's brand safety solution. Limited inventory means that your ads will not appear next to content that contains mature themes.
Note:
- Pre-bid first-party Brand Safety solutions for APP_PROMOTION, WEB_CONVERSIONS, TRAFFIC, LEAD_GENERATION objectives in Auction ads, and pre-bid third-party brand safety solutions are currently allowlist-only features. If you would like to access them, please contact your TikTok representative.
- See Brand safety to learn about the supported advertising objectives for pre-bid Brand Safety filtering. | |
| rf_campaign_type | query | string | No | Campaign type.
Enum values: STANDARD(Reach & Frequency campaign), PULSE(TikTok Pulse campaign).
Note:
- When objective_type is specified as RF_REACH, use this field to set the campaign as a TikTok Pulse campaign, then you can get available premium contextual tags.
- Do not pass in this field when objective_type is not specified as RF_REACH. |
Request examples
curl -s "https://partner.quantri360.com/v1/tiktok_business/tool/contextual_tag/get/?objective_type=" \ -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/tool/contextual_tag/get/",
params={
"objective_type": ""
},
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/tool/contextual_tag/get/');
for (const [k, v] of Object.entries({"objective_type":""})) 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/tool/contextual_tag/get/' . '?' . http_build_query(['objective_type' => '']); $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 response codes and descriptions, see Appendix-Return Code. | |
| message | string | Response message. For details, see Appendix - Return Codes. | |
| request_id | string | The log ID of a request, which uniquely identifies the request. | |
| data | object | Returned data. | |
| contextual_tag_list | object[] | Contextual tag list. Note: Contextual targeting is currently an allowlist-only feature. The returned value will be empty(`[]`) if you don't apply for the allowlisting. | |
| contextual_tag_id | string | Contextual tag ID. Note: Currently contextual tags can only be used together with audience targeting settings that target the following countries: - General tags: `US` (the United States), `CA` (Canada), `GB` (the United Kingdom), `DE` (Germany), `FR` (France), `IT` (Italy) , `ES` (Spain), `JP` (Japan), `KR` (South Korea), `AU` (Australia),`BR` (Brazil), `MX`(Mexico). - Premium tags: `US` (the United States), `CA` (Canada), `GB` (the United Kingdom), `DE` (Germany), `FR` (France), `IT` (Italy) , `ES` (Spain), `JP` (Japan), `KR` (South Korea), `AU` (Australia),`BR` (Brazil), `MX`(Mexico). | |
| name | string | Contextual tag name. | |
| type | string | Contextual tag category. Enum values: `GENERAL` (general category), `PREMIUM`(premium category). | |
| content_lineup_type | string | Content lineup type. Enum values: - `MAX_PULSE`: Max Pulse. Your ads will show next to top content from any topics on TikTok. - `CUSTOM` : Your ads will show next to one of the custom lineups you've previously created. - `CATEGORY`: Category lineups. Your ads will show next to top content from the categories you select. - `SEASONAL`: Seasonal lineups. Your ads will show next to top content from a seasonal event you select. Note: Currently, you can run Max Pulse targeting `AE` (United Arab Emirates), `AU` (Australia), `BR` (Brazil), `CA` (Canada), `DE` (Germany), `ES` (Spain), `FR` (France), `GB` (United Kingdom), `IT` (Italy), `MX` (Mexico), `SA` (Saudi Arabia), `TR` (Turkey), and `US` (United States), and Category Lineups targeting `US`(the United States), `CA`(Canada), `BR`(Brazil), `AU`(Australia), `GB`(the United Kingdom), `FR`(France), `IT`(Italy), `ES`(Spain), `DE`(Germany). Both features are allowlist only. If you want to use them in the above markets, please contact your TikTok representative. | |
| status | string | Contextual tag status. Enum values: `ONLINE`, `OFFLINE`. Only `ONLINE` tags can be used to create ads. | |
| description | string | Contextual tag description. | |
| objective_types | string[] | The advertising objectives that the contextual tag supports. | |
| region_codes | string[] | The country or region codes that the contextual tag supports. |
Response sample
{
"code": 0,
"message": "OK",
"request_id": "{{request_id}}",
"data": {
"contextual_tag_list": [
{
"content_lineup_type": "CATEGORY",
"contextual_tag_id": "{{contextual_tag_id}}",
"description": "{{description}}",
"name": "{{name}}",
"objective_types": [
"RF_REACH"
],
"region_codes": [
"US",
"CA",
"BR",
"MX",
"GB",
"DE",
"FR",
"IT",
"ES",
"AU",
"JP",
"ID",
"TH",
"SA",
"AE",
"TR",
"NL",
"PL",
"SE",
"VN",
"MY",
"PH",
"CO",
"AR",
"ZA",
"EG",
"PE",
"CL"
],
"status": "ONLINE",
"type": "PREMIUM"
},
{
"content_lineup_type": "CATEGORY",
"contextual_tag_id": "{{contextual_tag_id}}",
"description": "{{description}}",
"name": "{{name}}",
"objective_types": [
"RF_REACH"
],
"region_codes": [
"US",
"CA",
"BR",
"GB",
"DE",
"FR",
"IT",
"ES",
"AU"
],
"status": "ONLINE",
"type": "PREMIUM"
}
]
}
}
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