A client-side JS wrapper for the Spotify Web API
Fetches a resource through a generic GET request.
Name | Type | Description | |
---|---|---|---|
url |
string
|
The URL to be fetched |
|
callback |
function(Object, Object)
|
An optional callback |
Object
Null if a callback is provided, a Promise
object otherwise
Fetches information about the current user. See Get Current User's Profile on the Spotify Developer site for more information about the endpoint.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
Fetches current user's saved tracks. See Get Current User's Saved Tracks on the Spotify Developer site for more information about the endpoint.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
Get the current user's followed artists. See Get User's Followed Artists on the Spotify Developer site for more information about the endpoint.
Name | Type | Description | |
---|---|---|---|
options |
Object
|
Options, being after and limit. |
Optional |
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. |
Promise
A promise that if successful, resolves to an object containing a paging object which contains artists objects. Not returned if a callback is given.
Fetches information about a specific user. See Get a User's Profile on the Spotify Developer site for more information about the endpoint.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
Fetches a specific playlist. See Get a Playlist on the Spotify Developer site for more information about the endpoint.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
Fetches the tracks from a specific playlist. See Get a Playlist's Tracks on the Spotify Developer site for more information about the endpoint.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
Add tracks to a playlist. See Add Tracks to a Playlist on the Spotify Developer site for more information about the endpoint.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
Replace the tracks of a playlist See Replace a Playlist's Tracks on the Spotify Developer site for more information about the endpoint.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
Reorder tracks in a playlist See Reorder a Playlist’s Tracks on the Spotify Developer site for more information about the endpoint.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
Remove tracks from a playlist See Remove Tracks from a Playlist on the Spotify Developer site for more information about the endpoint.
Name | Type | 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 |
|
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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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 |
|
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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
Upload a custom playlist cover image. See Upload A Custom Playlist Cover Image on the Spotify Developer site for more information about the endpoint.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
Fetches an album from the Spotify catalog. See Get an Album on the Spotify Developer site for more information about the endpoint.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
Fetches multiple albums from the Spotify catalog. See Get Several Albums on the Spotify Developer site for more information about the endpoint.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
Fetches a track from the Spotify catalog. See Get a Track on the Spotify Developer site for more information about the endpoint.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
Fetches multiple tracks from the Spotify catalog. See Get Several Tracks on the Spotify Developer site for more information about the endpoint.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
Fetches an artist from the Spotify catalog. See Get an Artist on the Spotify Developer site for more information about the endpoint.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
Fetches multiple artists from the Spotify catalog. See Get Several Artists on the Spotify Developer site for more information about the endpoint.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
Pause playback on the user’s account. See Pause a User’s Playback on the Spotify Developer site for more information about the endpoint.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
Fetches a show from the Spotify catalog. See Get a Show on the Spotify Developer site for more information about the endpoint.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
Fetches multiple shows from the Spotify catalog. See Get Several Shows on the Spotify Developer site for more information about the endpoint.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
Fetches current user's saved shows. See Get Current User's Saved Shows on the Spotify Developer site for more information about the endpoint.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
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.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
Fetches an episode from the Spotify catalog. See Get an Episode on the Spotify Developer site for more information about the endpoint.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
Fetches multiple episodes from the Spotify catalog. See Get Several Episodes on the Spotify Developer site for more information about the endpoint.
Name | Type | 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. |
Object
Null if a callback is provided, a Promise
object otherwise
Sets the access token to be used. See the Authorization Guide on the Spotify Developer site for more information about obtaining an access token.
Name | Type | Description | |
---|---|---|---|
accessToken |
string
|
The access token |
Sets an implementation of Promises/A+ to be used. E.g. Q, when. See Conformant Implementations for a list of some available options
Name | Type | Description | |
---|---|---|---|
PromiseImplementation |
Object
|
A Promises/A+ valid implementation |