---
title: "Search music for an account"
method: GET
path: "/accounts/{id}/music"
tags: ["Accounts"]
---

# Search music for an account

`GET /accounts/{id}/music`

## Request

- Base URL: `https://api.rizamo.com/v1`
- URL: `https://api.rizamo.com/v1/accounts/{id}/music`
- Auth: HTTP bearer

Tracks the account may put on a post, from its network's library. TikTok: its Commercial Music Library's trending list (up to 100), filtered by genre, country and period; there is no search. The same filters answer the same list for 30 minutes, and searches beyond Rizamo's limits on TikTok answer 429 with when to try again. Instagram (accounts connected through Facebook Login): a search with `q`, or what is trending without it, up to 25, music or original sounds. Facebook adds no music through its API. A filter of the other network is refused. Attach a track's `id` in the target's `music` option.

## Path parameters

- `id` string, required: The account (`acc_`) the post goes to: a TikTok account, or an Instagram account connected through Facebook Login.

## Query parameters

- `q` string: Instagram: words to search for. Left out, Instagram's trending tracks. TikTok has no search.
- `type` 'music' | 'original': Instagram: music (the default) or original sounds from other reels.
- `genre` 'ALL' | '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' | '8_BIT' | 'A_CAPPELLA' | 'AFRO-POP' | 'ALTERNATIVE_HIP_HOP' | 'ALTERNATIVE_ROCK' | 'AMBIENT' | 'ARABIC_POP' | 'BASS_HOUSE' | 'BGM' | 'BOOMBAP' | 'BOSSA_NOVA' | 'BRAZILIAN_FUNK_STYLE' | 'BUDDHIST_MUSIC' | 'CANTOPOP' | 'CELTIC_POP' | 'CHAMBER_MUSIC' | 'CHILL_BEATS' | 'CHILLOUT' | 'CHINESE_FOLK' | 'CHINESE_OPERA' | 'CHINESE_POP' | 'CHINESE_STYLE' | 'CHINOISERIE_ELECTRONIC' | 'CHINOISERIE_RAP' | 'CHRISTIAN_MUSIC' | 'CONTEMPORARY_R&B' | 'COUNTRY_POP' | 'DANCE_POP' | 'DISCO' | 'DJ' | 'DRUM&BASS' | 'DUBSTEP' | 'EDM' | 'EDM_TRAP' | 'ELECTRO_POP' | 'EPIC' | 'FOLK_POP' | 'FUNK' | 'FUTURE_BASS' | 'GOSPEL' | 'GUFENG_MUSIC' | 'HARD_ROCK' | 'HIP_HOUSE' | 'HOLIDAY_MUSIC' | 'HOUSE' | 'INDIAN_POP' | 'INDIE_FOLK' | 'INDIE_POP' | 'INDIE_ROCK' | 'INSTRUMENTAL_HIP_HOP' | 'INSTRUMENTAL_ROCK' | 'IRISH_FOLK' | 'J_ROCK' | 'JAPANESE_TRADITIONAL_MUSIC' | 'JAZZ_FUSION' | 'JAZZ_HIP_HOP' | 'JAZZ_POP' | 'J-POP' | 'K-POP' | 'LATIN_POP' | 'LO-FI' | 'MC' | 'NOISE' | 'OLD_SCHOOL' | 'OTHERS' | 'POP_RAP' | 'POP_ROCK' | 'POP_SOUL' | 'PSYCHEDELIC_ROCK' | 'PUNK' | 'R&B_RAP' | 'REGGAETON' | 'RUSSIAN_POP' | 'SERTANEJO' | 'SON_CUBANO' | 'SOUL' | 'SOUNDTRACK' | 'SYMPHONY' | 'SYNTH_POP' | 'TANGO' | 'TECHNO' | 'TEEN_POP' | 'TRADITIONAL_CHINESE_FOLK' | 'TRANCE' | 'TRAP_RAP' | 'TRIP_HOP' | 'TROPICAL_HOUSE' | 'TURKISH_POP': TikTok: one of TikTok's genres. Default ALL.
- `country` string: TikTok: where the tracks are trending, as a two-letter code such as PT. Default US (TikTok's).
- `period` '1d' | '7d' | '30d' | '90d': TikTok: trending over the last day, week (the default), 30 or 90 days.

## Response `200`

OK

- object
  - `items` MusicTrack[], required
    - `id` string, required: What to attach: `options.tiktok.music.trackId` or `options.instagram.music.audioId`.
    - `title` string, required
    - `artist` string, nullable, required: The artist, or for an original sound the Instagram account it came from (`@name`).
    - `durationMs` integer, nullable, required: How long it is, in milliseconds. On TikTok, the clip Rizamo picked: its trending part where TikTok has one.
    - `previewUrl` string, nullable, required: Where the person can hear it before you attach it: an audio file for music, Instagram's page for an original sound. Null when the network gives none.
    - `coverUrl` string, nullable, required
    - `kind` 'music' | 'original', required: music: a track from the network's library. original: an original sound from another Instagram reel.
    - `expiresAt` string, date-time, nullable, required: When `previewUrl` stops working: Instagram's music links last about a day and a half (a day is given, to be safe). Null when it does not expire.

## Other responses

- `400`: `invalid_request`: A field is missing or wrong, or the request cannot be done as asked: the message names the field or says what to change.
- `401`: `unauthorized`: No API key or sign-in, or the key does not work: it was deleted, or it expired.
- `403`: `forbidden`: The caller may not do this: the key or agent lacks the scope (the message names it), or the action needs another role or a fresh sign-in.
- `404`: `not_found`: No such object, or it is outside your team or the profiles your key reaches.
- `409`: `conflict`: The object's state does not allow it now, such as an account that needs a new login. `queue_empty`: A post with `queue: true` whose profile has no posting times: set them, or give a `scheduledAt`. `queue_full`: No posting time free for the post's accounts in the next 90 days: add times, or give a `scheduledAt`. `idempotency_key_in_use`: A request with this `Idempotency-Key` is still running: try again in a moment.
- `422`: `capability_missing`: The account cannot do this: see its `capabilities`. `idempotency_key_reused`: This `Idempotency-Key` was used for a different request in the last 24 hours: send a new key.
- `429`: `rate_limited`: Over one of Rizamo's limits, or a network asked Rizamo to slow down: wait for `Retry-After` seconds, or as long as the message says.
- `500`: `internal`: Our side failed: retry, and send the `requestId` if it keeps failing.
- `501`: `not_implemented`: The feature is not set up where the call went, such as a local copy of the API.
- `502`: `bad_gateway`: A network did not answer as it should (TikTok's creator info, a music library): try again in a moment.
- `503`: `timeout`: The request took too long to work out, most often a report: try again in a moment, or ask a report for a shorter period or one profile.

---

[API](https://skmtc.dev/rizamo/apis/rizamo-api.md) - [All operations](https://skmtc.dev/rizamo/apis/rizamo-api/llms.txt) - [OpenAPI document](https://skmtc.dev/rizamo/apis/rizamo-api/revisions/31b0c1b1ffb5?raw)
