Rankd for Developers
Checking API…

Music

Search the catalogue

GET/v1/music/search
No API keyRate-limited

Searches the Apple Music catalogue. Results are grouped by type: one key for each type you asked for that had matches.

Parameters#

Query parameters#

NameTypeDescription
qrequiredstringWhat to search for. At least two characters; only the first 120 are used.
Example: discovery daft punk
typesstring
default album,artist,song
Comma-separated: any of album, artist and song.
Example: album,song
limitinteger
default 10
How many items to return. Default 10, at most 25. Larger values are capped at 25; anything that is not a positive whole number gives the default.

Try it#

Sends a real request to the production API through this site. No credentials are used, so you see exactly what anyone would.

Request#

curl "https://api.rankdmusic.app/v1/music/search?q=discovery%20daft%20punk&types=album%2Csong"

Response#

A successful response is { "data": …, "meta": … }. data is a MusicSearchResults, and meta is a Meta.

FieldTypeDescription
albumarray of MusicSummary
artistarray of MusicSummary
songarray of MusicSummary

Responses#

200Matches, grouped by type.

Captured from production: GET /v1/music/search?q=discovery%20daft%20punk&types=album,song&limit=1

200 response
{
  "data": {
    "song": [
      {
        "provider": "apple_music",
        "type": "song",
        "id": "697195633",
        "title": "Digital Love",
        "artistName": "Daft Punk",
        "artworkUrl": "https://is1-ssl.mzstatic.com/image/thumb/Music221/v4/fd/4a/77/fd4a77db-0ebc-d043-41a2-f32fa1bb0fb4/dj.qrikkdwj.jpg/600x600bb.jpg",
        "artworkTemplate": "https://is1-ssl.mzstatic.com/image/thumb/Music221/v4/fd/4a/77/fd4a77db-0ebc-d043-41a2-f32fa1bb0fb4/dj.qrikkdwj.jpg/{w}x{h}bb.jpg",
        "releaseYear": 2001
      }
    ],
    "album": [
      {
        "provider": "apple_music",
        "type": "album",
        "id": "697194953",
        "title": "Discovery",
        "artistName": "Daft Punk",
        "artworkUrl": "https://is1-ssl.mzstatic.com/image/thumb/Music221/v4/fd/4a/77/fd4a77db-0ebc-d043-41a2-f32fa1bb0fb4/dj.qrikkdwj.jpg/600x600bb.jpg",
        "artworkTemplate": "https://is1-ssl.mzstatic.com/image/thumb/Music221/v4/fd/4a/77/fd4a77db-0ebc-d043-41a2-f32fa1bb0fb4/dj.qrikkdwj.jpg/{w}x{h}bb.jpg",
        "releaseYear": 2001
      }
    ]
  },
  "meta": {
    "apiVersion": 1,
    "migrationPhase": 3,
    "sourceOfTruth": "per_account"
  }
}
400q is shorter than two characters.

Captured from production: GET /v1/music/search?q=a

400 response
{
  "error": {
    "code": "invalid_query",
    "message": "Search for at least two characters."
  }
}
429Too many requests this minute. Wait Retry-After seconds, then try again.

Headers: Retry-After Seconds to wait. Always 60.

429 response
{
  "error": "rate limited"
}
503The catalogue is not configured on this deployment.
503 response
{
  "error": {
    "code": "catalogue_unavailable",
    "message": "The music catalogue is not configured on this deployment."
  }
}
↑ ↓ to move↵ to open/ or ⌘K to search