Spotify

Spotify Web API (all endpoints)

You can use Spotify's Web API to discover music and podcasts, manage your Spotify library, control audio playback, and much more. Browse our available Web API…

Media & content#openapi#media

Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.

Overview

You can use Spotify's Web API to discover music and podcasts, manage your Spotify library, control audio playback, and much more. Browse our available Web API endpoints using the sidebar at left, or via the navigation bar on top of this page on smaller screens.

In order to make successful Web API requests your app will need a valid access token. One can be obtained through OAuth 2.0 .

The base URI for all Web API requests is https://api.spotify.com/v1.

Need help? See our Web API guides for more information, or visit the Spotify for Developers community forum to ask questions and connect with other developers.

Endpoints 88

Albums

  • GETGet Several Albums /albums?ids=382ObEPsp2rxGrnsizN5TX,1A2GTWGtFfWp7KSQTwWOyo,2noRn2Aes5aoNVsU6iWThc&market=ESGet Spotify catalog information for multiple albums identified by their Spotify IDs.
  • GETGet Album /albums/:id?market=ESGet Spotify catalog information for a single album.
  • GETGet Album Tracks /albums/:id/tracks?market=ES&limit=10&offset=5Get Spotify catalog information about an album’s tracks. Optional parameters can be used to limit the number of tracks returned.
  • GETGet New Releases /browse/new-releases?country=SE&limit=10&offset=5Get a list of new album releases featured in Spotify (shown, for example, on a Spotify player’s “Browse” tab).
  • GETGet User's Saved Albums /me/albums?limit=10&offset=5&market=ESGet a list of the albums saved in the current Spotify user's 'Your Music' library.
  • PUTSave Albums for Current User /me/albums?ids=382ObEPsp2rxGrnsizN5TX,1A2GTWGtFfWp7KSQTwWOyo,2noRn2Aes5aoNVsU6iWThcSave one or more albums to the current user's 'Your Music' library.
  • DELETERemove Users' Saved Albums /me/albums?ids=382ObEPsp2rxGrnsizN5TX,1A2GTWGtFfWp7KSQTwWOyo,2noRn2Aes5aoNVsU6iWThcRemove one or more albums from the current user's 'Your Music' library.
  • GETCheck User's Saved Albums /me/albums/contains?ids=382ObEPsp2rxGrnsizN5TX,1A2GTWGtFfWp7KSQTwWOyo,2noRn2Aes5aoNVsU6iWThcCheck if one or more albums is already saved in the current Spotify user's 'Your Music' library.

Artists

  • GETGet Several Artists /artists?ids=2CIMQHirSU0MQqyYHq0eOx,57dN52uHvrHOxijzpIgu3E,1vCWHaC5f2uS3yhpwWbIA6Get Spotify catalog information for several artists based on their Spotify IDs.
  • GETGet Artist /artists/:idGet Spotify catalog information for a single artist identified by their unique Spotify ID.
  • GETGet Artist's Albums /artists/:id/albums?include_groups=single,appears_on&market=ES&limit=10&offset=5Get Spotify catalog information about an artist's albums.
  • GETGet Artist's Related Artists /artists/:id/related-artistsGet Spotify catalog information about artists similar to a given artist. Similarity is based on analysis of the Spotify community's listening history.
  • GETGet Artist's Top Tracks /artists/:id/top-tracks?market=ESGet Spotify catalog information about an artist's top tracks by country.

