Skip to main content

Get TikTok Trending Music

Returns trending tracks from TikTok's Commercial Music Library (CML) — the catalogue of songs cleared for commercial use. The id of a track is what you pass as tiktok_music_id when uploading a video.

Looking for a specific song?

TikTok has no music search endpoint — this one only returns trending charts. To find a track by name or artist, use Search TikTok Music, which searches the charts Upload-Post caches on your behalf.

  • Method: GET
  • Endpoint: /api/uploadposts/tiktok/music/trending
  • Authentication:
    • API Key in the Authorization header.
      • Authorization: Apikey <YOUR_API_KEY>

Query Parameters

ParameterTypeRequiredDescriptionDefault
profilestringYesThe profile's username. Must have a TikTok account connected.-
genrestringNoFilter by genre. Accepts ALL plus TikTok's genre enum, verbatim (slashes and ampersands included): ROCK, POP, LATIN, METAL, ELECTRONIC, HIP_HOP/RAP, ALTERNATIVE/INDIE, FOLK, R&B/SOUL, COUNTRY, CLASSICAL, JAZZ, REGGAE, CHILDHOOD, BLUES, EASY_LISTENING, NEW_AGE, WORLD_MUSIC, EXPERIMENTAL, DEVOTIONAL, CHINESE_TRADITION. TikTok's sub-genres (8_BIT, BOSSA_NOVA, CONTEMPORARY_R&B, …) are passed through untouched. A value that cannot be an enum at all falls back to ALL.ALL
country_codestringNoISO 3166-1 alpha-2 country code used to rank the tracks (e.g. US, ES, GB).US
date_rangestringNoRanking window: 1DAY, 7DAY, 30DAY, 90DAY.7DAY

Example Request

curl -G 'https://api.upload-post.com/api/uploadposts/tiktok/music/trending' \
-H 'Authorization: Apikey your-api-key-here' \
-d 'profile=your_profile' \
-d 'genre=POP' \
-d 'country_code=ES' \
-d 'date_range=7DAY'

Successful Response (200 OK)

{
"success": true,
"genre": "POP",
"country_code": "ES",
"date_range": "7DAY",
"tracks": [
{
"id": "7012345678901234567",
"commercial_music_id": "6987654321098765432",
"title": "Neon Skyline",
"artist": "Wave Theory",
"duration": 178,
"rank": 1,
"genres": ["POP", "ELECTRONIC"],
"cover_url": "https://p16-sign.tiktokcdn.com/....jpeg",
"preview_url": "https://sf16-cml.tiktokcdn.com/....mp3"
},
{
"id": "7012345678901234568",
"commercial_music_id": "6987654321098765433",
"title": "Slow Coast",
"artist": "Marina Vela",
"duration": 142,
"rank": 2,
"genres": ["POP"],
"cover_url": "https://p16-sign.tiktokcdn.com/....jpeg",
"preview_url": "https://sf16-cml.tiktokcdn.com/....mp3"
}
]
}
FieldDescription
idThe value to pass as tiktok_music_id on the upload request.
commercial_music_idTikTok's catalogue id for the same track. Returned for reference only — publishing with it is rejected on public posts, always send id.
title / artistTrack name and performer.
durationTrack length in seconds.
rankPosition in the trending list for the requested genre / country_code / date_range.
genresGenres TikTok assigns to the track.
cover_urlArtwork image, useful to render a picker in your own UI.
preview_urlAudio preview, for letting users listen before choosing.

Error Responses

  • 400 Bad Requestprofile was not sent.
{ "success": false, "message": "profile is required" }
  • 404 Not Found — no profile with that username exists under your API key.
{
"success": false,
"message": "Profile 'your_profile' not found.",
"error_code": "PROFILE_NOT_FOUND"
}
  • 400 Bad Request — the profile's TikTok connection does not support this endpoint (it lacks the music capability). Reconnect the account.
{
"success": false,
"message": "Profile 'your_profile' has no TikTok connection that supports this endpoint. Reconnect your TikTok account from Manage Users.",
"error_code": "tiktok_reconnect_required"
}
  • 409 Conflict — the TikTok token expired and the account must be reconnected ("reauth_required": true).
  • 502 Bad Gateway — TikTok rejected the query (for example an unknown genre). The upstream message is returned verbatim in message.

Invalid genre / date_range values are not a 400: unknown date_range values fall back to 7DAY, and a genre that cannot be an enum falls back to ALL.

Using a track on an upload

curl -X POST https://api.upload-post.com/api/upload \
-H 'Authorization: Apikey your-api-key-here' \
-F 'user=your_profile' \
-F 'platform[]=tiktok' \
-F 'title=Golden hour 🌇' \
-F 'video=@/path/to/video.mp4' \
-F 'tiktok_music_id=7012345678901234567' \
-F 'tiktok_music_volume=70' \
-F 'tiktok_music_start=15000' \
-F 'tiktok_music_end=45000' \
-F 'tiktok_original_sound_volume=30'

See the full field reference in Upload Video → TikTok.

Additional Notes

  • Volumes are independent: tiktok_music_volume controls the attached track and tiktok_original_sound_volume controls the audio embedded in your video. If you add music without setting the original volume, Upload-Post sends 50 so your own audio is not muted.
  • tiktok_music_start / tiktok_music_end are offsets in milliseconds inside the track, used to pick which section plays.
  • On photo posts only tiktok_music_id is honoured; the volume and trim fields are video-only. To let TikTok choose a track instead, use auto_add_music.