Spotify is a Go wrapper for Spotify's web API.
go get github.com/omegastreamtv/spotify
client, err := spotify.NewClient(
spotify.WithClientID(os.Getenv("SPOTIFY_ID")),
spotify.WithClientSecret(os.Getenv("SPOTIFY_SECRET")),
spotify.WithRedirectURI("http://localhost:8080/callback"),
)
client.SetAppAccessToken(token.AccessToken)
album, err := client.GetAlbum("382ObEPsp2rxGrnsizN5TX", "es")
if err != nil {
if spotifyErr, ok := err.(*spotify.SpotifyError); ok {
fmt.Println(spotifyErr.Err.Status, spotifyErr.Err.Message)
}
}
fmt.Println(album.Name)
All Params
, Body
, and Response
types are named exactly the same as their functions.
- Get Album (
GetAlbum
) - Get Several Albums (
GetSeveralAlbums
) - Get Album Tracks (
GetAlbumTracks
) - Get User's Saved Albums (
GetUsersSavedAlbums
) - Save Albums for Current User (
SaveAlbumsForCurrentUser
) - Remove Users' Saved Albums (
RemoveAlbumsForCurrentUser
) - Check USer's Saved Albums (
CheckUsersSavedAlbums
) - Get New Releases (
GetNewReleases
)
- Get Artist (
GetArtist
) - Get Several Artists (
GetSeveralArtists
) - Get Artist's Albums (
GetArtistsAlbums
) - Get Artist's Top Tracks (
GetArtistsTopTracks
) - Get Artist's Related Artists (
GetArtistsRelatedArtists
)
- Get an Audiobook (
GetAnAudiobook
) - Get Several Audiobooks (
GetSeveralAudiobooks
) - Get Audiobook Chapters (
GetAudiobookChapters
) - Get User's Saved Audiobooks (
GetUsersSavedAudioBooks
) - Save Audiobooks for Current User (
SaveAudiobooksForCurrentUser
) - Remove User's Saved Audiobooks (
RemoveUsersSavedAudiobooks
) - Check User's Saved Audiobooks (
CheckUsersSavedAudiobooks
)
- Get Several Browse Categories (
GetSeveralBrowseCategories
) - Get Single Browse Category (
GetSingleBrowseCategory
)
- Get Episode (
GetEpisode
) - Get Several Episodes (
GetSeveralEpisodes
) - Get User's Saved Episodes (
GetUsersSavedEpisodes
) - Save Episodes for Current User (
SaveEpisodesForCurrentUser
) - Remove User's Saved Episodes (
RemoveUsersSavedEpisodes
) - Check User's Saved Episodes (
CheckUsersSavedEpisodes
)
- Get Playback State (
GetPlaybackState
) - Transfer Playback (
TransferPlayback
) - Get Available Devices (
GetAvailableDevices
) - Get Currently Playing Track (
GetCurrentlyPlayingTrack
) - Start/Resume Playback (
StartResumePlayback
) - Pause Playback (
PausePlayback
) - Skip To Next (
SkipToNext
) - Skip To Previous (
SkipToPrevious
) - Skip to Position (
SeekToPosition
) - Set Repeat Mode (
SetRepeatMode
) - Set Playback Volume (
SetPlaybackVolume
) - Toggle Playback Shuffle (
TogglePlaybackShuffle
) - Get Recently Played Tracks (
GetRecentlyPlayedTracks
) - Get The User's Queue (
GetTheUsersQueue
) - Add Item to Playback Queue (
AddItemToPlaybackQueue
)
- Get Playlist (
GetPlaylist
) - Change Playlist Details (
ChangePlaylistDetails
) - Get Playlist Items (
GetPlaylistItems
) - Update Playlist Items (
UpdatePlaylistItems
) - Add Items to Playlist (
AddItemsToPlaylist
) - Remove Playlist Items (
RemovePlaylistItems
) - Get Current User's Playlists (
GetCurrentUsersPlaylists
) - Get User's Playlist (
GetUsersPlaylists
) - Create Playlist (
CreatePlaylist
) - Get Featured Playlists (
GetFeaturedPlaylists
) - Get Category's Playlists (
GetCategorysPlaylists
) - Get Playlist Cover Image (
GetPlaylistCoverImage
) - Add Custom Playlist Cover Image (
AddCustomPlaylistCoverImage
)
- Get Show (
GetShow
) - Get Several Shows (
GetSeveralShows
) - Get Show Episodes (
GetShowEpisodes
) - Get User's Saved Shows (
GetUsersSavedShows
) - Save Shows for Current User (
SaveShowsForCurrentUser
) - Remove User's Saved Shows (
RemoveUsersSavedShows
) - Check User's Saved Shows (
CheckUsersSavedShows
)
- Get Track (
GetTrack
) - Get Several Tracks (
GetSeveralTracks
) - Get User's Saved Tracks (
GetUsersSavedTracks
) - Save Tracks for Current User (
SaveTracksForCurrentUser
) - Remove User's Saved Tracks (
RemoveUsersSavedTracks
) - Check User's Saved Tracks (
CheckUsersSavedTracks
) - Get Tracks' Audio Features (
GetMultiTracksAudioFeatures
) - Get Track's Audio Features (
GetSingleTracksAudioFeatures
) - Get Track's Audio Analysis (
GetTracksAudioAnalysis
) - Get Recommendations (
GetRecommendations
)
- Get Current User's Profile (
GetCurrentUsersProfile
) - Get User's Top Items (split into
GetUsersTopArtists
andGetUsersTopTracks
) - Get User's Profile (
GetUsersProfile
) - Follow Playlist (
FollowPlaylist
) - Unfollow Playlist (
UnfollowPlaylist
) - Get Followed Artists (
GetFollowedArtists
) - Follow Artists or Users (
FollowArtistsOrUsers
) - Unfollow Artists or Users (
UnfollowArtistsOrUsers
) - Check if User Follows Artists or Users (
CheckIfUserFollowsArtistsOrUsers
) - Check if Users Follow Playlist (
CheckIfUsersFollowPlaylist
)