Get full details of the tracks of a playlist owned by a Spotify user.

Endpoint

GET https://api.spotify.com/v1/users/{user_id}/playlists/{playlist_id}/tracks

Request Parameters

Path parameter
Value
user_id
The user's Spotify user ID.
playlist_id
The Spotify ID for the playlist.

Header field
Value
Authorization
Required. A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details.

Both Public and Private playlists belonging to any user are retrievable on provision of a valid access token.

Query parameterValue
fieldsOptional. Filters for the query: a comma-separated list of the fields to return. If omitted, all fields are returned. For example, to get just the total number of tracks and the request limit:

fields=total,limit

A dot separator can be used to specify non-reoccurring fields, while parentheses can be used to specify reoccurring fields within objects. For example, to get just the added date and user ID of the adder:

fields=items(added_at,added_by.id)

Use multiple parentheses to drill down into nested objects, for example:

fields=items(track(name,href,album(name,href)))

Fields can be excluded by prefixing them with an exclamation mark, for example:

fields=items.track.album(!external_urls,images)

limit Optional. The maximum number of tracks to return. Default: 100. Minimum: 1. Maximum: 100.
offsetOptional. The index of the first track to return. Default: 0 (the first object). Use with limit to get the next set of tracks.
marketOptional. An ISO 3166-1 alpha-2 country code. Provide this parameter if you want to apply Track Relinking.

Response Format

On success, the response body contains an array of playlist track objects (wrapped in a paging object) in JSON format and the HTTP status code in the response header is 200 OK. On error, the header status code is an error code and the response body contains an error object. Requesting playlists that you do not have the user’s authorization to access returns error 403 Forbidden.

Example (get the tracks of a user’s playlist)

curl -X GET "https://api.spotify.com/v1/users/spotify_espa%C3%B1a/playlists/21THa8j9TaSGuXYNBU5tsC/tracks" -H "Authorization: Bearer {your access token}"
 {
  "href" : "https://api.spotify.com/v1/users/spotify_espa%C3%B1a/playlists/21THa8j9TaSGuXYNBU5tsC/tracks",
  "items" : [ {
    "added_at" : "2014-08-18T20:16:08Z",
    "added_by" : {
      "external_urls" : {
        "spotify" : "http://open.spotify.com/user/spotify_espa%C3%B1a"
      },
      "href" : "https://api.spotify.com/v1/users/spotify_espa%C3%B1a",
      "id" : "spotify_españa",
      "type" : "user",
      "uri" : "spotify:user:spotify_espa%C3%B1a"
    },
    "track" : {
      "album" : {
        "album_type" : "single",
        "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ],
        "external_urls" : {
          "spotify" : "https://open.spotify.com/album/53fWaWYPGghRHppKdD7A2S"
        },
        "href" : "https://api.spotify.com/v1/albums/53fWaWYPGghRHppKdD7A2S",
        "id" : "53fWaWYPGghRHppKdD7A2S",
        "images" : [ {
          "height" : 640,
          "url" : "https://i.scdn.co/image/c06e5283ea7e430eeabef6215aa8ca58c9e05a3f",
          "width" : 640
        }, {
          "height" : 300,
          "url" : "https://i.scdn.co/image/34311df6e7baf6abb2b0326cd0a83e0c20df3a67",
          "width" : 300
        }, {
          "height" : 64,
          "url" : "https://i.scdn.co/image/9cb03d83dd72f14ce8fca8a416d47a500e5b91f8",
          "width" : 64
        } ],
        "name" : "El Taxi (feat. Pitbull, Sensato)",
        "type" : "album",
        "uri" : "spotify:album:53fWaWYPGghRHppKdD7A2S"
      },
      "artists" : [ {
        "external_urls" : {
          "spotify" : "https://open.spotify.com/artist/6W0XSFVBD0xJlJhahPSlKZ"
        },
        "href" : "https://api.spotify.com/v1/artists/6W0XSFVBD0xJlJhahPSlKZ",
        "id" : "6W0XSFVBD0xJlJhahPSlKZ",
        "name" : "Osmani Garcia",
        "type" : "artist",
        "uri" : "spotify:artist:6W0XSFVBD0xJlJhahPSlKZ"
      }, {
        "external_urls" : {
          "spotify" : "https://open.spotify.com/artist/0TnOYISbd1XYRBk9myaseg"
        },
        "href" : "https://api.spotify.com/v1/artists/0TnOYISbd1XYRBk9myaseg",
        "id" : "0TnOYISbd1XYRBk9myaseg",
        "name" : "Pitbull",
        "type" : "artist",
        "uri" : "spotify:artist:0TnOYISbd1XYRBk9myaseg"
      }, {
        "external_urls" : {
          "spotify" : "https://open.spotify.com/artist/7iJrDbKM5fEkGdm5kpjFzS"
        },
        "href" : "https://api.spotify.com/v1/artists/7iJrDbKM5fEkGdm5kpjFzS",
        "id" : "7iJrDbKM5fEkGdm5kpjFzS",
        "name" : "Sensato",
        "type" : "artist",
        "uri" : "spotify:artist:7iJrDbKM5fEkGdm5kpjFzS"
      } ],
      "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ],
      "disc_number" : 1,
      "duration_ms" : 324440,
      "explicit" : false,
      "external_ids" : {
        "isrc" : "CH9181400018"
      },
      "external_urls" : {
        "spotify" : "https://open.spotify.com/track/1qpbJ8GiPc706AfGqZAIei"
      },
      "href" : "https://api.spotify.com/v1/tracks/1qpbJ8GiPc706AfGqZAIei",
      "id" : "1qpbJ8GiPc706AfGqZAIei",
      "name" : "El Taxi",
      "popularity" : 69,
      "preview_url" : "https://p.scdn.co/mp3-preview/e5dddaabe2c026bceae32e2cd2139ced0445879e",
      "track_number" : 1,
      "type" : "track",
      "uri" : "spotify:track:1qpbJ8GiPc706AfGqZAIei"
    }
  }, {
    "added_at" : "2014-08-18T20:17:06Z",
    "added_by" : {
      "external_urls" : {
        "spotify" : "http://open.spotify.com/user/spotify_espa%C3%B1a"
      },
      "href" : "https://api.spotify.com/v1/users/spotify_espa%C3%B1a",
      "id" : "spotify_españa",
      "type" : "user",
      "uri" : "spotify:user:spotify_espa%C3%B1a"
    },
    ...
  } ],
  "limit" : 100,
  "next" : null,
  "offset" : 0,
  "previous" : null,
  "total" : 58
}

Try it in our Web API Console

playlist track object

Key
Value Type
Value Description
added_at
a timestampThe date and time the track was added.
Note that some very old playlists may return null in this field.
added_by
a user object
The Spotify user who added the track.
Note that some very old playlists may return null in this field.
track
a track object
Information about the track.

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 is calculated from both total plays and most recent plays.
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.