Tracks

  • GETGet Track's Audio Analysis /audio-analysis/:idGet a low-level audio analysis for a track in the Spotify catalog. The audio analysis describes the track’s structure and musical content, including rhythm,…
  • GETGet Tracks' Audio Features /audio-features?ids=7ouMYWpwJ422jRcDASZB7P,4VqPOruhp5EdPBeR92t6lQ,2takcwOaAZWiXQijPHIx7BGet audio features for multiple tracks based on their Spotify IDs.
  • GETGet Track's Audio Features /audio-features/:idGet audio feature information for a single track identified by its unique Spotify ID.
  • GETGet User's Saved Tracks /me/tracks?market=ES&limit=10&offset=5Get a list of the songs saved in the current Spotify user's 'Your Music' library.
  • PUTSave Tracks for Current User /me/tracks?ids=7ouMYWpwJ422jRcDASZB7P,4VqPOruhp5EdPBeR92t6lQ,2takcwOaAZWiXQijPHIx7BSave one or more tracks to the current user's 'Your Music' library.
  • DELETERemove User's Saved Tracks /me/tracks?ids=7ouMYWpwJ422jRcDASZB7P,4VqPOruhp5EdPBeR92t6lQ,2takcwOaAZWiXQijPHIx7BRemove one or more tracks from the current user's 'Your Music' library.
  • GETCheck User's Saved Tracks /me/tracks/contains?ids=7ouMYWpwJ422jRcDASZB7P,4VqPOruhp5EdPBeR92t6lQ,2takcwOaAZWiXQijPHIx7BCheck if one or more tracks is already saved in the current Spotify user's 'Your Music' library.
  • GETGet Recommendations /recommendations?limit=10&market=ES&seed_artists=4NHQUGzhtTLFvgF5SZesLK&seed_genres=classical,country&seed_tracks=0c6xIDDpzE81m2q797ordA&min_acousticness=0.0&max_acousticness=0.0&target_acousticness=0.0&min_danceability=0.0&max_danceability=0.0&target_danceability=0.0&min_duration_ms=0&max_duration_ms=0&target_duration_ms=0&min_energy=0.0&max_energy=0.0&target_energy=0.0&min_instrumentalness=0.0&max_instrumentalness=0.0&target_instrumentalness=0.0&min_key=0&max_key=0&target_key=0&min_liveness=0.0&max_liveness=0.0&target_liveness=0.0&min_loudness=0.0&max_loudness=0.0&target_loudness=0.0&min_mode=0&max_mode=0&target_mode=0&min_popularity=0&max_popularity=0&target_popularity=0&min_speechiness=0.0&max_speechiness=0.0&target_speechiness=0.0&min_tempo=0.0&max_tempo=0.0&target_tempo=0.0&min_time_signature=0&max_time_signature=0&target_time_signature=0&min_valence=0.0&max_valence=0.0&target_valence=0.0Recommendations are generated based on the available information for a given seed entity and matched against similar artists and tracks. If there is…
  • GETGet Several Tracks /tracks?market=ES&ids=7ouMYWpwJ422jRcDASZB7P,4VqPOruhp5EdPBeR92t6lQ,2takcwOaAZWiXQijPHIx7BGet Spotify catalog information for multiple tracks based on their Spotify IDs.
  • GETGet Track /tracks/:id?market=ESGet Spotify catalog information for a single track identified by its unique Spotify ID.

Audiobooks

  • GETGet Several Audiobooks /audiobooks?ids=18yVqkdbdRvS24c0Ilj2ci,1HGw3J3NxZO1TP1BTtVhpZ,7iHfbu1YPACw6oZPAFJtqe&market=ESGet Spotify catalog information for several audiobooks identified by their Spotify IDs.<br /> Note: Audiobooks are only available for the US, UK, Ireland, New…
  • GETGet an Audiobook /audiobooks/:id?market=ESGet Spotify catalog information for a single audiobook.<br /> Note: Audiobooks are only available for the US, UK, Ireland, New Zealand and Australia markets.
  • GETGet Audiobook Chapters /audiobooks/:id/chapters?market=ES&limit=10&offset=5Get Spotify catalog information about an audiobook's chapters.<br /> Note: Audiobooks are only available for the US, UK, Ireland, New Zealand and Australia…
  • GETGet User's Saved Audiobooks /me/audiobooks?limit=10&offset=5Get a list of the audiobooks saved in the current Spotify user's 'Your Music' library.
  • PUTSave Audiobooks for Current User /me/audiobooks?ids=18yVqkdbdRvS24c0Ilj2ci,1HGw3J3NxZO1TP1BTtVhpZ,7iHfbu1YPACw6oZPAFJtqeSave one or more audiobooks to the current Spotify user's library.
  • DELETERemove User's Saved Audiobooks /me/audiobooks?ids=18yVqkdbdRvS24c0Ilj2ci,1HGw3J3NxZO1TP1BTtVhpZ,7iHfbu1YPACw6oZPAFJtqeRemove one or more audiobooks from the Spotify user's library.
  • GETCheck User's Saved Audiobooks /me/audiobooks/contains?ids=18yVqkdbdRvS24c0Ilj2ci,1HGw3J3NxZO1TP1BTtVhpZ,7iHfbu1YPACw6oZPAFJtqeCheck if one or more audiobooks are already saved in the current Spotify user's library.

