Get details of potential audiences
POST/audience/insight/info/Via 360: POST https://partner.quantri360.com/v1/tiktok_business/audience/insight/info/
Description
Use this endpoint to get the details of your potential audiences.
>Note
This endpoint uses the POST method.
Request
Endpoint
POST https://partner.quantri360.com/v1/tiktok_business/audience/insight/info/
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 |
|---|---|---|---|---|---|
| custom_audience_id | body | string | No | You need pass in either locationsor custom_audience_id in the request.
Custom audience ID.
Note:
- When custom_audience_id is specified, either selected_audience or locations cannot be used. Otherwise, an error will occur.
- The audience ID you input must belong to your specified advertisers. | |
| locations | body | object[] | No | You need pass in either locationsor custom_audience_id in the request.
Locations.
Max size : 5
Note: When locations is specified, custom_audience_id cannot be used. Otherwise, an error will occur. | |
| dimensions | body | string[] | Yes | Use this field to control which API response dimensions are returned.
Enum values: age, gender, country, top_regions, operating_system, operating_system_version, device_price, top_interests, bottom_interests, engagement, ad_interest_categories, and top_hashtags.
Note: Currently, you can input only one dimension for each API call. | |
| selected_audience | body | object | No | The audience you want to filter for. |
Request examples
curl -s -X POST "https://partner.quantri360.com/v1/tiktok_business/audience/insight/info/" \
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" \
-d '{"locations":[{"country_code":""}],"dimensions":[],"selected_audience":{}}'
Python
import requests
KEY = "q360_live_..." # khóa API của brand
r = requests.post(
"https://partner.quantri360.com/v1/tiktok_business/audience/insight/info/",
params={},
json={
"locations": [
{
"country_code": ""
}
],
"dimensions": [],
"selected_audience": {}
},
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/audience/insight/info/');
for (const [k, v] of Object.entries({})) url.searchParams.set(k, typeof v === 'object' ? JSON.stringify(v) : String(v));
const r = await fetch(url, {
method: 'POST',
headers: { Authorization: `Bearer ${KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"locations":[{"country_code":""}],"dimensions":[],"selected_audience":{}}),
});
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/audience/insight/info/' . '?' . http_build_query([]);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $key, 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"locations":[{"country_code":""}],"dimensions":[],"selected_audience":{}}');
$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 | Return code, see Appendix-Return Codes. | |
| message | string | Return message, see Appendix-Return Codes. | |
| request_id | string | The log id of a request, which uniquely identifies the request. | |
| data | object | Returned Data. | |
| age | object | Age. Returned if you have input `age` in `dimensions` in your request. Within `all` and `selected` objects listed below, there are two fields that convey specific information. See the code example below for details. - `label`: Age group label. It is of string data type. - `rate`: Percentage of the label. It is of the number data type. | |
| all | object[] | Age data of all audience, that is, the audience for the selected locations. In certain scenarios, `all` will be returned as null. These include instances when: - When your audience size is less than 1,000. - When you specify `custom_audience_id` in your request | |
| selected | object[] | Age data of the audience you filtered for. | |
| gender | object | Gender. Returned if you have input `gender` in `dimensions` in your request. Within `all` and `selected` objects listed below, there are two fields that convey specific information. - `label`: Gender label. It is of string data type. - `rate`: Percentage of the label. It is of the number data type. | |
| all | object[] | Gender data of all audience, that is, the audience for the selected locations. In certain scenarios, `all` will be returned as null. These include instances when: - When your audience size is less than 1,000. - When you specify `custom_audience_id` in your request. | |
| selected | object[] | Gender data of the audience you filtered for. | |
| country | object | Country. Returned if you have input `country` in `dimensions` in your request. Within `all` and `selected` objects listed below, there are two fields that convey specific information. - `label`: Country name. It is of string data type. - `rate`: Percentage of the country. It is of the number data type. | |
| all | object[] | Country data of all audience, that is, the audience for the selected locations. In certain scenarios, `all` will be returned as null. These include instances when: - When your audience size is less than 1,000. - When you specify `custom_audience_id` in your request. | |
| selected | object[] | Country data of the audience you filtered for. | |
| top_regions | object | Country. Returned if you have input `top_regions` in `dimensions` in your request. Within `all` and `selected` objects listed below, there are several fields that convey specific information. - `label`: Region name. It is of string data type. - `rate`: Percentage of the region. It is of the number data type. - `region_id`: Region ID. It is of string data type. - `country_code`: Country code. It is of string data type. | |
| all | object[] | Region data of all audience, that is, the audience for the selected locations. In certain scenarios, `all` will be returned as null. These include instances when: - When your audience size is less than 1,000. - When you specify `custom_audience_id` in your request. | |
| selected | object[] | Region data of the audience you filtered for. | |
| operating_system | object | Operating system. Returned if you have input `operating_system` in `dimensions` in your request. Within `all` and `selected` objects listed below, there are several fields that convey specific information. - `label`: This field is used to denote the operating system. It is of string data type. - `rate`: This field is utilized to denote the percentage of the operating system. It is of the number data type. | |
| all | object[] | Operating system data of all audience, that is, the audience for the selected locations. In certain scenarios, `all` will be returned as null. These include instances when: - When your audience size is less than 1,000. - When you specify `custom_audience_id` in your request . | |
| selected | object[] | Operating system data of the audience you filtered for. | |
| operating_system_version | object | Operating system version. Returned if you have input `operating_system_version` in `dimensions` in your request. Within `all` and `selected` objects listed below, there are several fields that convey specific information. - `label`: Operating system version. It is of string data type. - `rate`: Percentage of the operating system version. It is of the number data type. | |
| all | object[] | Operating system version data of all audience, that is, the audience for the selected locations. In certain scenarios, `all` will be returned as null. These include instances when: - When your audience size is less than 1,000. - When you specify `custom_audience_id` in your request. | |
| selected | object[] | Operating system version data of the audience you filtered for. | |
| device_price | object | Device price. Returned if you have input `device_price` in `dimensions` in your request. Within `all` and `selected` objects listed below, there are several fields that convey specific information. - `label`: Device price. It is of string data type. - `rate`: Percentage of the device price. It is of the number data type. | |
| all | object[] | Device price data of all audience, that is, the audience for the selected locations. In certain scenarios, `all` will be returned as null. These include instances when: - When your audience size is less than 1,000. - When you specify `custom_audience_id` in your request . | |
| selected | object[] | Device price data of the audience you filtered for. | |
| top_interests | object | Top interests. Returned if you have input `top_interests` in `dimensions` in your request. Within `all` and `selected` objects listed below, there are several fields that convey specific information. - `label`: Interest category label. It is of string data type. - `rate`: Percentage of the interest category label. It is of the number data type. - `ad_interest_category`: This field is used to denote the first-level interest category. It is of string data type. | |
| all | object[] | Interest category data of all audience, that is, the audience for the selected locations. In certain scenarios, `all` will be returned as null. These include instances when: - When your audience size is less than 1,000. - When you specify `custom_audience_id` in your request. | |
| selected | object[] | Interest category data of the audience you filtered for. | |
| bottom_interests | object | Bottom interests. Returned if you have input `bottom_interests` in `dimensions` in your request. Within `all` and `selected` objects listed below, there are several fields that convey specific information. - `label`: Interest category label. It is of string data type. - `rate`: Percentage of the interest category label. It is of the number data type. - `ad_interest_category`: This field is used to denote the first-level interest category. It is of string data type. | |
| all | object[] | Interest category data of all audience, that is, the audience for the selected locations. In certain scenarios, `all` will be returned as null. These include instances when: - When your audience size is less than 1,000. - When you specify `custom_audience_id` in your request. | |
| selected | object[] | Interest category data of the audience you filtered for. | |
| ad_interest_categories | object | Interest categories. Returned if you have input `ad_interest_categories` in `dimensions` in your request. Within `all` and `selected` objects listed below, there are several fields that convey specific information. - `label`: Interest category label. It is of string data type. - `rate`: Percentage of the interest category label. It is of the number data type. - `type`: Level of the interest category. It is of string data type. Example: "first". | |
| all | object[] | Interest category data of all audience, that is, the audience for the selected locations. In certain scenarios, `all` will be returned as null. These include instances when: - When your audience size is less than 1,000. - When you specify `custom_audience_id` in your request . | |
| selected | object[] | Interest category data of the audience you filtered for. | |
| top_hashtags | object | Top hashtags. Returned if you have input `top_hashtags` in `dimensions` in your request. | |
| hashtag_id | string | Hashtag ID. | |
| hashtag_name | string | Hashtag name. | |
| count | number | The number of times the hashtag is used. | |
| engagement | object | Engagement metrics. Returned if you have input `engagement` in `dimensions` in your request. Within `all` and `selected` objects listed below, there are several fields that convey specific information. - `daily_sessions`: Average number of app opens per user per day. It is of the number data type. - `daily_session_duration_in_minutes`: Average number of minutes used per user per day. It is of the number data type. - `daily_video_views`: Average number of video views per user per day. It is of the number data type. - `daily_comments`: Average number of comments per user per day. It is of the number data type. - `daily_likes`: Average number of likes per user per day. It is of the number data type. - `daily_shares`: Average number of shares per user per day. It is of the number data type. - `total_video_uploads`: Average uploads of selected/all users per day. It is of the number data type. | |
| all | object[] | Engagement data of all audience, that is, the audience for the selected locations. In certain scenarios, `all` will be returned as null. These include instances when: - When your audience size is less than 1,000. - When you specify `custom_audience_id` in your request. | |
| selected | object[] | Engagement data of the audience you filtered for. |
Response sample
HTTPS/1.1 200 OK
{
"code": 0,
"message": "OK",
"request_id": "{{request_id}}",
"data": {
"age": {
"all": [
{
"label": "18-24",
"rate": 0.2258
},
{
"label": "25-34",
"rate": 0.3304
},
{
"label": "35-44",
"rate": 0.201
},
{
"label": "45-54",
"rate": 0.1327
},
{
"label": "≥55",
"rate": 0.1102
}
],
"selected": [
{
"label": "25-34",
"rate": 0.5264
},
{
"label": "35-44",
"rate": 0.2073
},
{
"label": "45-54",
"rate": 0.136
},
{
"label": "≥55",
"rate": 0.1302
}
]
}
}
}
(/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