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

saved track object

KeyValue TypeValue Description
added_at
a timestampThe date and time the track was saved.
tracka track object Information about 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.