spotify-web-api-js (master) doxdox documentation

A client-side JS wrapper for the Spotify Web API

# Constr()

Creates an instance of the wrapper

# Constr.addToMySavedAlbums(albumIds, options, callback)

Save one or more albums to the current user's "Your Music" library. See Save Albums for Current User on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
albumIds Array<string> The ids of the albums. If you know their Spotify URI, it is easy to find their album id (e.g. spotify:album:<here_is_the_album_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.addToMySavedShows(showIds, options, callback)

Adds a list of shows to the current user's saved shows. See Save Shows for Current User on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
showIds Array<string> The ids of the shows. If you know their Spotify URI it is easy to find their show id (e.g. spotify:show:<here_is_the_show_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.addToMySavedTracks(trackIds, options, callback)

Adds a list of tracks to the current user's saved tracks. See Save Tracks for Current User on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
trackIds Array<string> The ids of the tracks. If you know their Spotify URI it is easy to find their track id (e.g. spotify:track:<here_is_the_track_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.addTracksToPlaylist(playlistId, uris, options, callback)

Add tracks to a playlist. See Add Tracks to a Playlist on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
playlistId string The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:<here_is_the_playlist_id>)
uris Array<string> An array of Spotify URIs for the tracks
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.areFollowingPlaylist(playlistId, userIds, callback)

Check to see if one or more Spotify users are following a specified playlist. See Check if Users Follow a Playlist on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
playlistId string The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:<here_is_the_playlist_id>)
userIds Array<string> The ids of the users. If you know their Spotify URI it is easy to find their user id (e.g. spotify:user:<here_is_the_user_id>)
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is an array of boolean values that indicate whether the users are following the playlist sent in the request.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.changePlaylistDetails(playlistId, data, callback)

Change a playlist's name and public/private state See Change a Playlist's Details on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
playlistId string The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:<here_is_the_playlist_id>)
data Object A JSON object with the data to update. E.g. {name: 'A new name', public: true}
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.containsMySavedAlbums(albumIds, options, callback)

