Skip to content
DocumentationAPI Reference

Get User's Saved Albums

me.albums.list(**kwargs) -> CursorURLPage<AlbumListResponse { added_at, album, published } >
GET/me/albums

Get a list of the albums saved in the current Spotify user's 'Your Music' library.

ParametersExpand Collapse
limit: Integer

The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.

minimum1
maximum50
market: String

An ISO 3166-1 alpha-2 country code. If a country code is specified, only content that is available in that market will be returned.
If a valid user access token is specified in the request header, the country associated with the user account will take priority over this parameter.
Note: If neither market or user country are provided, the content is considered unavailable for the client.
Users can view the country that is associated with their account in the account settings.

offset: Integer

The index of the first item to return. Default: 0 (the first item). Use with limit to get the next set of items.

ReturnsExpand Collapse
class AlbumListResponse { added_at, album, published }
added_at: Time

The date and time the album was saved Timestamps are returned in ISO 8601 format as Coordinated Universal Time (UTC) with a zero offset: YYYY-MM-DDTHH:MM:SSZ. If the time is imprecise (for example, the date/time of an album release), an additional field indicates the precision; see for example, release_date in an album object.

formatdate-time
album: { id, album_type, available_markets, 18 more}

Information about the album.

id: String

The Spotify ID for the album.

album_type: :album | :single | :compilation

The type of the album.

Accepts one of the following:
:album
:single
:compilation
available_markets: Array[String]

The markets in which the album is available: ISO 3166-1 alpha-2 country codes. NOTE: an album is considered available in a market when at least 1 of its tracks is available in that market.

external_urls: ExternalURLObject { published, spotify }

Known external URLs for this album.

published: bool

The playlist's public/private status (if it should be added to the user's profile or not): true the playlist will be public, false the playlist will be private, null the playlist status is not relevant. For more about public/private status, see Working with Playlists

spotify: String

The Spotify URL for the object.

href: String

A link to the Web API endpoint providing full details of the album.

images: Array[ImageObject { height, url, width, published } ]

The cover art for the album in various sizes, widest first.

height: Integer

The image height in pixels.

url: String

The source URL of the image.

width: Integer

The image width in pixels.

published: bool

The playlist's public/private status (if it should be added to the user's profile or not): true the playlist will be public, false the playlist will be private, null the playlist status is not relevant. For more about public/private status, see Working with Playlists

name: String

The name of the album. In case of an album takedown, the value may be an empty string.

release_date: String

The date the album was first released.

release_date_precision: :year | :month | :day

The precision with which release_date value is known.

Accepts one of the following:
:year
:month
:day
total_tracks: Integer

The number of tracks in the album.

type: :album

The object type.

uri: String

The Spotify URI for the album.

artists: Array[SimplifiedArtistObject { id, external_urls, href, 4 more } ]

The artists of the album. Each artist object includes a link in href to more detailed information about the artist.

id: String

The Spotify ID for the artist.

external_urls: ExternalURLObject { published, spotify }

Known external URLs for this artist.

published: bool

The playlist's public/private status (if it should be added to the user's profile or not): true the playlist will be public, false the playlist will be private, null the playlist status is not relevant. For more about public/private status, see Working with Playlists

spotify: String

The Spotify URL for the object.

href: String

A link to the Web API endpoint providing full details of the artist.

name: String

The name of the artist.

published: bool

The playlist's public/private status (if it should be added to the user's profile or not): true the playlist will be public, false the playlist will be private, null the playlist status is not relevant. For more about public/private status, see Working with Playlists

type: :artist

The object type.

uri: String

The Spotify URI for the artist.

copyrights: Array[CopyrightObject { published, text, type } ]

The copyright statements of the album.

The playlist's public/private status (if it should be added to the user's profile or not): true the playlist will be public, false the playlist will be private, null the playlist status is not relevant. For more about public/private status, see Working with Playlists

The copyright text for this content.

The type of copyright: C = the copyright, P = the sound recording (performance) copyright.

external_ids: ExternalIDObject { ean, isrc, published, upc }

Known external IDs for the album.

published: bool

