Versions in this module Expand all Collapse all v2 v2.0.3 Dec 12, 2021 v2.0.2 Dec 12, 2021 v2.0.1 Dec 12, 2021 Changes in this version + const CountryArgentina + const CountryAustralia + const CountryAustria + const CountryBelarus + const CountryBelgium + const CountryBrazil + const CountryCanada + const CountryChile + const CountryChina + const CountryFinland + const CountryFrance + const CountryGermany + const CountryHongKong + const CountryIndia + const CountryIreland + const CountryItaly + const CountryJapan + const CountryMexico + const CountryNewZealand + const CountryRussia + const CountrySpain + const CountrySwitzerland + const CountryUSA + const CountryUnitedArabEmirates + const CountryUnitedKingdom + const DateLayout + const MarketFromToken + const MaxNumberOfSeeds + const SearchTypeAlbum + const SearchTypeArtist + const SearchTypePlaylist + const SearchTypeTrack + const TimestampLayout + const Version + var ErrNoMorePages = errors.New("spotify: no more pages") + type AlbumType int + const AlbumTypeAlbum + const AlbumTypeAppearsOn + const AlbumTypeCompilation + const AlbumTypeSingle + type AnalysisMeta struct + AnalysisTime float64 + AnalyzerVersion string + DetailedStatus string + InputProcess string + Platform string + StatusCode int + Timestamp int64 + type AnalysisTrack struct + AnalysisChannels int + AnalysisSampleRate int64 + CodeString string + CodeVersion float64 + Duration float64 + EchoprintString string + EchoprintVersion float64 + EndOfFadeIn float64 + Key Key + KeyConfidence float64 + Loudness float64 + Mode Mode + ModeConfidence float64 + NumSamples int64 + OffsetSeconds int + RhythmString string + RhythmVersion float64 + SampleMD5 string + StartOfFadeOut float64 + SynchString string + SynchVersion float64 + Tempo float64 + TempoConfidence float64 + TimeSignature int + TimeSignatureConfidence float64 + WindowSeconds int + type AudioAnalysis struct + Bars []Marker + Beats []Marker + Meta AnalysisMeta + Sections []Section + Segments []Segment + Tatums []Marker + Track AnalysisTrack + type AudioFeatures struct + Acousticness float32 + AnalysisURL string + Danceability float32 + Duration int + Energy float32 + ID ID + Instrumentalness float32 + Key int + Liveness float32 + Loudness float32 + Mode int + Speechiness float32 + Tempo float32 + TimeSignature int + TrackURL string + URI URI + Valence float32 + type Category struct + Endpoint string + ID string + Icons []Image + Name string + type CategoryPage struct + Categories []Category + type Client struct + func New(httpClient *http.Client, opts ...ClientOption) *Client + func (c *Client) AddAlbumsToLibrary(ctx context.Context, ids ...ID) error + func (c *Client) AddTracksToLibrary(ctx context.Context, ids ...ID) error + func (c *Client) AddTracksToPlaylist(ctx context.Context, playlistID ID, trackIDs ...ID) (snapshotID string, err error) + func (c *Client) ChangePlaylistAccess(ctx context.Context, playlistID ID, public bool) error + func (c *Client) ChangePlaylistDescription(ctx context.Context, playlistID ID, newDescription string) error + func (c *Client) ChangePlaylistName(ctx context.Context, playlistID ID, newName string) error + func (c *Client) ChangePlaylistNameAccessAndDescription(ctx context.Context, playlistID ID, newName, newDescription string, ...) error + func (c *Client) ChangePlaylistNameAndAccess(ctx context.Context, playlistID ID, newName string, public bool) error + func (c *Client) CreatePlaylistForUser(ctx context.Context, userID, playlistName, description string, public bool, ...) (*FullPlaylist, error) + func (c *Client) CurrentUser(ctx context.Context) (*PrivateUser, error) + func (c *Client) CurrentUserFollows(ctx context.Context, t string, ids ...ID) ([]bool, error) + func (c *Client) CurrentUsersAlbums(ctx context.Context, opts ...RequestOption) (*SavedAlbumPage, error) + func (c *Client) CurrentUsersFollowedArtists(ctx context.Context, opts ...RequestOption) (*FullArtistCursorPage, error) + func (c *Client) CurrentUsersPlaylists(ctx context.Context, opts ...RequestOption) (*SimplePlaylistPage, error) + func (c *Client) CurrentUsersShows(ctx context.Context, opts ...RequestOption) (*SavedShowPage, error) + func (c *Client) CurrentUsersTopArtists(ctx context.Context, opts ...RequestOption) (*FullArtistPage, error) + func (c *Client) CurrentUsersTopTracks(ctx context.Context, opts ...RequestOption) (*FullTrackPage, error) + func (c *Client) CurrentUsersTracks(ctx context.Context, opts ...RequestOption) (*SavedTrackPage, error) + func (c *Client) FeaturedPlaylists(ctx context.Context, opts ...RequestOption) (message string, playlists *SimplePlaylistPage, e error) + func (c *Client) FollowArtist(ctx context.Context, ids ...ID) error + func (c *Client) FollowPlaylist(ctx context.Context, playlist ID, public bool) error + func (c *Client) FollowUser(ctx context.Context, ids ...ID) error + func (c *Client) GetAlbum(ctx context.Context, id ID, opts ...RequestOption) (*FullAlbum, error) + func (c *Client) GetAlbumTracks(ctx context.Context, id ID, opts ...RequestOption) (*SimpleTrackPage, error) + func (c *Client) GetAlbums(ctx context.Context, ids []ID, opts ...RequestOption) ([]*FullAlbum, error) + func (c *Client) GetArtist(ctx context.Context, id ID) (*FullArtist, error) + func (c *Client) GetArtistAlbums(ctx context.Context, artistID ID, ts []AlbumType, opts ...RequestOption) (*SimpleAlbumPage, error) + func (c *Client) GetArtists(ctx context.Context, ids ...ID) ([]*FullArtist, error) + func (c *Client) GetArtistsTopTracks(ctx context.Context, artistID ID, country string) ([]FullTrack, error) + func (c *Client) GetAudioAnalysis(ctx context.Context, id ID) (*AudioAnalysis, error) + func (c *Client) GetAudioFeatures(ctx context.Context, ids ...ID) ([]*AudioFeatures, error) + func (c *Client) GetAvailableGenreSeeds(ctx context.Context) ([]string, error) + func (c *Client) GetCategories(ctx context.Context, opts ...RequestOption) (*CategoryPage, error) + func (c *Client) GetCategory(ctx context.Context, id string, opts ...RequestOption) (Category, error) + func (c *Client) GetCategoryPlaylists(ctx context.Context, catID string, opts ...RequestOption) (*SimplePlaylistPage, error) + func (c *Client) GetPlaylist(ctx context.Context, playlistID ID, opts ...RequestOption) (*FullPlaylist, error) + func (c *Client) GetPlaylistTracks(ctx context.Context, playlistID ID, opts ...RequestOption) (*PlaylistTrackPage, error) + func (c *Client) GetPlaylistsForUser(ctx context.Context, userID string, opts ...RequestOption) (*SimplePlaylistPage, error) + func (c *Client) GetRecommendations(ctx context.Context, seeds Seeds, trackAttributes *TrackAttributes, ...) (*Recommendations, error) + func (c *Client) GetRelatedArtists(ctx context.Context, id ID) ([]FullArtist, error) + func (c *Client) GetShow(ctx context.Context, id ID, opts ...RequestOption) (*FullShow, error) + func (c *Client) GetShowEpisodes(ctx context.Context, id string, opts ...RequestOption) (*SimpleEpisodePage, error) + func (c *Client) GetTrack(ctx context.Context, id ID, opts ...RequestOption) (*FullTrack, error) + func (c *Client) GetTracks(ctx context.Context, ids []ID, opts ...RequestOption) ([]*FullTrack, error) + func (c *Client) GetUsersPublicProfile(ctx context.Context, userID ID) (*User, error) + func (c *Client) NewReleases(ctx context.Context, opts ...RequestOption) (albums *SimpleAlbumPage, err error) + func (c *Client) Next(ctx context.Context) error + func (c *Client) NextAlbumResults(ctx context.Context, s *SearchResult) error + func (c *Client) NextArtistResults(ctx context.Context, s *SearchResult) error + func (c *Client) NextOpt(ctx context.Context, opt *PlayOptions) error + func (c *Client) NextPage(ctx context.Context, p pageable) error + func (c *Client) NextPlaylistResults(ctx context.Context, s *SearchResult) error + func (c *Client) NextTrackResults(ctx context.Context, s *SearchResult) error + func (c *Client) Pause(ctx context.Context) error + func (c *Client) PauseOpt(ctx context.Context, opt *PlayOptions) error + func (c *Client) Play(ctx context.Context) error + func (c *Client) PlayOpt(ctx context.Context, opt *PlayOptions) error + func (c *Client) PlayerCurrentlyPlaying(ctx context.Context, opts ...RequestOption) (*CurrentlyPlaying, error) + func (c *Client) PlayerDevices(ctx context.Context) ([]PlayerDevice, error) + func (c *Client) PlayerRecentlyPlayed(ctx context.Context) ([]RecentlyPlayedItem, error) + func (c *Client) PlayerRecentlyPlayedOpt(ctx context.Context, opt *RecentlyPlayedOptions) ([]RecentlyPlayedItem, error) + func (c *Client) PlayerState(ctx context.Context, opts ...RequestOption) (*PlayerState, error) + func (c *Client) Previous(ctx context.Context) error + func (c *Client) PreviousAlbumResults(ctx context.Context, s *SearchResult) error + func (c *Client) PreviousArtistResults(ctx context.Context, s *SearchResult) error + func (c *Client) PreviousOpt(ctx context.Context, opt *PlayOptions) error + func (c *Client) PreviousPage(ctx context.Context, p pageable) error + func (c *Client) PreviousPlaylistResults(ctx context.Context, s *SearchResult) error + func (c *Client) PreviousTrackResults(ctx context.Context, s *SearchResult) error + func (c *Client) QueueSong(ctx context.Context, trackID ID) error + func (c *Client) QueueSongOpt(ctx context.Context, trackID ID, opt *PlayOptions) error + func (c *Client) RemoveAlbumsFromLibrary(ctx context.Context, ids ...ID) error + func (c *Client) RemoveTracksFromLibrary(ctx context.Context, ids ...ID) error + func (c *Client) RemoveTracksFromPlaylist(ctx context.Context, playlistID ID, trackIDs ...ID) (newSnapshotID string, err error) + func (c *Client) RemoveTracksFromPlaylistOpt(ctx context.Context, playlistID ID, tracks []TrackToRemove, snapshotID string) (newSnapshotID string, err error) + func (c *Client) ReorderPlaylistTracks(ctx context.Context, playlistID ID, opt PlaylistReorderOptions) (snapshotID string, err error) + func (c *Client) Repeat(ctx context.Context, state string) error + func (c *Client) RepeatOpt(ctx context.Context, state string, opt *PlayOptions) error + func (c *Client) ReplacePlaylistTracks(ctx context.Context, playlistID ID, trackIDs ...ID) error + func (c *Client) Search(ctx context.Context, query string, t SearchType, opts ...RequestOption) (*SearchResult, error) + func (c *Client) Seek(ctx context.Context, position int) error + func (c *Client) SeekOpt(ctx context.Context, position int, opt *PlayOptions) error + func (c *Client) SetPlaylistImage(ctx context.Context, playlistID ID, img io.Reader) error + func (c *Client) Shuffle(ctx context.Context, shuffle bool) error + func (c *Client) ShuffleOpt(ctx context.Context, shuffle bool, opt *PlayOptions) error + func (c *Client) Token() (*oauth2.Token, error) + func (c *Client) TransferPlayback(ctx context.Context, deviceID ID, play bool) error + func (c *Client) UnfollowArtist(ctx context.Context, ids ...ID) error + func (c *Client) UnfollowPlaylist(ctx context.Context, playlist ID) error + func (c *Client) UnfollowUser(ctx context.Context, ids ...ID) error + func (c *Client) UserFollowsPlaylist(ctx context.Context, playlistID ID, userIDs ...string) ([]bool, error) + func (c *Client) UserHasAlbums(ctx context.Context, ids ...ID) ([]bool, error) + func (c *Client) UserHasTracks(ctx context.Context, ids ...ID) ([]bool, error) + func (c *Client) Volume(ctx context.Context, percent int) error + func (c *Client) VolumeOpt(ctx context.Context, percent int, opt *PlayOptions) error + type ClientOption func(client *Client) + func WithAcceptLanguage(lang string) ClientOption + func WithBaseURL(url string) ClientOption + func WithRetry(shouldRetry bool) ClientOption + type Copyright struct + Text string + Type string + type CurrentlyPlaying struct + Item *FullTrack + PlaybackContext PlaybackContext + Playing bool + Progress int + Timestamp int64 + type Cursor struct + After string + type EpisodePage struct + AudioPreviewURL string + Description string + Duration_ms int + Explicit bool + ExternalURLs map[string]string + Href string + ID ID + Images []Image + IsExternallyHosted bool + IsPlayable bool + Languages []string + Name string + ReleaseDate string + ReleaseDatePrecision string + ResumePoint ResumePointObject + Show SimpleShow + Type string + URI URI + func (e *EpisodePage) ReleaseDateTime() time.Time + type Error struct + Message string + Status int + func (e Error) Error() string + type Followers struct + Count uint + Endpoint string + type FullAlbum struct + Copyrights []Copyright + ExternalIDs map[string]string + Genres []string + Popularity int + Tracks SimpleTrackPage + type FullArtist struct + Followers Followers + Genres []string + Images []Image + Popularity int + type FullArtistCursorPage struct + Artists []FullArtist + type FullArtistPage struct + Artists []FullArtist + type FullPlaylist struct + Description string + Followers Followers + Tracks PlaylistTrackPage + type FullShow struct + Episodes SimpleEpisodePage + type FullTrack struct + Album SimpleAlbum + ExternalIDs map[string]string + IsPlayable *bool + LinkedFrom *LinkedFromInfo + Popularity int + type FullTrackPage struct + Tracks []FullTrack + type ID string + func (id *ID) String() string + type Image struct + Height int + URL string + Width int + func (i Image) Download(dst io.Writer) error + type Key int + const A + const AFlat + const ASharp + const B + const BFlat + const C + const CSharp + const D + const DFlat + const DSharp + const E + const EFlat + const F + const FSharp + const G + const GFlat + const GSharp + type LinkedFromInfo struct + ExternalURLs map[string]string + Href string + ID ID + Type string + URI string + type Marker struct + Confidence float64 + Duration float64 + Start float64 + type Mode int + const Major + const Minor + type PlayOptions struct + DeviceID *ID + PlaybackContext *URI + PlaybackOffset *PlaybackOffset + PositionMs int + URIs []URI + type PlaybackContext struct + Endpoint string + ExternalURLs map[string]string + Type string + URI URI + type PlaybackOffset struct + Position int + URI URI + type PlayerDevice struct + Active bool + ID ID + Name string + Restricted bool + Type string + Volume int + type PlayerState struct + Device PlayerDevice + RepeatState string + ShuffleState bool + type PlaylistReorderOptions struct + InsertBefore int + RangeLength int + RangeStart int + SnapshotID string + type PlaylistTrack struct + AddedAt string + AddedBy User + IsLocal bool + Track FullTrack + type PlaylistTrackPage struct + Tracks []PlaylistTrack + type PlaylistTracks struct + Endpoint string + Total uint + type PrivateUser struct + Birthdate string + Country string + Email string + Product string + type Range string + const LongTermRange + const MediumTermRange + const ShortTermRange + type RecentlyPlayedItem struct + PlaybackContext PlaybackContext + PlayedAt time.Time + Track SimpleTrack + type RecentlyPlayedOptions struct + AfterEpochMs int64 + BeforeEpochMs int64 + Limit int + type RecentlyPlayedResult struct + Items []RecentlyPlayedItem + type RecommendationSeed struct + AfterFilteringSize int + AfterRelinkingSize int + Endpoint string + ID ID + InitialPoolSize int + Type string + type Recommendations struct + Seeds []RecommendationSeed + Tracks []SimpleTrack + type RequestOption func(*requestOptions) + func After(after string) RequestOption + func Country(code string) RequestOption + func Fields(fields string) RequestOption + func Limit(amount int) RequestOption + func Locale(code string) RequestOption + func Market(code string) RequestOption + func Offset(amount int) RequestOption + func Timerange(timerange Range) RequestOption + func Timestamp(ts string) RequestOption + type ResumePointObject struct + FullyPlayed bool + ResumePositionMs int + type SavedAlbum struct + AddedAt string + type SavedAlbumPage struct + Albums []SavedAlbum + type SavedShow struct + AddedAt string + type SavedShowPage struct + Shows []SavedShow + type SavedTrack struct + AddedAt string + type SavedTrackPage struct + Tracks []SavedTrack + type SearchResult struct + Albums *SimpleAlbumPage + Artists *FullArtistPage + Playlists *SimplePlaylistPage + Tracks *FullTrackPage + type SearchType int + type Section struct + Key Key + KeyConfidence float64 + Loudness float64 + Mode Mode + ModeConfidence float64 + Tempo float64 + TempoConfidence float64 + TimeSignature int + TimeSignatureConfidence float64 + type Seeds struct + Artists []ID + Genres []string + Tracks []ID + type Segment struct + LoudnessEnd float64 + LoudnessMax float64 + LoudnessMaxTime float64 + LoudnessStart float64 + Pitches []float64 + Timbre []float64 + type SimpleAlbum struct + AlbumGroup string + AlbumType string + Artists []SimpleArtist + AvailableMarkets []string + Endpoint string + ExternalURLs map[string]string + ID ID + Images []Image + Name string + ReleaseDate string + ReleaseDatePrecision string + URI URI + func (s *SimpleAlbum) ReleaseDateTime() time.Time + type SimpleAlbumPage struct + Albums []SimpleAlbum + type SimpleArtist struct + Endpoint string + ExternalURLs map[string]string + ID ID + Name string + URI URI + type SimpleEpisodePage struct + Episodes []EpisodePage + type SimplePlaylist struct + Collaborative bool + Endpoint string + ExternalURLs map[string]string + ID ID + Images []Image + IsPublic bool + Name string + Owner User + SnapshotID string + Tracks PlaylistTracks + URI URI + type SimplePlaylistPage struct + Playlists []SimplePlaylist + type SimpleShow struct + AvailableMarkets []string + Copyrights []Copyright + Description string + Explicit bool + ExternalURLs map[string]string + Href string + ID ID + Images []Image + IsExternallyHosted *bool + Languages []string + MediaType string + Name string + Publisher string + Type string + URI URI + type SimpleTrack struct + Artists []SimpleArtist + AvailableMarkets []string + DiscNumber int + Duration int + Endpoint string + Explicit bool + ExternalURLs map[string]string + ID ID + Name string + PreviewURL string + TrackNumber int + Type string + URI URI + func (st SimpleTrack) String() string + func (t *SimpleTrack) TimeDuration() time.Duration + type SimpleTrackPage struct + Tracks []SimpleTrack + type TrackAttributes struct + func NewTrackAttributes() *TrackAttributes + func (ta *TrackAttributes) MaxAcousticness(acousticness float64) *TrackAttributes + func (ta *TrackAttributes) MaxDanceability(danceability float64) *TrackAttributes + func (ta *TrackAttributes) MaxDuration(duration int) *TrackAttributes + func (ta *TrackAttributes) MaxEnergy(energy float64) *TrackAttributes + func (ta *TrackAttributes) MaxInstrumentalness(instrumentalness float64) *TrackAttributes + func (ta *TrackAttributes) MaxKey(key int) *TrackAttributes + func (ta *TrackAttributes) MaxLiveness(liveness float64) *TrackAttributes + func (ta *TrackAttributes) MaxLoudness(loudness float64) *TrackAttributes + func (ta *TrackAttributes) MaxMode(mode int) *TrackAttributes + func (ta *TrackAttributes) MaxPopularity(popularity int) *TrackAttributes + func (ta *TrackAttributes) MaxSpeechiness(speechiness float64) *TrackAttributes + func (ta *TrackAttributes) MaxTempo(tempo float64) *TrackAttributes + func (ta *TrackAttributes) MaxTimeSignature(timeSignature int) *TrackAttributes + func (ta *TrackAttributes) MaxValence(valence float64) *TrackAttributes + func (ta *TrackAttributes) MinAcousticness(acousticness float64) *TrackAttributes + func (ta *TrackAttributes) MinDanceability(danceability float64) *TrackAttributes + func (ta *TrackAttributes) MinDuration(duration int) *TrackAttributes + func (ta *TrackAttributes) MinEnergy(energy float64) *TrackAttributes + func (ta *TrackAttributes) MinInstrumentalness(instrumentalness float64) *TrackAttributes + func (ta *TrackAttributes) MinKey(key int) *TrackAttributes + func (ta *TrackAttributes) MinLiveness(liveness float64) *TrackAttributes + func (ta *TrackAttributes) MinLoudness(loudness float64) *TrackAttributes + func (ta *TrackAttributes) MinMode(mode int) *TrackAttributes + func (ta *TrackAttributes) MinPopularity(popularity int) *TrackAttributes + func (ta *TrackAttributes) MinSpeechiness(speechiness float64) *TrackAttributes + func (ta *TrackAttributes) MinTempo(tempo float64) *TrackAttributes + func (ta *TrackAttributes) MinTimeSignature(timeSignature int) *TrackAttributes + func (ta *TrackAttributes) MinValence(valence float64) *TrackAttributes + func (ta *TrackAttributes) TargetAcousticness(acousticness float64) *TrackAttributes + func (ta *TrackAttributes) TargetDanceability(danceability float64) *TrackAttributes + func (ta *TrackAttributes) TargetDuration(duration int) *TrackAttributes + func (ta *TrackAttributes) TargetEnergy(energy float64) *TrackAttributes + func (ta *TrackAttributes) TargetInstrumentalness(instrumentalness float64) *TrackAttributes + func (ta *TrackAttributes) TargetKey(key int) *TrackAttributes + func (ta *TrackAttributes) TargetLiveness(liveness float64) *TrackAttributes + func (ta *TrackAttributes) TargetLoudness(loudness float64) *TrackAttributes + func (ta *TrackAttributes) TargetMode(mode int) *TrackAttributes + func (ta *TrackAttributes) TargetPopularity(popularity int) *TrackAttributes + func (ta *TrackAttributes) TargetSpeechiness(speechiness float64) *TrackAttributes + func (ta *TrackAttributes) TargetTempo(tempo float64) *TrackAttributes + func (ta *TrackAttributes) TargetTimeSignature(timeSignature int) *TrackAttributes + func (ta *TrackAttributes) TargetValence(valence float64) *TrackAttributes + type TrackToRemove struct + Positions []int + URI string + func NewTrackToRemove(trackID string, positions []int) TrackToRemove + type URI string + type User struct + DisplayName string + Endpoint string + ExternalURLs map[string]string + Followers Followers + ID string + Images []Image + URI URI