Check if one or more albums is already saved in the current Spotify user's "Your Music" library. See Check User's Saved Albums on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
albumIds Array<string> The ids of the albums. If you know their Spotify URI, it is easy to find their album id (e.g. spotify:album:<here_is_the_album_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.containsMySavedShows(showIds, options, callback)

Checks if the current user's saved shows contains a certain list of shows. See Check Current User's Saved Shows on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
showIds Array<string> The ids of the shows. If you know their Spotify URI it is easy to find their show id (e.g. spotify:show:<here_is_the_show_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.containsMySavedTracks(trackIds, options, callback)

Checks if the current user's saved tracks contains a certain list of tracks. See Check Current User's Saved Tracks on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
trackIds Array<string> The ids of the tracks. If you know their Spotify URI it is easy to find their track id (e.g. spotify:track:<here_is_the_track_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.createPlaylist(userId, options, callback)

Creates a playlist and stores it in the current user's library. See Create a Playlist on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
userId string The id of the user. If you know the Spotify URI it is easy to find the id (e.g. spotify:user:<here_is_the_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.followArtists(artistIds, callback)

Adds the current user as a follower of one or more artists. See Follow Artists or Users on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
artistIds Array<string> The ids of the artists. If you know their Spotify URI it is easy to find their artist id (e.g. spotify:artist:<here_is_the_artist_id>)
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is an empty value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.followPlaylist(playlistId, options, callback)

Add the current user as a follower of one playlist. See Follow a Playlist on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
playlistId string The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:<here_is_the_playlist_id>)
options Object A JSON object with options that can be passed. For instance, whether you want the playlist to be followed privately ({public: false})
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is an empty value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.followUsers(userIds, callback)

Adds the current user as a follower of one or more other Spotify users. See Follow Artists or Users on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
userIds Array<string> The ids of the users. If you know their Spotify URI it is easy to find their user id (e.g. spotify:user:<here_is_the_user_id>)
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is an empty value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getAccessToken()

Gets the access token in use.

Returns

string

accessToken The access token

# Constr.getAlbum(albumId, options, callback)

Fetches an album from the Spotify catalog. See Get an Album on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
albumId string The id of the album. If you know the Spotify URI it is easy to find the album id (e.g. spotify:album:<here_is_the_album_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getAlbums(albumIds, options, callback)

Fetches multiple albums from the Spotify catalog. See Get Several Albums on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
albumIds Array<string> The ids of the albums. If you know their Spotify URI it is easy to find their album id (e.g. spotify:album:<here_is_the_album_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getAlbumTracks(albumId, options, callback)

Fetches the tracks of an album from the Spotify catalog. See Get an Album's Tracks on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
albumId string The id of the album. If you know the Spotify URI it is easy to find the album id (e.g. spotify:album:<here_is_the_album_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getArtist(artistId, options, callback)

Fetches an artist from the Spotify catalog. See Get an Artist on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
artistId string The id of the artist. If you know the Spotify URI it is easy to find the artist id (e.g. spotify:artist:<here_is_the_artist_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getArtistAlbums(artistId, options, callback)

Fetches the albums of an artist from the Spotify catalog. See Get an Artist's Albums on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
artistId string The id of the artist. If you know the Spotify URI it is easy to find the artist id (e.g. spotify:artist:<here_is_the_artist_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getArtistRelatedArtists(artistId, options, callback)

Fetches a list of artists related with a given one from the Spotify catalog. See Get an Artist's Related Artists on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
artistId string The id of the artist. If you know the Spotify URI it is easy to find the artist id (e.g. spotify:artist:<here_is_the_artist_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getArtists(artistIds, options, callback)

Fetches multiple artists from the Spotify catalog. See Get Several Artists on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
artistIds Array<string> The ids of the artists. If you know their Spotify URI it is easy to find their artist id (e.g. spotify:artist:<here_is_the_artist_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getArtistTopTracks(artistId, countryId, options, callback)

Fetches a list of top tracks of an artist from the Spotify catalog, for a specific country. See Get an Artist's Top Tracks on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
artistId string The id of the artist. If you know the Spotify URI it is easy to find the artist id (e.g. spotify:artist:<here_is_the_artist_id>)
countryId string The id of the country (e.g. ES for Spain or US for United States)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getAudioAnalysisForTrack(trackId, callback)

Get audio analysis for a single track identified by its unique Spotify ID. See Get Audio Analysis for a Track on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
trackId string The id of the track. If you know the Spotify URI it is easy to find the track id (e.g. spotify:track:<here_is_the_track_id>)
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getAudioFeaturesForTrack(trackId, callback)

Get audio features for a single track identified by its unique Spotify ID. See Get Audio Features for a Track on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
trackId string The id of the track. If you know the Spotify URI it is easy to find the track id (e.g. spotify:track:<here_is_the_track_id>)
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getAudioFeaturesForTracks(trackIds, callback)

Get audio features for multiple tracks based on their Spotify IDs. See Get Audio Features for Several Tracks on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
trackIds Array<string> The ids of the tracks. If you know their Spotify URI it is easy to find their track id (e.g. spotify:track:<here_is_the_track_id>)
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getAvailableGenreSeeds(callback)

Retrieve a list of available genres seed parameter values for recommendations. See Available Genre Seeds on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getCategories(options, callback)

Get a list of categories used to tag items in Spotify (on, for example, the Spotify player's "Browse" tab). See Get a List of Categories on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getCategory(categoryId, options, callback)

Get a single category used to tag items in Spotify (on, for example, the Spotify player's "Browse" tab). See Get a Category on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
categoryId string The id of the category. These can be found with the getCategories function
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getCategoryPlaylists(categoryId, options, callback)

Get a list of Spotify playlists tagged with a particular category. See Get a Category's Playlists on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
categoryId string The id of the category. These can be found with the getCategories function
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getEpisode(episodeId, options, callback)

Fetches an episode from the Spotify catalog. See Get an Episode on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
episodeId string The id of the episode. If you know the Spotify URI it is easy to find the episode id (e.g. spotify:episode:<here_is_the_episode_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getEpisodes(episodeIds, options, callback)

Fetches multiple episodes from the Spotify catalog. See Get Several Episodes on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
episodeIds Array<string> The ids of the episodes. If you know their Spotify URI it is easy to find their episode id (e.g. spotify:episode:<here_is_the_episode_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getFeaturedPlaylists(options, callback)

Fetches a list of Spotify featured playlists (shown, for example, on a Spotify player's "Browse" tab). See Get a List of Featured Playlists on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getFollowedArtists(options, callback)

Get the current user's followed artists. See Get User's Followed Artists on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object Options, being after and limit.
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is an object with a paged object containing artists.

# Constr.getGeneric(url, callback)

Fetches a resource through a generic GET request.

Parameters

Name Types Description
url string The URL to be fetched
callback function(Object,Object) An optional callback

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getMe(options, callback)

Fetches information about the current user. See Get Current User's Profile on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getMyCurrentPlaybackState(options, callback)

Get information about the user’s current playback state, including track, track progress, and active device. See Get Information About The User’s Current Playback on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed.
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getMyCurrentPlayingTrack(options, callback)

Get the object currently being played on the user’s Spotify account. See Get the User’s Currently Playing Track on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed.
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getMyDevices(callback)

Get information about a user’s available devices. See Get a User’s Available Devices on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getMyRecentlyPlayedTracks(options, callback)

Get tracks from the current user’s recently played tracks. See Get Current User’s Recently Played Tracks on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getMySavedAlbums(options, callback)

Get a list of the albums saved in the current Spotify user's "Your Music" library. See Get Current User's Saved Albums on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getMySavedShows(options, callback)

Fetches current user's saved shows. See Get Current User's Saved Shows on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getMySavedTracks(options, callback)

Fetches current user's saved tracks. See Get Current User's Saved Tracks on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getMyTopArtists(options, callback)

Get the current user’s top artists based on calculated affinity. See Get a User’s Top Artists on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getMyTopTracks(options, callback)

Get the current user’s top tracks based on calculated affinity. See Get a User’s Top Tracks on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getNewReleases(options, callback)

Fetches a list of new album releases featured in Spotify (shown, for example, on a Spotify player's "Browse" tab). See Get a List of New Releases on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getPlaylist(playlistId, options, callback)

Fetches a specific playlist. See Get a Playlist on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
playlistId string The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:<here_is_the_playlist_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getPlaylistCoverImage(playlistId, callback)

Gets the current image associated with a specific playlist. See Get a Playlist Cover Image on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
playlistId string The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:playlist:<here_is_the_playlist_id>)
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getPlaylistTracks(playlistId, options, callback)

Fetches the tracks from a specific playlist. See Get a Playlist's Tracks on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
playlistId string The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:<here_is_the_playlist_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getRecommendations(options, callback)

Create a playlist-style listening experience based on seed artists, tracks and genres. See Get Recommendations Based on Seeds on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getShow(showId, options, callback)

Fetches a show from the Spotify catalog. See Get a Show on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
showId string The id of the show. If you know the Spotify URI it is easy to find the show id (e.g. spotify:show:<here_is_the_show_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getShowEpisodes(showId, options, callback)

Fetches the episodes of a show from the Spotify catalog. See Get a Show's Episodes on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
showId string The id of the show. If you know the Spotify URI it is easy to find the show id (e.g. spotify:show:<here_is_the_show_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getShows(showIds, options, callback)

Fetches multiple shows from the Spotify catalog. See Get Several Shows on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
showIds Array<string> The ids of the shows. If you know their Spotify URI it is easy to find their show id (e.g. spotify:show:<here_is_the_show_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getTrack(trackId, options, callback)

Fetches a track from the Spotify catalog. See Get a Track on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
trackId string The id of the track. If you know the Spotify URI it is easy to find the track id (e.g. spotify:track:<here_is_the_track_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getTracks(trackIds, options, callback)

Fetches multiple tracks from the Spotify catalog. See Get Several Tracks on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
trackIds Array<string> The ids of the tracks. If you know their Spotify URI it is easy to find their track id (e.g. spotify:track:<here_is_the_track_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getUser(userId, options, callback)

Fetches information about a specific user. See Get a User's Profile on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
userId string The id of the user. If you know the Spotify URI it is easy to find the id (e.g. spotify:user:<here_is_the_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.getUserPlaylists(userId, options, callback)

Fetches a list of the current user's playlists. See Get a List of a User's Playlists on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
userId string An optional id of the user. If you know the Spotify URI it is easy to find the id (e.g. spotify:user:<here_is_the_id>). If not provided, the id of the user that granted the permissions will be used.
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.isFollowingArtists(artistIds, callback)

Checks to see if the current user is following one or more artists. See Check if Current User Follows on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
artistIds Array<string> The ids of the artists. If you know their Spotify URI it is easy to find their artist id (e.g. spotify:artist:<here_is_the_artist_id>)
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is an array of boolean values that indicate whether the user is following the artists sent in the request.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.isFollowingUsers(userIds, callback)

Checks to see if the current user is following one or more other Spotify users. See Check if Current User Follows Users or Artists on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
userIds Array<string> The ids of the users. If you know their Spotify URI it is easy to find their user id (e.g. spotify:user:<here_is_the_user_id>)
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is an array of boolean values that indicate whether the user is following the users sent in the request.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.pause(options, callback)

Pause playback on the user’s account. See Pause a User’s Playback on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed.
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.play(options, callback)

Play a track on the user's active device See Start/Resume a User's Playback on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed.
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.queue(uri, options, callback)

Add an item to the end of the user’s current playback queue. See Add an Item to the User's Playback Queue on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
uri string The uri of the item to add to the queue. Must be a track or an episode uri.
options Object A JSON object with options that can be passed.
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.removeFromMySavedAlbums(albumIds, options, callback)

Remove one or more albums from the current user's "Your Music" library. See Remove Albums for Current User on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
albumIds Array<string> The ids of the albums. If you know their Spotify URI, it is easy to find their album id (e.g. spotify:album:<here_is_the_album_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.removeFromMySavedShows(showIds, options, callback)

Remove a list of shows from the current user's saved shows. See Remove Shows for Current User on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
showIds Array<string> The ids of the shows. If you know their Spotify URI it is easy to find their show id (e.g. spotify:show:<here_is_the_show_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.removeFromMySavedTracks(trackIds, options, callback)

Remove a list of tracks from the current user's saved tracks. See Remove Tracks for Current User on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
trackIds Array<string> The ids of the tracks. If you know their Spotify URI it is easy to find their track id (e.g. spotify:track:<here_is_the_track_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.removeTracksFromPlaylist(playlistId, uris, callback)

Remove tracks from a playlist See Remove Tracks from a Playlist on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
playlistId string The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:<here_is_the_playlist_id>)
uris Array<Object> An array of tracks to be removed. Each element of the array can be either a string, in which case it is treated as a URI, or an object containing the properties uri (which is a string) and positions (which is an array of integers).
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.removeTracksFromPlaylistInPositions(playlistId, positions, snapshotId, callback)

Remove tracks from a playlist, specifying the positions of the tracks to be removed. See Remove Tracks from a Playlist on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
playlistId string The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:<here_is_the_playlist_id>)
positions Array<number> array of integers containing the positions of the tracks to remove from the playlist.
snapshotId string The playlist's snapshot ID against which you want to make the changes
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.removeTracksFromPlaylistWithSnapshotId(playlistId, uris, snapshotId, callback)

Remove tracks from a playlist, specifying a snapshot id. See Remove Tracks from a Playlist on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
playlistId string The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:<here_is_the_playlist_id>)
uris Array<Object> An array of tracks to be removed. Each element of the array can be either a string, in which case it is treated as a URI, or an object containing the properties uri (which is a string) and positions (which is an array of integers).
snapshotId string The playlist's snapshot ID against which you want to make the changes
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.reorderTracksInPlaylist(playlistId, rangeStart, insertBefore, options, callback)

Reorder tracks in a playlist See Reorder a Playlist’s Tracks on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
playlistId string The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:<here_is_the_playlist_id>)
rangeStart number The position of the first track to be reordered.
insertBefore number The position where the tracks should be inserted. To reorder the tracks to the end of the playlist, simply set insert_before to the position after the last track.
options Object An object with optional parameters (range_length, snapshot_id)
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.replaceTracksInPlaylist(playlistId, uris, callback)

Replace the tracks of a playlist See Replace a Playlist's Tracks on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
playlistId string The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:<here_is_the_playlist_id>)
uris Array<string> An array of Spotify URIs for the tracks
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.search(query, types, options, callback)

Get Spotify catalog information about artists, albums, tracks or playlists that match a keyword string. See Search for an Item on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
query string The search query
types Array<string> An array of item types to search across. Valid types are: 'album', 'artist', 'playlist', and 'track'.
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.searchAlbums(query, options, callback)

Fetches albums from the Spotify catalog according to a query. See Search for an Item on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
query string The search query
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.searchArtists(query, options, callback)

Fetches artists from the Spotify catalog according to a query. See Search for an Item on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
query string The search query
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.searchEpisodes(query, options, callback)

Fetches episodes from the Spotify catalog according to a query. See Search for an Item on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
query string The search query
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.searchPlaylists(query, options, callback)

Fetches playlists from the Spotify catalog according to a query. See Search for an Item on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
query string The search query
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.searchShows(query, options, callback)

Fetches shows from the Spotify catalog according to a query. See Search for an Item on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
query string The search query
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.searchTracks(query, options, callback)

Fetches tracks from the Spotify catalog according to a query. See Search for an Item on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
query string The search query
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.seek(position_ms, options, callback)

Seeks to the given position in the user’s currently playing track. See Seek To Position In Currently Playing Track on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
position_ms number The position in milliseconds to seek to. Must be a positive number.
options Object A JSON object with options that can be passed.
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.setAccessToken(accessToken)

Sets the access token to be used. See the Authorization Guide on the Spotify Developer site for more information about obtaining an access token.

Parameters

Name Types Description
accessToken string The access token

Returns

void

# Constr.setPromiseImplementation(PromiseImplementation)

Sets an implementation of Promises/A+ to be used. E.g. Q, when. See Conformant Implementations for a list of some available options

Parameters

Name Types Description
PromiseImplementation Object A Promises/A+ valid implementation

Returns

void

# Constr.setRepeat(state, options, callback)

Set the repeat mode for the user’s playback. Options are repeat-track, repeat-context, and off. See Set Repeat Mode On User’s Playback on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
state String A string set to 'track', 'context' or 'off'.
options Object A JSON object with options that can be passed.
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.setShuffle(state, options, callback)

Toggle shuffle on or off for user’s playback. See Toggle Shuffle For User’s Playback on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
state bool Whether or not to shuffle user's playback.
options Object A JSON object with options that can be passed.
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.setVolume(volume_percent, options, callback)

Set the volume for the user’s current playback device. See Set Volume For User’s Playback on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
volume_percent number The volume to set. Must be a value from 0 to 100 inclusive.
options Object A JSON object with options that can be passed.
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.skipToNext(options, callback)

Skips to next track in the user’s queue. See Skip User’s Playback To Next Track on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed.
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.skipToPrevious(options, callback)

Skips to previous track in the user’s queue. Note that this will ALWAYS skip to the previous track, regardless of the current track’s progress. Returning to the start of the current track should be performed using .seek() See Skip User’s Playback To Previous Track on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed.
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.transferMyPlayback(deviceIds, options, callback)

Transfer playback to a new device and determine if it should start playing. See Transfer a User’s Playback on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
deviceIds Array<string> A JSON array containing the ID of the device on which playback should be started/transferred.
options Object A JSON object with options that can be passed.
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.unfollowArtists(artistIds, callback)

Removes the current user as a follower of one or more artists. See Unfollow Artists or Users on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
artistIds Array<string> The ids of the artists. If you know their Spotify URI it is easy to find their artist id (e.g. spotify:artist:<here_is_the_artist_id>)
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is an empty value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.unfollowPlaylist(playlistId, callback)

Remove the current user as a follower of one playlist. See Unfollow a Playlist on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
playlistId string The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:<here_is_the_playlist_id>)
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is an empty value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.unfollowUsers(userIds, callback)

Removes the current user as a follower of one or more other Spotify users. See Unfollow Artists or Users on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
userIds Array<string> The ids of the users. If you know their Spotify URI it is easy to find their user id (e.g. spotify:user:<here_is_the_user_id>)
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is an empty value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# Constr.uploadCustomPlaylistCoverImage(playlistId, imageData, callback)

Upload a custom playlist cover image. See Upload A Custom Playlist Cover Image on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
playlistId string The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:<here_is_the_playlist_id>)
imageData string Base64 encoded JPEG image data, maximum payload size is 256 KB.
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# SpotifyWebApi()

Class representing the API

# addTracksToPlaylist()

Add Tracks to a Playlist POST /v1/users/{user_id}/playlists/{playlist_id}/tracks https://developer.spotify.com/web-api/add-tracks-to-playlist/

# availableGenreSeeds()

Get available genre seeds GET /v1/recommendations/available-genre-seeds https://developer.spotify.com/web-api/get-recommendations/#available-genre-seeds

# category()

Get a category GET /v1/browse/categories/{category_id} https://developer.spotify.com/web-api/get-category/

# categoryPlaylists()

Get a categorys playlists GET /v1/browse/categories/{id}/playlists https://developer.spotify.com/web-api/get-categorys-playlists/

# changePlaylistDetails()

Change a Playlist’s Details PUT /v1/users/{user_id}/playlists/{playlist_id} https://developer.spotify.com/web-api/change-playlist-details/

# checkCurrentUserFollows()

Check if User Follows Users or Artists GET /v1/me/following/contains https://developer.spotify.com/web-api/check-current-user-follows/

# checkUserFollowsPlaylist()

Check if Users Follow a Playlist GET /v1/users/{user_id}/playlists/{playlist_id}/followers/contains https://developer.spotify.com/web-api/check-user-following-playlist/

# checkUsersSavedAlbums()

Check user's saved albums DELETE /v1/me/albums/contains?ids={ids} https://developer.spotify.com/web-api/check-users-saved-albums/

# checkUsersTracks()

Check User’s Saved Tracks GET /v1/me/tracks/contains?ids={ids} https://developer.spotify.com/web-api/check-users-saved-tracks/

# currentUsersPlaylists()

Get a list of the current user's playlists GET /v1/users/{user_id}/playlists https://developer.spotify.com/web-api/get-list-users-playlists/

# featuredPlaylists()

Get a list of featured playlists GET /v1/browse/featured-playlists https://developer.spotify.com/web-api/get-list-featured-playlists/

# followArtistsOrUsers()

Follow artists or users PUT /v1/me/following https://developer.spotify.com/web-api/follow-artists-users/

# followedArtists()

Get User’s Followed Artists GET /v1/me/following?type=artist https://developer.spotify.com/web-api/get-followed-artists/

# followPlaylist()

Follow a Playlist PUT /v1/users/{owner_id}/playlists/{playlist_id}/followers https://developer.spotify.com/web-api/follow-playlist/

# getAlbumTracks()

Get an Album’s Tracks GET /v1/albums/{id}/tracks https://developer.spotify.com/web-api/get-albums-tracks/

# getAnArtist()

Get an Artist GET /v1/artists/{id} https://developer.spotify.com/web-api/get-artist/

# getArtistRelatedArtists()

Get an Artist’s Related Artists GET /v1/artists/{id}/related-artists https://developer.spotify.com/web-api/get-related-artists/

# getArtistsAlbums()

Get an Artist’s Albums GET /v1/artists/{id}/albums https://developer.spotify.com/web-api/get-artists-albums/

# getArtistsTopTracks()

Get an Artist’s Top Tracks GET /v1/artists/{id}/top-tracks https://developer.spotify.com/web-api/get-artists-top-tracks/

# getMultipleAlbumsResponse()

Get Several Albums GET /v1/albums?ids={ids} https://developer.spotify.com/web-api/get-several-albums/

# getMyRecentlyPlayedTracks()

Get current user's recently played tracks GET /v1/me/player/recently-played https://developer.spotify.com/web-api/web-api-personalization-endpoints/get-recently-played/

# getSavedTracks()

Get user's saved tracks GET /v1/me/tracks https://developer.spotify.com/web-api/get-users-saved-tracks/

# getSeveralArtists()

Get Several Artists GET /v1/artists https://developer.spotify.com/web-api/get-several-artists/

# getSingleAlbum()

Get an Album GET /v1/albums/{id} https://developer.spotify.com/web-api/get-album/

# listOfCategories()

Get a list of categories GET /v1/browse/categories https://developer.spotify.com/web-api/get-list-categories/

# newPlaylist()

Create a Playlist POST /v1/users/{user_id}/playlists https://developer.spotify.com/web-api/create-playlist/

# newReleases()

Get a list of new releases GET /v1/browse/new-releases https://developer.spotify.com/web-api/get-list-new-releases/

# playlist()

Get a playlist GET /v1/users/{user_id}/playlists/{playlist_id} https://developer.spotify.com/web-api/get-playlist/

# playlistTracks()

Get a playlist's tracks GET /v1/users/{user_id}/playlists/{playlist_id}/tracks https://developer.spotify.com/web-api/get-playlists-tracks/

# recommendationsBasedOnSeeds()

Get recommendations based on seeds GET /v1/recommendations https://developer.spotify.com/get-recommendations/

# removeAlbumForUser()

Remove Albums for Current User DELETE /v1/me/albums?ids={ids} https://developer.spotify.com/web-api/remove-albums-user/

# removeTracksFromPlaylist()

Remove Tracks from a Playlist DELETE /v1/users/{user_id}/playlists/{playlist_id}/tracks https://developer.spotify.com/web-api/remove-tracks-playlist/

# removeUsersTracks()

Remove User’s Saved Tracks DELETE /v1/me/tracks?ids={ids} https://developer.spotify.com/web-api/remove-tracks-user/

# reorderTracksInPlaylist()

Reorder a Playlist’s Tracks PUT /v1/users/{user_id}/playlists/{playlist_id}/tracks https://developer.spotify.com/web-api/reorder-playlists-tracks/

# replacePlaylistTracks()

Replace a Playlist’s Tracks PUT /v1/users/{user_id}/playlists/{playlist_id}/tracks https://developer.spotify.com/web-api/replace-playlists-tracks/

# saveAlbumForUser()

Save albums for user PUT /v1/me/albums?ids={ids} https://developer.spotify.com/web-api/save-albums-user/

# saveTracksForUser()

Save tracks for user PUT /v1/me/tracks?ids={ids} https://developer.spotify.com/web-api/save-tracks-user/

# searchAlbums()

Search for an album GET /v1/search?type=album https://developer.spotify.com/web-api/search-item/

# searchArtists()

Search for an artist GET /v1/search?type=artist https://developer.spotify.com/web-api/search-item/

# searchPlaylists()

Search for a playlist GET /v1/search?type=playlist https://developer.spotify.com/web-api/search-item/

# searchTracks()

Search for a track GET /v1/search?type=track https://developer.spotify.com/web-api/search-item/

# severalAudioFeaturesResponse()

Get audio features for several tracks GET /v1/audio-features?ids={ids} https://developer.spotify.com/get-several-audio-features/

# singleAudioFeaturesResponse()

Get audio features for a track GET /v1/audio-features/{id} https://developer.spotify.com/web-api/get-audio-features/

# track()

Get a track GET /v1/tracks/{id} https://developer.spotify.com/web-api/get-track/

# tracks()

Get multiple tracks GET /v1/tracks?ids={ids} https://developer.spotify.com/web-api/get-several-tracks/

# unfollowArtistsOrUsers()

Unfollow artists or users DELETE /v1/me/following https://developer.spotify.com/web-api/unfollow-artists-users/

# unfollowPlaylist()

Unfollow a Playlist DELETE /v1/users/{owner_id}/playlists/{playlist_id}/followers https://developer.spotify.com/web-api/unfollow-playlist/

# userProfile()

Get user profile GET /v1/users/{user_id} https://developer.spotify.com/web-api/get-users-profile/

# userProfilePrivate()

Get Current User’s Profile GET /v1/me https://developer.spotify.com/web-api/get-current-users-profile/

# usersPlaylists()

Get a list of a user's playlists GET /v1/users/{user_id}/playlists https://developer.spotify.com/web-api/get-list-users-playlists/

# usersSavedAlbums()

Get user's saved albums GET /v1/me/albums https://developer.spotify.com/web-api/get-users-saved-albums/

# usersTopArtists()

Get a User’s Top Artists and Tracks (Note: This is only Artists) GET /v1/me/top/{type} https://developer.spotify.com/web-api/get-users-top-artists-and-tracks/

# usersTopTracks()

Get a User’s Top Artists and Tracks (Note: This is only Tracks) GET /v1/me/top/{type} https://developer.spotify.com/web-api/get-users-top-artists-and-tracks/

# edPagingObject()

Cursor Based Paging Object wrappers used for retrieving collections from the Spotify API.

# eObject()

Base Playlist Object. Does not in itself exist in Spotify Web Api, but needs to be made since the tracks types vary in the Full and Simplified versions.

# eObject()

Playlist Object Full

# eObject()

Playlist Object Simplified

# esResponse()

Get a list of new releases GET /v1/browse/new-releases https://developer.spotify.com/web-api/get-list-new-releases/

# addToMySavedAlbums(albumIds, options, callback)

Save one or more albums to the current user's "Your Music" library. See Save Albums for Current User on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
albumIds Array<string> The ids of the albums. If you know their Spotify URI, it is easy to find their album id (e.g. spotify:album:<here_is_the_album_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# addToMySavedShows(showIds, options, callback)

Adds a list of shows to the current user's saved shows. See Save Shows for Current User on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
showIds Array<string> The ids of the shows. If you know their Spotify URI it is easy to find their show id (e.g. spotify:show:<here_is_the_show_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# addToMySavedTracks(trackIds, options, callback)

Adds a list of tracks to the current user's saved tracks. See Save Tracks for Current User on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
trackIds Array<string> The ids of the tracks. If you know their Spotify URI it is easy to find their track id (e.g. spotify:track:<here_is_the_track_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# addTracksToPlaylist(playlistId, uris, options, callback)

Add tracks to a playlist. See Add Tracks to a Playlist on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
playlistId string The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:<here_is_the_playlist_id>)
uris Array<string> An array of Spotify URIs for the tracks
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# areFollowingPlaylist(playlistId, userIds, callback)

Check to see if one or more Spotify users are following a specified playlist. See Check if Users Follow a Playlist on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
playlistId string The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:<here_is_the_playlist_id>)
userIds Array<string> The ids of the users. If you know their Spotify URI it is easy to find their user id (e.g. spotify:user:<here_is_the_user_id>)
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is an array of boolean values that indicate whether the users are following the playlist sent in the request.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# changePlaylistDetails(playlistId, data, callback)

Change a playlist's name and public/private state See Change a Playlist's Details on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
playlistId string The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:<here_is_the_playlist_id>)
data Object A JSON object with the data to update. E.g. {name: 'A new name', public: true}
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# containsMySavedAlbums(albumIds, options, callback)

Check if one or more albums is already saved in the current Spotify user's "Your Music" library. See Check User's Saved Albums on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
albumIds Array<string> The ids of the albums. If you know their Spotify URI, it is easy to find their album id (e.g. spotify:album:<here_is_the_album_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# containsMySavedShows(showIds, options, callback)

Checks if the current user's saved shows contains a certain list of shows. See Check Current User's Saved Shows on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
showIds Array<string> The ids of the shows. If you know their Spotify URI it is easy to find their show id (e.g. spotify:show:<here_is_the_show_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# containsMySavedTracks(trackIds, options, callback)

Checks if the current user's saved tracks contains a certain list of tracks. See Check Current User's Saved Tracks on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
trackIds Array<string> The ids of the tracks. If you know their Spotify URI it is easy to find their track id (e.g. spotify:track:<here_is_the_track_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# createPlaylist(userId, options, callback)

Creates a playlist and stores it in the current user's library. See Create a Playlist on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
userId string The id of the user. If you know the Spotify URI it is easy to find the id (e.g. spotify:user:<here_is_the_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# es(options, callback)

Fetches a list of new album releases featured in Spotify (shown, for example, on a Spotify player's "Browse" tab). See Get a List of New Releases on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# followArtists(artistIds, callback)

Adds the current user as a follower of one or more artists. See Follow Artists or Users on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
artistIds Array<string> The ids of the artists. If you know their Spotify URI it is easy to find their artist id (e.g. spotify:artist:<here_is_the_artist_id>)
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is an empty value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# followPlaylist(playlistId, options, callback)

Add the current user as a follower of one playlist. See Follow a Playlist on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
playlistId string The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:<here_is_the_playlist_id>)
options Object A JSON object with options that can be passed. For instance, whether you want the playlist to be followed privately ({public: false})
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is an empty value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# followUsers(userIds, callback)

Adds the current user as a follower of one or more other Spotify users. See Follow Artists or Users on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
userIds Array<string> The ids of the users. If you know their Spotify URI it is easy to find their user id (e.g. spotify:user:<here_is_the_user_id>)
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is an empty value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getAccessToken()

Gets the access token in use.

Returns

string

accessToken The access token

# getAlbum(albumId, options, callback)

Fetches an album from the Spotify catalog. See Get an Album on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
albumId string The id of the album. If you know the Spotify URI it is easy to find the album id (e.g. spotify:album:<here_is_the_album_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getAlbums(albumIds, options, callback)

Fetches multiple albums from the Spotify catalog. See Get Several Albums on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
albumIds Array<string> The ids of the albums. If you know their Spotify URI it is easy to find their album id (e.g. spotify:album:<here_is_the_album_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getAlbumTracks(albumId, options, callback)

Fetches the tracks of an album from the Spotify catalog. See Get an Album's Tracks on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
albumId string The id of the album. If you know the Spotify URI it is easy to find the album id (e.g. spotify:album:<here_is_the_album_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getArtist(artistId, options, callback)

Fetches an artist from the Spotify catalog. See Get an Artist on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
artistId string The id of the artist. If you know the Spotify URI it is easy to find the artist id (e.g. spotify:artist:<here_is_the_artist_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getArtistAlbums(artistId, options, callback)

Fetches the albums of an artist from the Spotify catalog. See Get an Artist's Albums on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
artistId string The id of the artist. If you know the Spotify URI it is easy to find the artist id (e.g. spotify:artist:<here_is_the_artist_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getArtistRelatedArtists(artistId, options, callback)

Fetches a list of artists related with a given one from the Spotify catalog. See Get an Artist's Related Artists on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
artistId string The id of the artist. If you know the Spotify URI it is easy to find the artist id (e.g. spotify:artist:<here_is_the_artist_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getArtists(artistIds, options, callback)

Fetches multiple artists from the Spotify catalog. See Get Several Artists on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
artistIds Array<string> The ids of the artists. If you know their Spotify URI it is easy to find their artist id (e.g. spotify:artist:<here_is_the_artist_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getArtistTopTracks(artistId, countryId, options, callback)

Fetches a list of top tracks of an artist from the Spotify catalog, for a specific country. See Get an Artist's Top Tracks on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
artistId string The id of the artist. If you know the Spotify URI it is easy to find the artist id (e.g. spotify:artist:<here_is_the_artist_id>)
countryId string The id of the country (e.g. ES for Spain or US for United States)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getAudioAnalysisForTrack(trackId, callback)

Get audio feature information for a single track identified by its unique Spotify ID. See Get Audio Analysis for a Track on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
trackId string The id of the track. If you know the Spotify URI it is easy
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

# getAudioFeaturesForTrack(trackId, callback)

Get audio features for a single track identified by its unique Spotify ID. See Get Audio Features for a Track on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
trackId string The id of the track. If you know the Spotify URI it is easy to find the track id (e.g. spotify:track:<here_is_the_track_id>)
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getAudioFeaturesForTracks(trackIds, callback)

Get audio features for multiple tracks based on their Spotify IDs. See Get Audio Features for Several Tracks on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
trackIds Array<string> The ids of the tracks. If you know their Spotify URI it is easy to find their track id (e.g. spotify:track:<here_is_the_track_id>)
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getAvailableGenreSeeds(callback)

Retrieve a list of available genres seed parameter values for recommendations. See Available Genre Seeds on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getCategories(options, callback)

Get a list of categories used to tag items in Spotify (on, for example, the Spotify player's "Browse" tab). See Get a List of Categories on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getCategory(categoryId, options, callback)

Get a single category used to tag items in Spotify (on, for example, the Spotify player's "Browse" tab). See Get a Category on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
categoryId string The id of the category. These can be found with the getCategories function
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getCategoryPlaylists(categoryId, options, callback)

Get a list of Spotify playlists tagged with a particular category. See Get a Category's Playlists on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
categoryId string The id of the category. These can be found with the getCategories function
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getEpisode(episodeId, options, callback)

Fetches an episode from the Spotify catalog. See Get an Episode on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
episodeId string The id of the episode. If you know the Spotify URI it is easy to find the episode id (e.g. spotify:episode:<here_is_the_episode_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getEpisodes(episodeIds, options, callback)

Fetches multiple episodes from the Spotify catalog. See Get Several Episodes on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
episodeIds Array<string> The ids of the episodes. If you know their Spotify URI it is easy to find their episode id (e.g. spotify:episode:<here_is_the_episode_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getFeaturedPlaylists(options, callback)

Fetches a list of Spotify featured playlists (shown, for example, on a Spotify player's "Browse" tab). See Get a List of Featured Playlists on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getFollowedArtists(options, callback)

Get the current user's followed artists. See Get User's Followed Artists on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object Options, being after and limit.
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is an object with a paged object containing artists.

# getGeneric(url, callback)

Fetches a resource through a generic GET request.

Parameters

Name Types Description
url string The URL to be fetched
callback function(Object,Object) An optional callback

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getMe(options, callback)

Fetches information about the current user. See Get Current User's Profile on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getMyCurrentPlaybackState(options, callback)

Get information about the user’s current playback state, including track, track progress, and active device. See Get Information About The User’s Current Playback on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed.
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getMyCurrentPlayingTrack(options, callback)

Get the object currently being played on the user’s Spotify account. See Get the User’s Currently Playing Track on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed.
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getMyRecentlyPlayedTracks(options, callback)

Get tracks from the current user’s recently played tracks. See Get Current User’s Recently Played Tracks on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getMySavedAlbums(options, callback)

Get a list of the albums saved in the current Spotify user's "Your Music" library. See Get Current User's Saved Albums on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getMySavedShows(options, callback)

Fetches current user's saved shows. See Get Current User's Saved Shows on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getMySavedTracks(options, callback)

Fetches current user's saved tracks. See Get Current User's Saved Tracks on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getMyTopArtists(options, callback)

Get the current user’s top artists based on calculated affinity. See Get a User’s Top Artists on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getMyTopTracks(options, callback)

Get the current user’s top tracks based on calculated affinity. See Get a User’s Top Tracks on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getPlaylist(playlistId, options, callback)

Fetches a specific playlist. See Get a Playlist on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
playlistId string The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:<here_is_the_playlist_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getPlaylistCoverImage(playlistId, callback)

Gets the current image associated with a specific playlist. See Get a Playlist Cover Image on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
playlistId string The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:playlist:<here_is_the_playlist_id>)
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getPlaylistTracks(playlistId, options, callback)

Fetches the tracks from a specific playlist. See Get a Playlist's Tracks on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
playlistId string The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:<here_is_the_playlist_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getRecommendations(options, callback)

Create a playlist-style listening experience based on seed artists, tracks and genres. See Get Recommendations Based on Seeds on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getShow(showId, options, callback)

Fetches a show from the Spotify catalog. See Get a Show on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
showId string The id of the show. If you know the Spotify URI it is easy to find the show id (e.g. spotify:show:<here_is_the_show_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getShowEpisodes(showId, options, callback)

Fetches the episodes of a show from the Spotify catalog. See Get a Show's Episodes on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
showId string The id of the show. If you know the Spotify URI it is easy to find the show id (e.g. spotify:show:<here_is_the_show_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getShows(showIds, options, callback)

Fetches multiple shows from the Spotify catalog. See Get Several Shows on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
showIds Array<string> The ids of the shows. If you know their Spotify URI it is easy to find their show id (e.g. spotify:show:<here_is_the_show_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getTrack(trackId, options, callback)

Fetches a track from the Spotify catalog. See Get a Track on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
trackId string The id of the track. If you know the Spotify URI it is easy to find the track id (e.g. spotify:track:<here_is_the_track_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getTracks(trackIds, options, callback)

Fetches multiple tracks from the Spotify catalog. See Get Several Tracks on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
trackIds Array<string> The ids of the tracks. If you know their Spotify URI it is easy to find their track id (e.g. spotify:track:<here_is_the_track_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getUser(userId, options, callback)

Fetches information about a specific user. See Get a User's Profile on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
userId string The id of the user. If you know the Spotify URI it is easy to find the id (e.g. spotify:user:<here_is_the_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# getUserPlaylists(userId, options, callback)

Fetches a list of the current user's playlists. See Get a List of a User's Playlists on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
userId string An optional id of the user. If you know the Spotify URI it is easy to find the id (e.g. spotify:user:<here_is_the_id>). If not provided, the id of the user that granted the permissions will be used.
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# isFollowingArtists(artistIds, callback)

Checks to see if the current user is following one or more artists. See Check if Current User Follows on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
artistIds Array<string> The ids of the artists. If you know their Spotify URI it is easy to find their artist id (e.g. spotify:artist:<here_is_the_artist_id>)
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is an array of boolean values that indicate whether the user is following the artists sent in the request.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# isFollowingUsers(userIds, callback)

Checks to see if the current user is following one or more other Spotify users. See Check if Current User Follows Users or Artists on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
userIds Array<string> The ids of the users. If you know their Spotify URI it is easy to find their user id (e.g. spotify:user:<here_is_the_user_id>)
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is an array of boolean values that indicate whether the user is following the users sent in the request.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# queue(uri, options, callback)

Add an item to the end of the user’s current playback queue. See Add an Item to the User's Playback Queue on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
uri string The uri of the item to add to the queue. Must be a track or an episode uri.
options Object A JSON object with options that can be passed.
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# removeFromMySavedAlbums(albumIds, options, callback)

Remove one or more albums from the current user's "Your Music" library. See Remove Albums for Current User on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
albumIds Array<string> The ids of the albums. If you know their Spotify URI, it is easy to find their album id (e.g. spotify:album:<here_is_the_album_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# removeFromMySavedShows(showIds, options, callback)

Remove a list of shows from the current user's saved shows. See Remove Shows for Current User on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
showIds Array<string> The ids of the shows. If you know their Spotify URI it is easy to find their show id (e.g. spotify:show:<here_is_the_show_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# removeFromMySavedTracks(trackIds, options, callback)

Remove a list of tracks from the current user's saved tracks. See Remove Tracks for Current User on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
trackIds Array<string> The ids of the tracks. If you know their Spotify URI it is easy to find their track id (e.g. spotify:track:<here_is_the_track_id>)
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# removeTracksFromPlaylist(playlistId, uris, callback)

Remove tracks from a playlist See Remove Tracks from a Playlist on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
playlistId string The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:<here_is_the_playlist_id>)
uris Array<Object> An array of tracks to be removed. Each element of the array can be either a string, in which case it is treated as a URI, or an object containing the properties uri (which is a string) and positions (which is an array of integers).
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# removeTracksFromPlaylistInPositions(playlistId, positions, snapshotId, callback)

Remove tracks from a playlist, specifying the positions of the tracks to be removed. See Remove Tracks from a Playlist on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
playlistId string The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:<here_is_the_playlist_id>)
positions Array<number> array of integers containing the positions of the tracks to remove from the playlist.
snapshotId string The playlist's snapshot ID against which you want to make the changes
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# removeTracksFromPlaylistWithSnapshotId(playlistId, uris, snapshotId, callback)

Remove tracks from a playlist, specifying a snapshot id. See Remove Tracks from a Playlist on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
playlistId string The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:<here_is_the_playlist_id>)
uris Array<Object> An array of tracks to be removed. Each element of the array can be either a string, in which case it is treated as a URI, or an object containing the properties uri (which is a string) and positions (which is an array of integers).
snapshotId string The playlist's snapshot ID against which you want to make the changes
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# reorderTracksInPlaylist(playlistId, rangeStart, insertBefore, options, callback)

Reorder tracks in a playlist See Reorder a Playlist’s Tracks on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
playlistId string The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:<here_is_the_playlist_id>)
rangeStart number The position of the first track to be reordered.
insertBefore number The position where the tracks should be inserted. To reorder the tracks to the end of the playlist, simply set insert_before to the position after the last track.
options Object An object with optional parameters (range_length, snapshot_id)
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# replaceTracksInPlaylist(playlistId, uris, callback)

Replace the tracks of a playlist See Replace a Playlist's Tracks on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
playlistId string The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:<here_is_the_playlist_id>)
uris Array<string> An array of Spotify URIs for the tracks
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# search(query, types, options, callback)

Get Spotify catalog information about artists, albums, tracks or playlists that match a keyword string. See Search for an Item on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
query string The search query
types Array<> An array of item types to search across. Valid types are: 'album', 'artist', 'playlist', and 'track'.
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# searchAlbums(query, options, callback)

Fetches albums from the Spotify catalog according to a query. See Search for an Item on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
query string The search query
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# searchArtists(query, options, callback)

Fetches artists from the Spotify catalog according to a query. See Search for an Item on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
query string The search query
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# searchEpisodes(query, options, callback)

Fetches episodes from the Spotify catalog according to a query. See Search for an Item on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
query string The search query
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# searchPlaylists(query, options, callback)

Fetches playlists from the Spotify catalog according to a query. See Search for an Item on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
query string The search query
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# searchShows(query, options, callback)

Fetches shows from the Spotify catalog according to a query. See Search for an Item on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
query string The search query
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# searchTracks(query, options, callback)

Fetches tracks from the Spotify catalog according to a query. See Search for an Item on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
query string The search query
options Object A JSON object with options that can be passed
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# seek(position_ms, options, callback)

Seeks to the given position in the user’s currently playing track. See Seek To Position In Currently Playing Track on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
position_ms number The position in milliseconds to seek to. Must be a positive number.
options Object A JSON object with options that can be passed.
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# setAccessToken(accessToken)

Sets the access token to be used. See the Authorization Guide on the Spotify Developer site for more information about obtaining an access token.

Parameters

Name Types Description
accessToken string The access token

Returns

void

# setPromiseImplementation(PromiseImplementation)

Sets an implementation of Promises/A+ to be used. E.g. Q, when. See Conformant Implementations for a list of some available options

Parameters

Name Types Description
PromiseImplementation Object A Promises/A+ valid implementation

Returns

void

# setRepeat(state, options, callback)

Set the repeat mode for the user’s playback. Options are repeat-track, repeat-context, and off. See Set Repeat Mode On User’s Playback on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
state String A string set to 'track', 'context' or 'off'.
options Object A JSON object with options that can be passed.
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# setShuffle(state, options, callback)

Toggle shuffle on or off for user’s playback. See Toggle Shuffle For User’s Playback on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
state bool Whether or not to shuffle user's playback.
options Object A JSON object with options that can be passed.
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# setVolume(volume_percent, options, callback)

Set the volume for the user’s current playback device. See Set Volume For User’s Playback on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
volume_percent number The volume to set. Must be a value from 0 to 100 inclusive.
options Object A JSON object with options that can be passed.
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# skipToNext(options, callback)

Skips to next track in the user’s queue. See Skip User’s Playback To Next Track on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed.
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# skipToPrevious(options, callback)

Skips to previous track in the user’s queue. Note that this will ALWAYS skip to the previous track, regardless of the current track’s progress. Returning to the start of the current track should be performed using .seek() See Skip User’s Playback To Previous Track on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed.
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# SpotifyApi.DeviceSpecificParameterObject(options, callback)

Pause playback on the user’s account. See Pause a User’s Playback on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed.
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# SpotifyApi.PlayParameterObject(options, callback)

Start a new context or resume current playback on the user’s active device. See Start/Resume a User’s Playback on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
options Object A JSON object with options that can be passed.
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# SpotifyApi.UserDevicesResponse(callback)

Get information about a user’s available devices. See Get a User’s Available Devices on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# SpotifyWebApi()

Declare SpotifyWebApi variable, since that is the name of the function in spotify-web-api-js.

# transferMyPlayback(deviceIds, options, callback)

Transfer playback to a new device and determine if it should start playing. See Transfer a User’s Playback on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
deviceIds Array<string> A JSON array containing the ID of the device on which playback should be started/transferred.
options Object A JSON object with options that can be passed.
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# unfollowArtists(artistIds, callback)

Removes the current user as a follower of one or more artists. See Unfollow Artists or Users on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
artistIds Array<string> The ids of the artists. If you know their Spotify URI it is easy to find their artist id (e.g. spotify:artist:<here_is_the_artist_id>)
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is an empty value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# unfollowPlaylist(playlistId, callback)

Remove the current user as a follower of one playlist. See Unfollow a Playlist on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
playlistId string The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:<here_is_the_playlist_id>)
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is an empty value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# unfollowUsers(userIds, callback)

Removes the current user as a follower of one or more other Spotify users. See Unfollow Artists or Users on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
userIds Array<string> The ids of the users. If you know their Spotify URI it is easy to find their user id (e.g. spotify:user:<here_is_the_user_id>)
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is an empty value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise

# uploadCustomPlaylistCoverImage(playlistId, imageData, callback)

Upload a custom playlist cover image. See Upload A Custom Playlist Cover Image on the Spotify Developer site for more information about the endpoint.

Parameters

Name Types Description
playlistId string The id of the playlist. If you know the Spotify URI it is easy to find the playlist id (e.g. spotify:user:xxxx:playlist:<here_is_the_playlist_id>)
imageData string Base64 encoded JPEG image data, maximum payload size is 256 KB.
callback function(Object,Object) An optional callback that receives 2 parameters. The first one is the error object (null if no error), and the second is the value if the request succeeded.

Returns

Object

Null if a callback is provided, a `Promise` object otherwise