close
The Wayback Machine - https://web.archive.org/web/20140813140035/https://developer.beatsmusic.com/docs/read/mymusic/Artist_Albums

Artist Albums

You can get the albums for a specified artist in My Library. Albums are ordered according to the dates on which the user added them to the library.


Endpoint URL

/api/users/:user_id/mymusic/:id/albums


HTTP Method

GET


Authentication

OAuth 2.0: Access token required. See Authentication for examples and details.


Parameters

Name Required Description Example
user_id required The unique ID for the user. 150470956064702464
id required The unique ID for the artist. ar31068

Response Elements

ResponseDescription
code

Beats API response code. OK if successful; otherwise an error code is returned.

info

Contains paging information used to display the results.

offset

A zero-based integer offset into the results. Always matches the parameter value if it was specified.

count

The number of results returned for this request.

total

The total number of elements available for this resource.

data

A list of track objects:

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.

Example:
Jay Z & Kanye West

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.

popularity

The current projected popularity, relative to other items of the same type, on a scale from 0.0 to 1.0.
Note: This does not necessarily reflect historic popularity of the item, as new items can be assigned high popularity based on projected demand.

release_date

The release date of the album, in W3C DTF format: YYYY{-MM{-DD}} (see http://www.w3.org/TR/NOTE-datetime). Contains the year, with optional month and day.
Examples:
1989-05-21
1989-05
1989

release_format

LP,EP,Single,Compilation.

streamable

Indicates whether the currently logged-in user has rights to stream the track.

total_tracks

The total number of tracks.

explicit_add

Indicates whether the item was explicitly added to My Library.

delete_sideeffect

Indicates whether deleting the item will impact playlist content.

added_at

Epoch timestamp indicating when the item was added to the collection.

mymusic_track_count

The number of tracks from this album that appear in the library. Values range from 1 to total_tracks.

refs

Object with keys corresponding to referenced object types, and values providing the information needed for linking to the objects.
ref_type
The API object type of the referenced item.
id
The unique ID of the referenced item.
display
Text to be displayed when displaying a link to the referenced item.


Example Request

One of the central activities for a user is to add and remove albums and tracks in My Library. Suppose you have retrieved a list of artists for a user (see Artists) and would like to get detailed information for all of that artist's albums currently in My Library:

{
        ...
        "id": "ar31068",
        "display": "Sting"
        ...
}

We will retrieve and display the complete information about all the artist's albums in the user's library. To retrieve this information for the user, you will need the artist ID, the user ID, and an access token. The general form of this API is:

curl -X GET "https://partner.api.beatsmusic.com/v1/api/users/[USER_ID]/mymusic/[ARTIST_ID]/albums?
    access_token=[YOUR_ACCESS_TOKEN]"

In this example we will retrieve the albums the user has for the artist Sting (artist ID ar31068), which are currently in My Library for user ID 150470956064702464:

curl -X GET "https://partner.api.beatsmusic.com/v1/api/users/150470956064702464/mymusic/ar31068/albums?
    access_token=[YOUR_ACCESS_TOKEN]"

Example Response

{
    "info": {
        "offset": 0,
        "count": 1,
        "total": 1
    },
    "data": [
        {
            "type": "mymusic_album",
            "id": "al540887",
            "title": "Brand New Day",
            "duration": 2931,
            "parental_advisory": false,
            "edited_version": false,
            "release_date": "1999-09-28",
            "release_format": "LP",
            "rating": 0,
            "popularity": 26318,
            "streamable": true,
            "artist_display_name": "Sting",
            "refs": {
                "artists": [
                    {
                        "ref_type": "artist",
                        "id": "ar31068",
                        "display": "Sting"
                    }
                ],
                "tracks": [
                    {
                        "ref_type": "track",
                        "id": "tr540889",
                        "display": "A Thousand Years"
                    }
                ],
                "user": {
                    "ref_type": "user",
                    "display": "[USER_DISPLAY_NAME]",
                    "id": "150470956064702464"
                }
            },
            "canonical": true,
            "total_companion_albums": 0,
            "total_tracks": 10,
            "essential": false,
            "added_at": 1394218269,
            "mymusic_track_count": 1
        }
    ],
    "code": "OK"
}

Docs Navigation