Categories

  • GETGet Several Browse Categories /browse/categories?country=SE&locale=sv_SE&limit=10&offset=5Get a list of categories used to tag items in Spotify (on, for example, the Spotify player’s “Browse” tab).
  • GETGet Single Browse Category /browse/categories/:category_id?country=SE&locale=sv_SEGet a single category used to tag items in Spotify (on, for example, the Spotify player’s “Browse” tab).

Playlists

  • GETGet Category's Playlists /browse/categories/:category_id/playlists?country=SE&limit=10&offset=5Get a list of Spotify playlists tagged with a particular category.
  • GETGet Featured Playlists /browse/featured-playlists?country=SE&locale=sv_SE&timestamp=2014-10-23T09:00:00&limit=10&offset=5Get a list of Spotify featured playlists (shown, for example, on a Spotify player's 'Browse' tab).
  • GETGet Current User's Playlists /me/playlists?limit=10&offset=5Get a list of the playlists owned or followed by the current Spotify user.
  • GETGet Playlist /playlists/:playlist_id?market=ES&fields=items(added_by.id,track(name,href,album(name,href)))&additional_types=stringGet a playlist owned by a Spotify user.
  • PUTChange Playlist Details /playlists/:playlist_idChange a playlist's name and public/private state. (The user must, of course, own the playlist.)
  • GETGet Playlist Cover Image /playlists/:playlist_id/imagesGet the current image associated with a specific playlist.
  • PUTAdd Custom Playlist Cover Image /playlists/:playlist_id/imagesReplace the image used to represent a specific playlist.
  • GETGet Playlist Items /playlists/:playlist_id/tracks?market=ES&fields=items(added_by.id,track(name,href,album(name,href)))&limit=10&offset=5&additional_types=stringGet full details of the items of a playlist owned by a Spotify user.
  • PUTUpdate Playlist Items /playlists/:playlist_id/tracks?uris=stringEither reorder or replace items in a playlist depending on the request's parameters. To reorder items, include range_start, insert_before, range_length and…
  • POSTAdd Items to Playlist /playlists/:playlist_id/tracks?position=0&uris=spotify:track:4iV5W9uYEdYUVa79Axb7Rh,spotify:track:1301WleyT98MSxVHPZCA6MAdd one or more items to a user's playlist.
  • DELETERemove Playlist Items /playlists/:playlist_id/tracksRemove one or more items from a user's playlist.
  • GETGet User's Playlists /users/:user_id/playlists?limit=10&offset=5Get a list of the playlists owned or followed by a Spotify user.
  • POSTCreate Playlist /users/:user_id/playlistsCreate a playlist for a Spotify user. (The playlist will be empty until you add tracks.)

Chapters

  • GETGet Several Chapters /chapters?ids=0IsXVP0JmcB2adSE338GkK,3ZXb8FKZGU0EHALYX6uCzU,0D5wENdkdwbqlrHoaJ9g29&market=ESGet Spotify catalog information for several chapters identified by their Spotify IDs.<br /> Note: Chapters are only available for the US, UK, Ireland, New…
  • GETGet a Chapter /chapters/:id?market=ESGet Spotify catalog information for a single chapter.<br /> Note: Chapters are only available for the US, UK, Ireland, New Zealand and Australia markets.

Episodes

  • GETGet Several Episodes /episodes?ids=77o6BIVlYM3msb4MMIL1jH,0Q86acNRm6V9GYx55SXKwf&market=ESGet Spotify catalog information for several episodes based on their Spotify IDs.
  • GETGet Episode /episodes/:id?market=ESGet Spotify catalog information for a single episode identified by its unique Spotify ID.
  • GETGet User's Saved Episodes /me/episodes?market=ES&limit=10&offset=5Get a list of the episodes saved in the current Spotify user's library.
  • PUTSave Episodes for Current User /me/episodes?ids=77o6BIVlYM3msb4MMIL1jH,0Q86acNRm6V9GYx55SXKwfSave one or more episodes to the current user's library.
  • DELETERemove User's Saved Episodes /me/episodes?ids=7ouMYWpwJ422jRcDASZB7P,4VqPOruhp5EdPBeR92t6lQ,2takcwOaAZWiXQijPHIx7BRemove one or more episodes from the current user's library.
  • GETCheck User's Saved Episodes /me/episodes/contains?ids=77o6BIVlYM3msb4MMIL1jH,0Q86acNRm6V9GYx55SXKwfCheck if one or more episodes is already saved in the current Spotify user's 'Your Episodes' library.

Markets

  • GETGet Available Markets /marketsGet the list of markets where Spotify is available.

Users

  • GETGet Current User's Profile /meGet detailed profile information about the current user (including the current user's username).
  • GETGet Followed Artists /me/following?type=artist&after=0I2XqVXqHScXjHhk6AYYRe&limit=10Get the current user's followed artists.
  • PUTFollow Artists or Users /me/following?type=artist&ids=2CIMQHirSU0MQqyYHq0eOx,57dN52uHvrHOxijzpIgu3E,1vCWHaC5f2uS3yhpwWbIA6Add the current user as a follower of one or more artists or other Spotify users.
  • DELETEUnfollow Artists or Users /me/following?type=artist&ids=2CIMQHirSU0MQqyYHq0eOx,57dN52uHvrHOxijzpIgu3E,1vCWHaC5f2uS3yhpwWbIA6Remove the current user as a follower of one or more artists or other Spotify users.
  • GETCheck If User Follows Artists or Users /me/following/contains?type=artist&ids=2CIMQHirSU0MQqyYHq0eOx,57dN52uHvrHOxijzpIgu3E,1vCWHaC5f2uS3yhpwWbIA6Check to see if the current user is following one or more artists or other Spotify users.
  • GETGet User's Top Items /me/top/:type?time_range=medium_term&limit=10&offset=5Get the current user's top artists or tracks based on calculated affinity.
  • PUTFollow Playlist /playlists/:playlist_id/followersAdd the current user as a follower of a playlist.
  • DELETEUnfollow Playlist /playlists/:playlist_id/followersRemove the current user as a follower of a playlist.
  • GETCheck if Users Follow Playlist /playlists/:playlist_id/followers/contains?ids=jmperezperez,thelinmichael,wizzlerCheck to see if one or more Spotify users are following a specified playlist.
  • GETGet User's Profile /users/:user_idGet public profile information about a Spotify user.

