Getting Started
This API provides full access to the new SpotifyWebAPI introduced here. With it, you can search for Tracks/Albums/Artists and also get User-based information. It's also possible to create new playlists and add tracks to it.
First steps
Imports
So after you added the API to your project, you may want to add following imports to your files:
Basic-Usage
Now you can actually start doing calls to the SpotifyAPI, just create a new Instance of SpotifyWebAPI:
You may note that we used AccessToken
and TokenType
. Spotify does not allow un-authorized access to their API. You will need to implement one of the auth flows. Luckily, SpotifyAPI.Web.Auth
exists for this reason. A simple way to receive a AccessToken
is via CredentialAuth
:
For more info, visit the Getting Started of SpotifyAPI.Web.Auth
Error-Handling
Every API-Call returns a reponse-model which consists of base-error model. To check if a specific API-Call was successful, use the following approach:
In case some or all of the returned values are null, consult error status and message, they can lead to an explanation!
Sync vs Asynchronous
Every API-Call has an asynchronous
and synchronous
method.
Note that the synchronous
call will block the current Thread!
API-Reference
Albums
Artists
Browse
Follow
Library
- SaveTracks
- SaveTrack
- GetSavedTracks
- RemoveSavedTracks
- CheckSavedTracks
- SaveAlbums
- SaveAlbum
- GetSavedAlbums
- RemoveSavedAlbums
- CheckSavedAlbums
Personalization
Player
- GetDevices
- GetPlayback
- GetPlayingTrack
- TransferPlayback
- ResumePlayback
- PausePlayback
- SkipPlaybackToNext
- SkipPlaybackToPrevious
- SetRepeatMode
- SetVolume
- SetShuffle
Playlists
- GetUserPlaylists
- GetPlaylist
- GetPlaylistTracks
- CreatePlaylist
- UpdatePlaylist
- ReplacePlaylistTracks
- RemovePlaylistTracks
- RemovePlaylistTrack
- AddPlaylistTracks
- AddPlaylistTrack
- ReorderPlaylist