Layers

GET /v1/tiktok-music

List the trending TikTok music catalog. Pick a track id to pass on schedule / publish.

View as Markdown
GET/v1/tiktok-music
Phase 1stable
Auth
Bearer
Scope
publish:read

Returns the trending TikTok music catalog. Use this to surface a track picker in your UI, then pass the selected id as tiktokMusic.trackId on POST /v1/content/:id/schedule or POST /v1/content/:id/publish.

The catalog is the same one the Layers UI surfaces in its "Background Music" panel — refreshed every 12h by an internal cron (profanity-filtered, deduped, volume-checked) with permanent R2-backed preview/cover URLs.

Manual track selection on mode: "publish" currently degrades to auto. TikTok's photo-publish API requires a Commercial Music Library id, which the trending catalog does not surface — manual and auto produce the same auto_add_music: true payload on direct publish. mode: "managed" targets DO honor the manual track: the publisher receives the resolved tiktokMusicLink and uses it verbatim. See TikTok music on the schedule endpoint.

Response

200Catalog snapshot
{
  "tracks": [
    {
      "id": "8f1d6c3e-4b2a-4a18-9e4f-c2d7a1b0e999",
      "title": "Sunset Drive",
      "author": "Mae & Co",
      "album": "Singles",
      "duration": 28,
      "previewUrl": "https://media.layers.com/music/8f1d6c3e.../preview.mp3",
      "coverUrl": "https://media.layers.com/music/8f1d6c3e.../cover.jpg",
      "language": "en",
      "userCount": 412980,
      "isCommerceMusic": true
    }
  ],
  "total": 1
}
FieldTypeNotes
idstring (UUID)Pass this as tiktokMusic.trackId on schedule / publish.
titlestringTrack title.
authorstringArtist / creator.
albumstringAlbum name (often empty for user-uploaded tracks).
durationnumberSeconds.
previewUrlstring (URL)Permanent R2 preview URL — safe to embed in your UI for in-app playback.
coverUrlstring (URL)Permanent R2 cover URL.
languagestringISO-639-1 code (en, es, …).
userCountnumberTikTok user-count signal — popularity proxy. Sorted descending.
isCommerceMusicbooleanWhether the track sits in TikTok's Commercial Music Library.

Errors

StatusCodeWhen
401UNAUTHENTICATEDMissing or invalid key.
403FORBIDDEN_SCOPEKey lacks publish:read.
500INTERNALCatalog query failed.

See also

On this page