VI | EN
Message us on Messenger
Developer resources

Search for targeting hashtags — TikTok Business API

Search for targeting hashtags · 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.

Search for targeting hashtags

GET/tool/hashtag/recommend/Via 360: GET https://partner.quantri360.com/v1/tiktok_business/tool/hashtag/recommend/
Description

Use this endpoint to search for targeting hashtags based on seed keywords.

The returned hashtag (keyword_id) can be passed on to the action_category_ids field in /adgroup/create/ to target users who watched TikTok videos with the hashtag. You need to set action_scene to HASHTAG_RELATED simultaneously.

> Note

> We recommend that you use the Consolidated Interest and Behavior API (/targeting/search/) to search for or list targeting categories and hashtags for interests and behaviors. This API provides a consolidated and efficient approach to access the necessary targeting information.

Request

Endpoint

GET https://partner.quantri360.com/v1/tiktok_business/tool/hashtag/recommend/

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
keywordsquerystring[]YesKeywords that you want to get recommended hashtags for. If you specify multiple unrelated keywords and set operator to AND, it is possible that no recommended hashtags are returned. Max size: 10.
operatorquerystringNoThe operator to be used between the keywords. Enum values: - AND: Recommended hashtags will be generated based on all the keywords specified in keywords. - OR: Recommended hashtags will be generated separately for each individual keyword in keywords. Default value: AND.

Request examples

curl -s "https://partner.quantri360.com/v1/tiktok_business/tool/hashtag/recommend/?keywords=%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/tool/hashtag/recommend/",
    params={
        "keywords": []
    },
    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/hashtag/recommend/');
for (const [k, v] of Object.entries({"keywords":[]})) 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/hashtag/recommend/' . '?' . http_build_query(['keywords' => '[]']);
$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_idstringThe log ID of a request, which uniquely identifies the request.
dataobjectReturned data.
recommend_keywordsobject[]Recommend hashtags.
input_keywordstringReturned only when `operator` is set to `OR` and more than one keyword is specified in `keywords` in the request. The specific keyword for which the recommended hashtag is generated. For instance, if the hashtag "#gametime" is recommended for the keyword "game", the returned `input_keyword` will be `"game"`, and `keyword` will be `"#gametime"`.
keywordstringRecommended hashtag.
keyword_idstringHashtag keyword ID. It can be passed to the `action_category_ids` field when creating an ad group using /adgroup/create/. You need to set `action_scene` to `HASHTAG_RELATED` simultaneously to target users who watched TikTok videos with the hashtag.
keyword_statusstringKeyword status. Enum values: `ONLINE` (available for use), `OFFLINE` (not available for use).

Response sample

HTTPS/1.1 200 OK
{
    "code": 0,
    "message": "OK",
    "request_id": "1234",
    "data": {
        "recommend_keywords": [
              {
                "keyword": "#gameroom",
                "keyword_id": "3568527772311",
                "keyword_status": "ONLINE"
            },
            {
                "keyword": "#gametime",
                "keyword_id": "3391154394694",
                "keyword_status": "ONLINE"
            }
        ]
    }
}
(/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