VI | EN
Message us on Messenger
Developer resources

Get the music list — TikTok Business API

Get the music list · 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 the music list

GET/file/music/get/Via 360: GET https://partner.quantri360.com/v1/tiktok_business/file/music/get/
Description

Use this endpoint to get the list of available music that can be used for video creation or Carousel Ads creation. The list will contain the music that the advertiser has uploaded as well as the music in the Audio Library (also known as Commercial Music Library). The Audio Library does not update frequently, so we recommend that you cache the music from the Audio Library and update the music monthly.

> Copyright Notice

Due to music copyright restrictions, video creatives made with the music we provide can only be served on TikTok. You shall not download, make available, distribute or perform the video and/or the music file incorporated in the video on any media other than TikTok, unless you have obtained separate permission form the music rights holders. You shall be solely responsible for any third party claims and disputes caused by your breach of these terms, and will defend and indemnify TikTok and its affiliates for all losses sustained.

Comparing v1.2 and v1.3

The following table outlines the differences between v1.2 and v1.3 endpoints.

 |Changes{30%}|v1.2{35%}|v1.3{35%}|
|---|---|---|
|Endpoint path|/v1.2/file/music/get/|/v1.3/file/music/get/|
|Request parameter data type |`advertiser_id`: number|`advertiser_id`: string|
|New request parameters|/|`music_scene`
`search_type`
`keyword`
`image_urls`
`catalog_id`
`catalog_authorized_bc_id`
 `sku_ids`
 `product_set_id`
`item_group_ids`
`carousel_image_index`|
|Response parameter deprecated in v1.3| / | `id`: string |
|New response parameters|/|`author`
`liked`
`cover_url`|

Request

Endpoint

GET https://partner.quantri360.com/v1/tiktok_business/file/music/get/

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
music_scenequerystringNoThe scenario where the piece of music is used. Enum values: - CREATIVE_ASSET: Creative Tools. - CAROUSEL_ADS: Non-Shopping Ads - Carousel format. - CATALOG_CAROUSEL: Shopping Ads (VSA) - Carousel format.Default value: CREATIVE_ASSET.
search_typequerystringNoRequired when music_scene is set to CAROUSEL_ADS or CATALOG_CAROUSEL. Not supported when music_scene is set to CREATIVE_ASSET or not passed. The type of music search that you want to perform. Enum values: - SEARCH_BY_KEYWORD: To fuzzy search for music via keyword. You need to pass in keyword as well. Note that you cannot search for user-uploaded music through this search type. - SEARCH_BY_RECOMMEND: - When music_scene is set to CAROUSEL_ADS: To get recommended music for the images specified via the image URLs. You need to pass in image_urls as well. A maximum of 500 pieces of recommended music can be returned. Note that you cannot search for user-uploaded music through this search type. - When music_scene is set to CATALOG_CAROUSEL: To get recommended music for the specified catalog products. You need to pass in catalog_id and catalog_authorized_bc_id as well. Additionally, you need to choose one of the three settings below. Note that you cannot search for user-uploaded music through this search type. - To get recommended music for all products in a catalog, do not pass any of product_set_id, item_group_ids, and sku_ids. - To get recommended music for products in a product set, pass in either product_set_id or item_group_ids. - To get recommended music for specific products, pass in sku_ids. - SEARCH_BY_LIKED: To search the Liked list for music. A maximum of 1,000 pieces of music in the Liked list can be returned. - SEARCH_BY_HISTORY: To search the History list for music. - SEARCH_BY_MUSIC_ID: To search for music via music IDs. - SEARCH_BY_SOURCE: To search for music by music source. You need to pass in sources as well. Note that you can only filter user-uploaded music for Carousel Ads. Note: When this field is set to SEARCH_BY_RECOMMEND, SEARCH_BY_LIKED or SEARCH_BY_MUSIC_ID, pagination is not supported and the parameters page and page_size will be ignored.
filteringqueryobjectNoFilter condition.
pagequerynumberNoCurrent page number. Default value: 1. Value Range: ≥ 1. The product of page and page_size cannot exceed 100,000. Note: When search_type is set to SEARCH_BY_RECOMMEND, SEARCH_BY_LIKED, or SEARCH_BY_MUSIC_ID, pagination is not supported and the parameters page and page_size will be ignored.
page_sizequerynumberNoPage size. Default value: 1,000. Value Range: 1-1,000. The product of page and page_size cannot exceed 100,000. Note: - When search_type is set to SEARCH_BY_RECOMMEND, SEARCH_BY_LIKED, or SEARCH_BY_MUSIC_ID, pagination is not supported and the parameters page and page_size will be ignored. - When search_type is set to SEARCH_BY_KEYWORD or SEARCH_BY_HISTORY, the default value is 200 and the value range is [1,200].

Request examples

curl -s "https://partner.quantri360.com/v1/tiktok_business/file/music/get/" \
  -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/music/get/",
    params={},
    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/music/get/');
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: '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/music/get/' . '?' . http_build_query([]);
$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.
musicslistMusic data.
music_idstringMusic ID.
material_idstringMaterial ID.
sourcesstring[]Music source. `USER` means the adveritser's uploaded music, and `SYSTEM` means the system music.
authorstringReturned only for music that can be used in Carousel Ads. Author of the piece of music.
likedbooleanReturned only for music that can be used in Carousel Ads. Whether the piece of music is added to the Liked list.
cover_urlstringReturned only for music that can be used in Carousel Ads. URL of the cover for the piece of music.
urlstringMusic link. Effective duration: 12h.
durationfloatVideo Duration (Seconds). Only returned for system music.
stylestringMusic style. Only returned for system music.
signaturestringMusic file MD5.
namestringMusic Name.
file_namestringFile Name.
copyrightstringCopyright information. Enum values: - `MUSIC_FORBID_VIDEO_ALLOW`: Music is not allowed to download, but the generated video is allowed to download. - `MUSIC_FORBID_VIDEO_FORBID`: Both music and the generated video are not allowed to download.
create_timestringCreation time. Only returned for advertiser's music. UTC Time. Format: 2020-06-10 T07: 39: 14Z.
modify_timestringModified time. Only returned for advertiser's music. Custom Soundtracks return this field, system music does not return this field. UTC Time. Format: 2020-06-10 T07: 39: 14Z.
page_infoobjectPagination information.
pagenumberCurrent page number.
page_sizenumberPage size.
total_numbernumberTotal number of results.
total_pagenumberTotal pages of results.
request_idstringThe log id of a request, which uniquely identifies the request.

Response sample

HTTPS/1.1 200 OK
{
    "message": "OK",
    "code": 0,
    "data": {
        "page_info": {
            "total_number": 1,
            "page": 1,
            "page_size": 1000,
            "total_page": 1
        },
        "musics": [
            {
                "style": "Teen",
                "name": "Her World",
                "copyright": "MUSIC_FORBID_VIDEO_ALLOW",
                "url": "http://sf-tk-sg.ibytedtos.com/obj/cc-music-sg/6650280667860962050",
                "file_name": "Her World",
                "music_id": "6707429901383565318",
                "material_id": "6707429901383565318",
                "sources": [
                    "SYSTEM"
                ],
                "signature": "bdb2ff10fb44bb38151c98bfee94de89",
                "duration": 127.5,
            }
        ]
    },
    "request_id": "2020120606494801011517615607983119"
}

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