RapidAPI logo

Spotify

FREE
By stefan.skliarov
Updated 4 months ago
Music
7.6/10
Popularity Score
247ms
Latency
100%
Success Rate

Spotify API Documentation

Web API lets your applications fetch data from the Spotify music catalog and manage user’s playlists and saved music.

View API Details
POSTaddTracksToPlaylist
POSTcheckFollowingArtists
POSTcheckSavedAlbums
POSTcheckSavedTracks
POSTcheckUserFollowingPlaylist
POSTcreatePlaylist
POSTdeleteSavedAlbums
POSTfollowArtists
POSTfollowPlaylist
POSTfollowUsers
POSTgetAlbums
POSTgetArtists
POSTgetAvailableDevices
POSTgetCurrentPlayback
POSTgetCurrentlyPlaying
POSTgetFollowedArtists
POSTgetMyPlaylists
POSTgetMyProfile
POSTgetMyTopArtists
POSTgetMyTopTracks
POSTgetRecentlyPlayedTracks
POSTgetRecomendationPlaylist
POSTgetSavedAlbums
POSTgetSavedTracks
POSTgetSingleAlbum
POSTgetSingleAlbumTracks
POSTgetSingleArtist
POSTgetSingleArtistAlbums
POSTgetSingleArtistRelatedArtists
POSTgetSingleArtistTopTracks
POSTgetSingleCategory
POSTgetSingleCategoryPlaylists
POSTgetSingleTrack
POSTgetSingleTrackAudioAnalysis
POSTgetSingleTrackAudioFeatures
POSTgetTracks
POSTgetTracksAudioFeatures
POSTgetUserPlaylists
POSTgetUserProfile
POSTgetUserSinglePlaylist
POSTgetUserSinglePlaylistTracks
POSTlistCategories
POSTlistFeaturedPlaylists
POSTlistNewReleases
POSTpausePlayback
POSTpreviousPlayback
POSTremoveSavedTracks
POSTremoveTracksFromPlaylist
POSTreorderPlaylistTracks
POSTrepeatPlayback
POSTreplaceTracksInPlaylist
POSTsaveAlbums
POSTsaveTracks
POSTsearch
POSTseekPosition
POSTsetVolume
POSTshufflePlayback
POSTskipPlayback
POSTstartPlayback
POSTtransferPlayback
POSTunfollowArtists
POSTunfollowPlaylist
POSTunfollowUsers
POSTupdatePlaylist
POSTaddTracksToPlaylist

Add one or more tracks to a user’s playlist.

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
urisLIST
REQUIREDA list of Spotify track URIs to add.
userIdSTRING
REQUIREDThe user's Spotify user ID.
accessTokenSTRING
REQUIREDaccessToken from user
playlistIdSTRING
REQUIREDId of the playlist
Optional Parameters
positionNUMBER
OPTIONALThe position to insert the tracks, a zero-based index
Code Snippet
unirest.post("https://Spotifystefan-skliarovV1.p.rapidapi.com/addTracksToPlaylist")
.header("X-RapidAPI-Host", "Spotifystefan-skliarovV1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://Spotifystefan-skliarovV1.p.rapidapi.com/addTracksToPlaylist
Request Method: POST
Response Headers
Response Body
Log inSign up

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.post("https://Spotifystefan-skliarovV1.p.rapidapi.com/addTracksToPlaylist")
.header("X-RapidAPI-Host", "Spotifystefan-skliarovV1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication