Endpoint

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

Request Parameters

Header Fields

Header Field Value
Authorization Required. 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 Parameters

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.
market Optional. An ISO 3166-1 alpha-2 country code or the string from_token. 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" : "2016-10-24T15:03:07Z",
    "track" : {
      "album" : {
        "album_type" : "album",
        "artists" : [ {
          "external_urls" : {
            "spotify" : "https://open.spotify.com/artist/0LIll5i3kwo5A3IDpipgkS"
          },
          "href" : "https://api.spotify.com/v1/artists/0LIll5i3kwo5A3IDpipgkS",
          "id" : "0LIll5i3kwo5A3IDpipgkS",
          "name" : "Squirrel Nut Zippers",
          "type" : "artist",
          "uri" : "spotify:artist:0LIll5i3kwo5A3IDpipgkS"
        } ],
        "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "ID", "IE", "IS", "IT", "JP", "LI", "LT", "LU", "LV", "MC", "MT", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "SE", "SG", "SK", "SV", "TR", "TW", "UY" ],
        "external_urls" : {
          "spotify" : "https://open.spotify.com/album/63GBbuUNBel2ovJjUrfh5r"
        },
        "href" : "https://api.spotify.com/v1/albums/63GBbuUNBel2ovJjUrfh5r",
        "id" : "63GBbuUNBel2ovJjUrfh5r",
        "images" : [ {
          "height" : 640,
          "url" : "https://i.scdn.co/image/e9c5fd63935b08ed27a7a5b0e65b2c6bf600fc4a",
          "width" : 640
        }, {
          "height" : 300,
          "url" : "https://i.scdn.co/image/416b6589d9e2d91147ff5072d640d0041b04cb41",
          "width" : 300
        }, {
          "height" : 64,
          "url" : "https://i.scdn.co/image/4bb6b451b8edde5881a5fcbe1a54bc8538f407ec",
          "width" : 64
        } ],
        "name" : "The Best of Squirrel Nut Zippers",
        "type" : "album",
        "uri" : "spotify:album:63GBbuUNBel2ovJjUrfh5r"
      },
      "artists" : [ {
        "external_urls" : {
          "spotify" : "https://open.spotify.com/artist/0LIll5i3kwo5A3IDpipgkS"
        },
        "href" : "https://api.spotify.com/v1/artists/0LIll5i3kwo5A3IDpipgkS",
        "id" : "0LIll5i3kwo5A3IDpipgkS",
        "name" : "Squirrel Nut Zippers",
        "type" : "artist",
        "uri" : "spotify:artist:0LIll5i3kwo5A3IDpipgkS"
      } ],
      "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "ID", "IE", "IS", "IT", "JP", "LI", "LT", "LU", "LV", "MC", "MT", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "SE", "SG", "SK", "SV", "TR", "TW", "UY" ],
      "disc_number" : 1,
      "duration_ms" : 137040,
      "explicit" : false,
      "external_ids" : {
        "isrc" : "USMA20215185"
      },
      "external_urls" : {
        "spotify" : "https://open.spotify.com/track/2jpDioAB9tlYXMdXDK3BGl"
      },
      "href" : "https://api.spotify.com/v1/tracks/2jpDioAB9tlYXMdXDK3BGl",
      "id" : "2jpDioAB9tlYXMdXDK3BGl",
      "name" : "Good Enough For Granddad",
      "popularity" : 19,
      "preview_url" : "https://p.scdn.co/mp3-preview/32cc6f7a3fca362dfcde753f0339f42539f15c9a",
      "track_number" : 1,
      "type" : "track",
      "uri" : "spotify:track:2jpDioAB9tlYXMdXDK3BGl"
      ...
      }
    }
  ],
  "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

Key Value Type Value Description
added_at a timestamp The date and time the track was saved.
track a track object Information about the track.

paging object

Key Value Type Value Description
href string A link to the Web API endpoint returning the full result of the request.
items an array of objects The requested data.
limit integer The 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)
offset integer The 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.