The playlist's public/private status (if it should be added to the user's profile or not): true the playlist will be public, false the playlist will be private, null the playlist status is not relevant. For more about public/private status, see Working with Playlists

Deprecatedgenres: Array[String]

Deprecated The array is always empty.

label: String

The label associated with the album.

popularity: Integer

The popularity of the album. The value will be between 0 and 100, with 100 being the most popular.

published: bool

The playlist's public/private status (if it should be added to the user's profile or not): true the playlist will be public, false the playlist will be private, null the playlist status is not relevant. For more about public/private status, see Working with Playlists

restrictions: AlbumRestrictionObject { published, reason }

Included in the response when a content restriction is applied.

published: bool

The playlist's public/private status (if it should be added to the user's profile or not): true the playlist will be public, false the playlist will be private, null the playlist status is not relevant. For more about public/private status, see Working with Playlists

reason: :market | :product | :explicit

The reason for the restriction. Albums may be restricted if the content is not available in a given market, to the user's subscription type, or when the user's account is set to not play explicit content. Additional reasons may be added in the future.

Accepts one of the following:
:market
:product
:explicit
tracks: { href, limit, next_, 5 more}

The tracks of the album.

href: String

A link to the Web API endpoint returning the full result of the request

limit: Integer

The maximum number of items in the response (as set in the query or by default).

URL to the next page of items. ( null if none)

offset: Integer

The offset of the items returned (as set in the query or by default)

URL to the previous page of items. ( null if none)

total: Integer

The total number of items available to return.

items: Array[SimplifiedTrackObject { id, artists, available_markets, 15 more } ]
id: String

The Spotify ID for the track.

artists: Array[SimplifiedArtistObject { id, external_urls, href, 4 more } ]

The artists who performed the track. Each artist object includes a link in href to more detailed information about the artist.

id: String

The Spotify ID for the artist.

external_urls: ExternalURLObject { published, spotify }

Known external URLs for this artist.

published: bool

The playlist's public/private status (if it should be added to the user's profile or not): true the playlist will be public, false the playlist will be private, null the playlist status is not relevant. For more about public/private status, see Working with Playlists

spotify: String

The Spotify URL for the object.

href: String

A link to the Web API endpoint providing full details of the artist.

name: String

The name of the artist.

published: bool

The playlist's public/private status (if it should be added to the user's profile or not): true the playlist will be public, false the playlist will be private, null the playlist status is not relevant. For more about public/private status, see Working with Playlists

type: :artist

The object type.

uri: String

The Spotify URI for the artist.

available_markets: Array[String]

A list of the countries in which the track can be played, identified by their ISO 3166-1 alpha-2 code.

disc_number: Integer

The disc number (usually 1 unless the album consists of more than one disc).

duration_ms: Integer

The track length in milliseconds.

explicit: bool

Whether or not the track has explicit lyrics ( true = yes it does; false = no it does not OR unknown).

external_urls: ExternalURLObject { published, spotify }

External URLs for this track.

published: bool

The playlist's public/private status (if it should be added to the user's profile or not): true the playlist will be public, false the playlist will be private, null the playlist status is not relevant. For more about public/private status, see Working with Playlists

spotify: String

The Spotify URL for the object.

href: String

A link to the Web API endpoint providing full details of the track.

is_local: bool

Whether or not the track is from a local file.

is_playable: bool

Part of the response when Track Relinking is applied. If true, the track is playable in the given market. Otherwise false.

linked_from: LinkedTrackObject { id, external_urls, href, 3 more }

Part of the response when Track Relinking is applied and is only part of the response if the track linking, in fact, exists. The requested track has been replaced with a different track. The track in the linked_from object contains information about the originally requested track.

id: String

The Spotify ID for the track.

external_urls: ExternalURLObject { published, spotify }

Known external URLs for this track.

published: bool

The playlist's public/private status (if it should be added to the user's profile or not): true the playlist will be public, false the playlist will be private, null the playlist status is not relevant. For more about public/private status, see Working with Playlists

spotify: String

The Spotify URL for the object.

href: String

A link to the Web API endpoint providing full details of the track.

published: bool

The playlist's public/private status (if it should be added to the user's profile or not): true the playlist will be public, false the playlist will be private, null the playlist status is not relevant. For more about public/private status, see Working with Playlists

