Skip to content
DocumentationAPI Reference

Get User's Playlists

users.playlists.list(user_id, **kwargs) -> CursorURLPage<SimplifiedPlaylistObject { id, collaborative, description, 10 more } >
GET/users/{user_id}/playlists

Get a list of the playlists owned or followed by a Spotify user.

ParametersExpand Collapse
user_id: String

The user's Spotify user ID.

limit: Integer

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

minimum1
maximum50
offset: Integer

The index of the first playlist to return. Default: 0 (the first object). Maximum offset: 100.000. Use with limit to get the next set of playlists.

ReturnsExpand Collapse
class SimplifiedPlaylistObject { id, collaborative, description, 10 more }
id: String

The Spotify ID for the playlist.

collaborative: bool

true if the owner allows other users to modify the playlist.

description: String

The playlist description. Only returned for modified, verified playlists, otherwise null.

external_urls: ExternalURLObject { published, spotify }

Known external URLs for this playlist.

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 playlist.

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

Images for the playlist. The array may be empty or contain up to three images. The images are returned by size in descending order. See Working with Playlists. Note: If returned, the source URL for the image (url) is temporary and will expire in less than a day.

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 playlist.

owner: PlaylistUserObject { id, external_urls, href, 3 more } & { display_name}

The user who owns the playlist

display_name: String

The name displayed on the user's profile. null if not available.

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

snapshot_id: String

The version identifier for the current playlist. Can be supplied in other requests to target a specific playlist version

tracks: PlaylistTracksRefObject { href, published, total }

A collection containing a link ( href ) to the Web API endpoint where full details of the playlist's tracks can be retrieved, along with the total number of tracks in the playlist. Note, a track object may be null. This can happen if a track is no longer available.

href: String

A link to the Web API endpoint where full details of the playlist's tracks can be retrieved.

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

total: Integer

Number of tracks in the playlist.

type: String

The object type: "playlist"

uri: String

The Spotify URI for the playlist.

Get User's Playlists

require "spotted"

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

page = spotted.users.playlists.list("smedjan")

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": [
    {
      "id": "id",
      "collaborative": true,
      "description": "description",
      "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",
      "owner": {
        "id": "id",
        "external_urls": {
          "published": true,
          "spotify": "spotify"
        },
        "href": "href",
        "published": true,
        "type": "user",
        "uri": "uri",
        "display_name": "display_name"
      },
      "published": true,
      "snapshot_id": "snapshot_id",
      "tracks": {
        "href": "href",
        "published": true,
        "total": 0
      },
      "type": "type",
      "uri": "uri"
    }
  ],
  "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": [
    {
      "id": "id",
      "collaborative": true,
      "description": "description",
      "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",
      "owner": {
        "id": "id",
        "external_urls": {
          "published": true,
          "spotify": "spotify"
        },
        "href": "href",
        "published": true,
        "type": "user",
        "uri": "uri",
        "display_name": "display_name"
      },
      "published": true,
      "snapshot_id": "snapshot_id",
      "tracks": {
        "href": "href",
        "published": true,
        "total": 0
      },
      "type": "type",
      "uri": "uri"
    }
  ],
  "published": true
}