Skip to content
DocumentationAPI Reference

Get Playlist Cover Image

client.Playlists.Images.List(ctx, playlistID) (*[]ImageObject, error)
GET/playlists/{playlist_id}/images

Get the current image associated with a specific playlist.

ParametersExpand Collapse
playlistID string

The Spotify ID of the playlist.

ReturnsExpand Collapse
type PlaylistImageListResponse []ImageObject
Height int64

The image height in pixels.

URL string

The source URL of the image.

Width int64

The image width in pixels.

Published booloptional

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

Get Playlist Cover Image

package main

import (
  "context"
  "fmt"

  "github.com/cjavdev/spotted-go"
  "github.com/cjavdev/spotted-go/option"
)

func main() {
  client := spotted.NewClient(
    option.WithAccessToken("My Access Token"),
  )
  imageObjects, err := client.Playlists.Images.List(context.TODO(), "3cEYpjA9oz9GiPac4AsH4n")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", imageObjects)
}
[
  {
    "height": 300,
    "url": "https://i.scdn.co/image/ab67616d00001e02ff9ca10b55ce82ae553c8228\n",
    "width": 300,
    "published": true
  }
]
Returns Examples
[
  {
    "height": 300,
    "url": "https://i.scdn.co/image/ab67616d00001e02ff9ca10b55ce82ae553c8228\n",
    "width": 300,
    "published": true
  }
]