Player

  • GETGet Playback State /me/player?market=ES&additional_types=stringGet information about the user’s current playback state, including track or episode, progress, and active device.
  • PUTTransfer Playback /me/playerTransfer playback to a new device and determine if it should start playing.
  • GETGet Currently Playing Track /me/player/currently-playing?market=ES&additional_types=stringGet the object currently being played on the user's Spotify account.
  • GETGet Available Devices /me/player/devicesGet information about a user’s available devices.
  • POSTSkip To Next /me/player/next?device_id=0d1841b0976bae2a3a310dd74c0f3df354899bc8Skips to next track in the user’s queue.
  • PUTPause Playback /me/player/pause?device_id=0d1841b0976bae2a3a310dd74c0f3df354899bc8Pause playback on the user's account.
  • PUTStart/Resume Playback /me/player/play?device_id=0d1841b0976bae2a3a310dd74c0f3df354899bc8Start a new context or resume current playback on the user's active device.
  • POSTSkip To Previous /me/player/previous?device_id=0d1841b0976bae2a3a310dd74c0f3df354899bc8Skips to previous track in the user’s queue.
  • GETGet the User's Queue /me/player/queueGet the list of objects that make up the user's queue.
  • POSTAdd Item to Playback Queue /me/player/queue?uri=spotify:track:4iV5W9uYEdYUVa79Axb7Rh&device_id=0d1841b0976bae2a3a310dd74c0f3df354899bc8Add an item to the end of the user's current playback queue.
  • GETGet Recently Played Tracks /me/player/recently-played?limit=10&after=1484811043508&before=0Get tracks from the current user's recently played tracks. _Note: Currently doesn't support podcast episodes._
  • PUTSet Repeat Mode /me/player/repeat?state=context&device_id=0d1841b0976bae2a3a310dd74c0f3df354899bc8Set the repeat mode for the user's playback. Options are repeat-track, repeat-context, and off.
  • PUTSeek To Position /me/player/seek?position_ms=25000&device_id=0d1841b0976bae2a3a310dd74c0f3df354899bc8Seeks to the given position in the user’s currently playing track.
  • PUTToggle Playback Shuffle /me/player/shuffle?state=true&device_id=0d1841b0976bae2a3a310dd74c0f3df354899bc8Toggle shuffle on or off for user’s playback.
  • PUTSet Playback Volume /me/player/volume?volume_percent=50&device_id=0d1841b0976bae2a3a310dd74c0f3df354899bc8Set the volume for the user’s current playback device.