type: String

The object type: "track".

uri: String

The Spotify URI for the track.

name: String

The name of the track.

Deprecatedpreview_url: String

A URL to a 30 second preview (MP3 format) of the track.

published: bool

The playlist's public/private status (if it should be added to the user's profile or not): true the playlist will be public, false the playlist will be private, null the playlist status is not relevant. For more about public/private status, see Working with Playlists

restrictions: TrackRestrictionObject { published, reason }

Included in the response when a content restriction is applied.

published: bool

The playlist's public/private status (if it should be added to the user's profile or not): true the playlist will be public, false the playlist will be private, null the playlist status is not relevant. For more about public/private status, see Working with Playlists

reason: String

The reason for the restriction. Supported values:

  • market - The content item is not available in the given market.
  • product - The content item is not available for the user's subscription type.
  • explicit - The content item is explicit and the user's account is set to not play explicit content.

Additional reasons may be added in the future. Note: If you use this field, make sure that your application safely handles unknown values.

track_number: Integer

The number of the track. If an album has several discs, the track number is the number on the specified disc.

type: String

The object type: "track".

uri: String

The Spotify URI for the track.

published: bool

The playlist's public/private status (if it should be added to the user's profile or not): true the playlist will be public, false the playlist will be private, null the playlist status is not relevant. For more about public/private status, see Working with Playlists

published: bool

The playlist's public/private status (if it should be added to the user's profile or not): true the playlist will be public, false the playlist will be private, null the playlist status is not relevant. For more about public/private status, see Working with Playlists

Get User's Saved Albums

require "spotted"

spotted = Spotted::Client.new(access_token: "My Access Token")

page = spotted.me.albums.list

