Get a list of the songs saved in the current Spotify user’s “Your Music” library.

Endpoint

GET https://api.spotify.com/v1/me/tracks

Request Parameters

Header field
Value
AuthorizationRequired. A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details. The user-library-read scope must have been authorized by the user.

Query parameter
Value
limit
Optional. The maximum number of objects to return. Default: 20. Minimum: 1. Maximum: 50.
offset
Optional. The index of the first object to return. Default: 0 (i.e., the first object). Use with limit to get the next set of objects.
marketOptional. An ISO 3166-1 alpha-2 country code. Provide this parameter if you want to apply Track Relinking.

Response Format

On success, the HTTP status code in the response header is 200 OK and the response body contains an array of saved track objects (wrapped in a paging object) in JSON format. On error, the header status code is an error code and the response body contains an error object.

Example

curl -X GET "https://api.spotify.com/v1/me/tracks" -H "Authorization: Bearer {your access token}"
{
  "href": "https://api.spotify.com/v1/me/tracks?offset=0&limit=20",
  "items": [
    {
      "added_at": "2014-07-08T14:05:27Z",
      "track": {
        "album": {
          "album_type": "album",
          "available_markets": [
            "AD",
            "AR",
            "AT",
            ...
            "TR",
            "TW",
            "UY"
          ],
          "external_urls": {
            "spotify": "https://open.spotify.com/album/4kbE34G5bxaxwuCqz0NEw4"
          },
          "href": "https://api.spotify.com/v1/albums/4kbE34G5bxaxwuCqz0NEw4",
          "id": "4kbE34G5bxaxwuCqz0NEw4",
          "images": [
            {
              "height": 635,
              "url": "https://i.scdn.co/image/5ac900806189613a98ce8d2a979265dabd3f7347",
              "width": 640
            },
            {
              "height": 298,
              "url": "https://i.scdn.co/image/e531cef3541f3d9d7fef9dbede8f19223e2f1497",
              "width": 300
            },
            {
              "height": 64,
              "url": "https://i.scdn.co/image/4be3ce9447365df0b8653f941058ab3fd7177b25",
              "width": 64
            }
          ],
          "name": "The Best Of Me",
          "type": "album",
          "uri": "spotify:album:4kbE34G5bxaxwuCqz0NEw4"
        },
        "artists": [
          {
            "external_urls": {
              "spotify": "https://open.spotify.com/artist/3Z02hBLubJxuFJfhacLSDc"
            },
            "href": "https://api.spotify.com/v1/artists/3Z02hBLubJxuFJfhacLSDc",
            "id": "3Z02hBLubJxuFJfhacLSDc",
            "name": "Bryan Adams",
            "type": "artist",
            "uri": "spotify:artist:3Z02hBLubJxuFJfhacLSDc"
          }
        ],
        "available_markets": [
          "AD",
          "AR",
          "AT",
          ...
          "TR",
          "TW",
          "UY"
        ],
        "disc_number": 1,
        "duration_ms": 265933,
        "explicit": false,
        "external_ids": {
          "isrc": "USAM19774904"
        },
        "external_urls": {
          "spotify": "https://open.spotify.com/track/1XjKmqLHqnzNLYqYSRBIZK"
        },
        "href": "https://api.spotify.com/v1/tracks/1XjKmqLHqnzNLYqYSRBIZK",
        "id": "1XjKmqLHqnzNLYqYSRBIZK",
        "name": "Back To You - MTV Unplugged Version",
        "popularity": 43,
        "preview_url": "https://p.scdn.co/mp3-preview/abeb349e0ea95846b4e4e01b115fcdbd5e9a991a",
        "track_number": 11,
        "type": "track",
        "uri": "spotify:track:1XjKmqLHqnzNLYqYSRBIZK"
        ...
      }
    }
  ],
  "limit": 20,
  "next": "https://api.spotify.com/v1/me/tracks?offset=20&limit=20",
  "offset": 0,
  "previous": null,
  "total": 53
}

Try it in our Web API Console

track object (full)

Key
Value Type
Value Description
album
a simplified album object
The album on which the track appears. The album object includes a link in href to full information about the album.
artists
an array of simplified artist objectsThe artists who performed the track. Each artist object includes a link in href to more detailed information about the artist.
available_markets
array of strings
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
Boolean
Whether or not the track has explicit lyrics (true = yes it does; false = no it does not OR unknown).
external_ids
an external ID objectKnown external IDs for the track.
external_urlsan external URL objectKnown external URLs for this track.
hrefstringA link to the Web API endpoint providing full details of the track.
id
stringThe Spotify ID for the track.
is_playablebooleanPart of the response when Track Relinking is applied. If true, the track is playable in the given market. Otherwise false.
linked_froma linked track objectPart of the response when Track Relinking is applied, and the requested track has been replaced with different track. The track in the linked_from object contains information about the originally requested track.
name
string
The name of the track.
popularity
integer
The popularity of the track. The value will be between 0 and 100, with 100 being the most popular.

The popularity of a track is a value between 0 and 100, with 100 being the most popular. The popularity is calculated by algorithm and is based, in the most part, on the total number of plays the track has had and how recent those plays are.

Generally speaking, songs that are being played a lot now will have a higher popularity than songs that were played a lot in the past. Duplicate tracks (e.g. the same track from a single and an album) are rated independently. Artist and album popularity is derived mathematically from track popularity. Note that the popularity value may lag actual popularity by a few days: the value is not updated in real time.
preview_url
string
A link to a 30 second preview (MP3 format) of the track.
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
stringThe object type: "track".
uristringThe Spotify URI for the track.

paging object

Key
Value Type
Value Description
hrefstringA link to the Web API endpoint returning the full result of the request.
itemsan array of objectsThe requested data.
limitintegerThe maximum number of items in the response (as set in the query or by default).
next
string
URL to the next page of items. (null if none)
offsetintegerThe offset of the items returned (as set in the query or by default).
previous
string
URL to the previous page of items. (null if none)
total
integer
The total number of items available to return.