Lookup
You can retrieve a single track from the collection of tracks available in Beats Music.
Endpoint URL
/api/tracks/:id
HTTP Method
GET
Authentication
Client ID required. See how to authenticate public resources here.
Parameters
| Name | Required | Description | Example |
|---|---|---|---|
| id | required | The unique ID for the track. | tr82071543 |
| fields | optional | An array of object fields to include in the response. Only the specified fields will be returned. Default is to return all fields. |
Response Elements
| Response | Description |
|---|---|
| code |
Beats API response code. OK if successful; otherwise an error code is returned. |
| data |
The track object for the specified ID: |
|
type |
The entity type of the API object. |
|
id |
The unique ID of the track. |
|
title |
The title of the song corresponding to this track (including remarks indicating the version). |
|
artist_display_name |
A string representing the name to display as the artist credit. |
|
duration |
The total duration of the audio, in seconds. |
|
parental_advisory |
Indicates whether the item has a parental advisory (explicit) warning. |
|
edited_version |
Indicates whether the item has is an edited version of an explicit song. song. |
|
popularity |
The current projected popularity, relative to other items of the same type. |
|
track_position |
The position of the track in the album’s ordered track sequence, starting from 1. If the album is multi-disc, only the first track of the first disc starts from one – the others start from where the previous disc left off. |
|
disc_number |
If the track is from a multi-disc album, the disc number on which this track appears; otherwise 1. |
|
streamable |
Indicates whether the currently logged-in user has rights to stream the track. |
|
refs |
Object with keys corresponding to referenced object types, and values providing the information needed for linking to the objects. |
Example Request
Suppose you used the Search API to search the Beats Music Catalog for tracks whose information contains "Compton", and one of the track IDs returned in the results was tr82071543 from the "good kid, m.A.A.d city" album by Kendrick Lamar:
{
"data": [
{
"type": "search_result",
"result_type": "track",
"id": "tr82071543",
"display": "Compton (feat. Dr. Dre)",
"detail": "Kendrick Lamar",
"related": {
"ref_type": "album",
"id": "al82071519",
"display": "good kid, m.A.A.d city"
}
},
...
To retrieve detailed information about that track, you would specify the track ID. The general form of this API is:
curl -X GET "https://partner.api.beatsmusic.com/v1/api/tracks/[TRACK_ID]?
client_id=[YOUR_CLIENT_ID]"
In this example we will retrieve "Compton" by Kendrick Lamar (track ID tr82071543). To get the track you will need a client ID:
curl -X GET "https://partner.api.beatsmusic.com/v1/api/tracks/tr82071543?
client_id=[YOUR_CLIENT_ID]"
Example Response
{
"data": {
"type": "track",
"id": "tr82071543",
"title": "Compton (feat. Dr. Dre)",
"disc_number": 1,
"parental_advisory": true,
"edited_version": false,
"duration": 248,
"track_position": 12,
"popularity": 1680,
"streamable": true,
"release_date": "2012-10-22",
"artist_display_name": "Kendrick Lamar",
"refs": {
"artists": [
{
"ref_type": "artist",
"id": "ar1033754",
"display": "Kendrick Lamar"
}
],
"album": {
"ref_type": "album",
"id": "al82071519",
"display": "good kid, m.A.A.d city"
}
}
},
"code": "OK"
}