Shows

  • GETGet User's Saved Shows /me/shows?limit=10&offset=5Get a list of shows saved in the current Spotify user's library. Optional parameters can be used to limit the number of shows returned.
  • PUTSave Shows for Current User /me/shows?ids=5CfCWKI5pZ28U0uOzXkDHe,5as3aKmN2k11yfDDDSrvaZSave one or more shows to current Spotify user's library.
  • DELETERemove User's Saved Shows /me/shows?ids=5CfCWKI5pZ28U0uOzXkDHe,5as3aKmN2k11yfDDDSrvaZ&market=ESDelete one or more shows from current Spotify user's library.
  • GETCheck User's Saved Shows /me/shows/contains?ids=5CfCWKI5pZ28U0uOzXkDHe,5as3aKmN2k11yfDDDSrvaZCheck if one or more shows is already saved in the current Spotify user's library.
  • GETGet Several Shows /shows?market=ES&ids=5CfCWKI5pZ28U0uOzXkDHe,5as3aKmN2k11yfDDDSrvaZGet Spotify catalog information for several shows based on their Spotify IDs.
  • GETGet Show /shows/:id?market=ESGet Spotify catalog information for a single show identified by its unique Spotify ID.
  • GETGet Show Episodes /shows/:id/episodes?market=ES&limit=10&offset=5Get Spotify catalog information about an show’s episodes. Optional parameters can be used to limit the number of episodes returned.

Genres

  • GETGet Available Genre Seeds /recommendations/available-genre-seedsRetrieve a list of available genres seed parameter values for recommendations.

Search

  • GETSearch for Item /search?q=remaster%20track:Doxy%20artist:Miles%20Davis&type=album&market=ES&limit=10&offset=5&include_external=audioGet Spotify catalog information about albums, artists, playlists, tracks, shows, episodes or audiobooks that match a keyword string.<br /> Note: Audiobooks…

API details

Base URL
https://api.spotify.com/v1
Authentication
OAuth 2.0 (authorization code flow) with 19 scopes
Operations
88 operations on 67 pathsGET 58PUT 17DELETE 8POST 5
Main resources
Library 28Tracks 17Playlists 16Player 15Users 11Albums 9Artists 9Audiobooks 7Episodes 7Shows 7
Response formats
application/json
Description format
OpenAPI 3.0.3, API version 1.0.0
Listed from
APIs.guru OpenAPI Directory (CC0-1.0)
Source updated

How to test the Spotify Web API (all endpoints) in Swastik Codes

  1. Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
  2. Fork it into your workspaceChoose a workspace. You get your own copy of the Spotify Web API (all endpoints) collection, without the publisher's secrets.
  3. Add your credentialsThis API uses OAuth 2.0 (authorization code flow) with 19 scopes. Add yours in the collection's variables or an environment; the requests already reference it.
  4. Send a requestPick an endpoint, for example “Get Several Albums ” (GET /albums?ids=382ObEPsp2rxGrnsizN5TX,1A2GTWGtFfWp7KSQTwWOyo,2noRn2Aes5aoNVsU6iWThc&market=ES), and press Send. Check the response, add tests and run the whole collection with the runner.

Frequently asked questions

What is the Spotify Web API (all endpoints)?

You can use Spotify's Web API to discover music and podcasts, manage your Spotify library, control audio playback, and much more. Browse our available Web API… It is listed under Media & content and has 88 endpoints.

Who publishes the Spotify Web API (all endpoints)?

It is listed from Spotify's public API description (an OpenAPI document), not published by Spotify on Swastik Codes. Anyone who controls spotify.com can claim the profile by adding a DNS TXT record.

What is the base URL of the Spotify Web API (all endpoints)?

Requests go to https://api.spotify.com/v1. Endpoint paths are added to this base URL.

How do I authenticate with the Spotify Web API (all endpoints)?

With OAuth 2.0 (authorization code flow) with 19 scopes.

How many endpoints does the Spotify Web API (all endpoints) have?

88 operations on 67 paths (58 GET, 17 PUT, 8 DELETE, 5 POST). The largest groups are Library, Tracks, Playlists, Player.

Is forking the Spotify Web API (all endpoints) free?

Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.

Suggest an API

Tell us which public API is missing. We check it, then add it here with its endpoints when it has an OpenAPI (Swagger) description.