puts(page)
{
  "href": "https://api.spotify.com/v1/me/shows?offset=0&limit=20\n",
  "limit": 20,
  "next": "https://api.spotify.com/v1/me/shows?offset=1&limit=1",
  "offset": 0,
  "previous": "https://api.spotify.com/v1/me/shows?offset=1&limit=1",
  "total": 4,
  "items": [
    {
      "added_at": "2019-12-27T18:11:19.117Z",
      "album": {
        "id": "2up3OPMp9Tb4dAKM2erWXQ",
        "album_type": "compilation",
        "available_markets": [
          "CA",
          "BR",
          "IT"
        ],
        "external_urls": {
          "published": true,
          "spotify": "spotify"
        },
        "href": "href",
        "images": [
          {
            "height": 300,
            "url": "https://i.scdn.co/image/ab67616d00001e02ff9ca10b55ce82ae553c8228\n",
            "width": 300,
            "published": true
          }
        ],
        "name": "name",
        "release_date": "1981-12",
        "release_date_precision": "year",
        "total_tracks": 9,
        "type": "album",
        "uri": "spotify:album:2up3OPMp9Tb4dAKM2erWXQ",
        "artists": [
          {
            "id": "id",
            "external_urls": {
              "published": true,
              "spotify": "spotify"
            },
            "href": "href",
            "name": "name",
            "published": true,
            "type": "artist",
            "uri": "uri"
          }
        ],
        "copyrights": [
          {
            "published": true,
            "text": "text",
            "type": "type"
          }
        ],
        "external_ids": {
          "ean": "ean",
          "isrc": "isrc",
          "published": true,
          "upc": "upc"
        },
        "genres": [
          "string"
        ],
        "label": "label",
        "popularity": 0,
        "published": true,
        "restrictions": {
          "published": true,
          "reason": "market"
        },
        "tracks": {
          "href": "https://api.spotify.com/v1/me/shows?offset=0&limit=20\n",
          "limit": 20,
          "next": "https://api.spotify.com/v1/me/shows?offset=1&limit=1",
          "offset": 0,
          "previous": "https://api.spotify.com/v1/me/shows?offset=1&limit=1",
          "total": 4,
          "items": [
            {
              "id": "id",
              "artists": [
                {
                  "id": "id",
                  "external_urls": {
                    "published": true,
                    "spotify": "spotify"
                  },
                  "href": "href",
                  "name": "name",
                  "published": true,
                  "type": "artist",
                  "uri": "uri"
                }
              ],
              "available_markets": [
                "string"
              ],
              "disc_number": 0,
              "duration_ms": 0,
              "explicit": true,
              "external_urls": {
                "published": true,
                "spotify": "spotify"
              },
              "href": "href",
              "is_local": true,
              "is_playable": true,
              "linked_from": {
                "id": "id",
                "external_urls": {
                  "published": true,
                  "spotify": "spotify"
                },
                "href": "href",
                "published": true,
                "type": "type",
                "uri": "uri"
              },
              "name": "name",
              "preview_url": "preview_url",
              "published": true,
              "restrictions": {
                "published": true,
                "reason": "reason"
              },
              "track_number": 0,
              "type": "type",
              "uri": "uri"
            }
          ],
          "published": true
        }
      },
      "published": true
    }
  ],
  "published": true
}
Returns Examples
{
  "href": "https://api.spotify.com/v1/me/shows?offset=0&limit=20\n",
  "limit": 20,
  "next": "https://api.spotify.com/v1/me/shows?offset=1&limit=1",
  "offset": 0,
  "previous": "https://api.spotify.com/v1/me/shows?offset=1&limit=1",
  "total": 4,
  "items": [
    {
      "added_at": "2019-12-27T18:11:19.117Z",
      "album": {
        "id": "2up3OPMp9Tb4dAKM2erWXQ",
        "album_type": "compilation",
        "available_markets": [
          "CA",
          "BR",
          "IT"
        ],
        "external_urls": {
          "published": true,
          "spotify": "spotify"
        },
        "href": "href",
        "images": [
          {
            "height": 300,
            "url": "https://i.scdn.co/image/ab67616d00001e02ff9ca10b55ce82ae553c8228\n",
            "width": 300,
            "published": true
          }
        ],
        "name": "name",
        "release_date": "1981-12",
        "release_date_precision": "year",
        "total_tracks": 9,
        "type": "album",
        "uri": "spotify:album:2up3OPMp9Tb4dAKM2erWXQ",
        "artists": [
          {
            "id": "id",
            "external_urls": {
              "published": true,
              "spotify": "spotify"
            },
            "href": "href",
            "name": "name",
            "published": true,
            "type": "artist",
            "uri": "uri"
          }
        ],
        "copyrights": [
          {
            "published": true,
            "text": "text",
            "type": "type"
          }
        ],
        "external_ids": {
          "ean": "ean",
          "isrc": "isrc",
          "published": true,
          "upc": "upc"
        },
        "genres": [
          "string"
        ],
        "label": "label",
        "popularity": 0,
        "published": true,
        "restrictions": {
          "published": true,
          "reason": "market"
        },
        "tracks": {
          "href": "https://api.spotify.com/v1/me/shows?offset=0&limit=20\n",
          "limit": 20,
          "next": "https://api.spotify.com/v1/me/shows?offset=1&limit=1",
          "offset": 0,
          "previous": "https://api.spotify.com/v1/me/shows?offset=1&limit=1",
          "total": 4,
          "items": [
            {
              "id": "id",
              "artists": [
                {
                  "id": "id",
                  "external_urls": {
                    "published": true,
                    "spotify": "spotify"
                  },
                  "href": "href",
                  "name": "name",
                  "published": true,
                  "type": "artist",
                  "uri": "uri"
                }
              ],
              "available_markets": [
                "string"
              ],
              "disc_number": 0,
              "duration_ms": 0,
              "explicit": true,
              "external_urls": {
                "published": true,
                "spotify": "spotify"
              },
              "href": "href",
              "is_local": true,
              "is_playable": true,
              "linked_from": {
                "id": "id",
                "external_urls": {
                  "published": true,
                  "spotify": "spotify"
                },
                "href": "href",
                "published": true,
                "type": "type",
                "uri": "uri"
              },
              "name": "name",
              "preview_url": "preview_url",
              "published": true,
              "restrictions": {
                "published": true,
                "reason": "reason"
              },
              "track_number": 0,
              "type": "type",
              "uri": "uri"
            }
          ],
          "published": true
        }
      },
      "published": true
    }
  ],
  "published": true
}