VI | EN
Message us on Messenger
Developer resources

Get details of potential audiences — TikTok Business API

Get details of potential audiences · 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 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

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
custom_audience_idbodystringNoYou 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.
locationsbodyobject[]NoYou 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.
dimensionsbodystring[]YesUse 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_audiencebodyobjectNoThe 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)

NameTypeSampleDescription
codenumberReturn code, see Appendix-Return Codes.
messagestringReturn message, see Appendix-Return Codes.
request_idstringThe log id of a request, which uniquely identifies the request.
dataobjectReturned Data.
ageobjectAge. 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.
allobject[]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
selectedobject[]Age data of the audience you filtered for.
genderobjectGender. 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.
allobject[]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.
selectedobject[]Gender data of the audience you filtered for.
countryobjectCountry. 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.
allobject[]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.
selectedobject[]Country data of the audience you filtered for.
top_regionsobjectCountry. 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.
allobject[]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.
selectedobject[]Region data of the audience you filtered for.
operating_systemobjectOperating 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.
allobject[]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 .
selectedobject[]Operating system data of the audience you filtered for.
operating_system_versionobjectOperating 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.
allobject[]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.
selectedobject[]Operating system version data of the audience you filtered for.
device_priceobjectDevice 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.
allobject[]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 .
selectedobject[]Device price data of the audience you filtered for.
top_interestsobjectTop 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.
allobject[]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.
selectedobject[]Interest category data of the audience you filtered for.
bottom_interestsobjectBottom 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.
allobject[]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.
selectedobject[]Interest category data of the audience you filtered for.
ad_interest_categoriesobjectInterest 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".
allobject[]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 .
selectedobject[]Interest category data of the audience you filtered for.
top_hashtagsobjectTop hashtags. Returned if you have input `top_hashtags` in `dimensions` in your request.
hashtag_idstringHashtag ID.
hashtag_namestringHashtag name.
countnumberThe number of times the hashtag is used.
engagementobjectEngagement 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.
allobject[]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.
selectedobject[]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

  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