Documentation
¶
Overview ¶
Package spotify is Crawlora's Spotify API client for 38 endpoints, covering search, tracks, albums, artists, playlists, profiles, audiobooks, charts, and podcast shows and episodes. API documentation: https://crawlora.net/docs?utm_source=pkg.go.dev&utm_medium=referral&utm_campaign=platform-clients&utm_content=spotify-go-api-docs
Index ¶
- Constants
- func OperationIDs() []string
- type Client
- func (c *Client) Album(ctx context.Context, params Params) (any, error)
- func (c *Client) AlbumTracks(ctx context.Context, params Params) (any, error)
- func (c *Client) AlbumsSearch(ctx context.Context, params Params) (any, error)
- func (c *Client) Artist(ctx context.Context, params Params) (any, error)
- func (c *Client) ArtistAlbums(ctx context.Context, params Params) (any, error)
- func (c *Client) ArtistPlaylists(ctx context.Context, params Params) (any, error)
- func (c *Client) ArtistRelated(ctx context.Context, params Params) (any, error)
- func (c *Client) ArtistsSearch(ctx context.Context, params Params) (any, error)
- func (c *Client) Audiobook(ctx context.Context, params Params) (any, error)
- func (c *Client) AudiobookChapters(ctx context.Context, params Params) (any, error)
- func (c *Client) AudiobooksSearch(ctx context.Context, params Params) (any, error)
- func (c *Client) Call(ctx context.Context, operationID string, params Params) (any, error)
- func (c *Client) Chapter(ctx context.Context, params Params) (any, error)
- func (c *Client) Close() error
- func (c *Client) EpisodesSearch(ctx context.Context, params Params) (any, error)
- func (c *Client) FeaturedChartsByCountry(ctx context.Context, params Params) (any, error)
- func (c *Client) Genre(ctx context.Context, params Params) (any, error)
- func (c *Client) Home(ctx context.Context, params Params) (any, error)
- func (c *Client) Playlist(ctx context.Context, params Params) (any, error)
- func (c *Client) PlaylistsSearch(ctx context.Context, params Params) (any, error)
- func (c *Client) PodcastsCategories(ctx context.Context, params Params) (any, error)
- func (c *Client) PodcastsCharts(ctx context.Context, params Params) (any, error)
- func (c *Client) PodcastsEpisode(ctx context.Context, params Params) (any, error)
- func (c *Client) PodcastsHome(ctx context.Context, params Params) (any, error)
- func (c *Client) PodcastsSearch(ctx context.Context, params Params) (any, error)
- func (c *Client) PodcastsShow(ctx context.Context, params Params) (any, error)
- func (c *Client) PodcastsShowEpisodes(ctx context.Context, params Params) (any, error)
- func (c *Client) PodcastsShowRecommendations(ctx context.Context, params Params) (any, error)
- func (c *Client) PopularByCountry(ctx context.Context, params Params) (any, error)
- func (c *Client) Profile(ctx context.Context, params Params) (any, error)
- func (c *Client) ProfileFollowers(ctx context.Context, params Params) (any, error)
- func (c *Client) ProfilePlaylists(ctx context.Context, params Params) (any, error)
- func (c *Client) ProfilesSearch(ctx context.Context, params Params) (any, error)
- func (c *Client) Search(ctx context.Context, params Params) (any, error)
- func (c *Client) Section(ctx context.Context, params Params) (any, error)
- func (c *Client) ShowsSearch(ctx context.Context, params Params) (any, error)
- func (c *Client) Track(ctx context.Context, params Params) (any, error)
- func (c *Client) TrackRecommended(ctx context.Context, params Params) (any, error)
- func (c *Client) TrackSimilarAlbums(ctx context.Context, params Params) (any, error)
- func (c *Client) TracksSearch(ctx context.Context, params Params) (any, error)
- type Params
Examples ¶
Constants ¶
const ( DefaultBaseURL = "https://api.crawlora.net/api/v1" Version = "0.2.0" )
const OperationCount = 38
OperationCount reports how many selected-platform operations this module exposes.
Variables ¶
This section is empty.
Functions ¶
func OperationIDs ¶
func OperationIDs() []string
OperationIDs returns the selected operation IDs in stable sorted order.
Types ¶
type Client ¶
Client calls only the operation IDs included in this platform module.
func NewClient ¶
NewClient creates a client using the supplied API key, or CRAWLORA_API_KEY when empty.
func (*Client) AlbumTracks ¶
AlbumTracks calls the spotify-album-tracks operation.
func (*Client) AlbumsSearch ¶
AlbumsSearch calls the spotify-albums-search operation.
func (*Client) ArtistAlbums ¶
ArtistAlbums calls the spotify-artist-albums operation.
func (*Client) ArtistPlaylists ¶
ArtistPlaylists calls the spotify-artist-playlists operation.
func (*Client) ArtistRelated ¶
ArtistRelated calls the spotify-artist-related operation.
func (*Client) ArtistsSearch ¶
ArtistsSearch calls the spotify-artists-search operation.
func (*Client) AudiobookChapters ¶
AudiobookChapters calls the spotify-audiobook-chapters operation.
func (*Client) AudiobooksSearch ¶
AudiobooksSearch calls the spotify-audiobooks-search operation.
func (*Client) Call ¶
Call executes a selected platform operation by operation ID.
Example ¶
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
w.Header().Set("Content-Type", "application/json")
_, _ = w.Write([]byte(`{"ok":true}`))
}))
defer server.Close()
client := NewClient("your-crawlora-api-key")
client.BaseURL = server.URL + "/api/v1"
client.HTTPClient = server.Client()
result, err := client.Call(context.Background(), "spotify-podcasts-categories", Params{})
if err != nil {
panic(err)
}
fmt.Println(result.(map[string]any)["ok"])
Output: true
func (*Client) EpisodesSearch ¶
EpisodesSearch calls the spotify-episodes-search operation.
func (*Client) FeaturedChartsByCountry ¶
FeaturedChartsByCountry calls the spotify-featured-charts-by-country operation.
func (*Client) PlaylistsSearch ¶
PlaylistsSearch calls the spotify-playlists-search operation.
func (*Client) PodcastsCategories ¶
PodcastsCategories calls the spotify-podcasts-categories operation.
func (*Client) PodcastsCharts ¶
PodcastsCharts calls the spotify-podcasts-charts operation.
func (*Client) PodcastsEpisode ¶
PodcastsEpisode calls the spotify-podcasts-episode operation.
func (*Client) PodcastsHome ¶
PodcastsHome calls the spotify-podcasts-home operation.
func (*Client) PodcastsSearch ¶
PodcastsSearch calls the spotify-podcasts-search operation.
func (*Client) PodcastsShow ¶
PodcastsShow calls the spotify-podcasts-show operation.
func (*Client) PodcastsShowEpisodes ¶
PodcastsShowEpisodes calls the spotify-podcasts-show-episodes operation.
func (*Client) PodcastsShowRecommendations ¶
PodcastsShowRecommendations calls the spotify-podcasts-show-recommendations operation.
func (*Client) PopularByCountry ¶
PopularByCountry calls the spotify-popular-by-country operation.
func (*Client) ProfileFollowers ¶
ProfileFollowers calls the spotify-profile-followers operation.
func (*Client) ProfilePlaylists ¶
ProfilePlaylists calls the spotify-profile-playlists operation.
func (*Client) ProfilesSearch ¶
ProfilesSearch calls the spotify-profiles-search operation.
func (*Client) ShowsSearch ¶
ShowsSearch calls the spotify-shows-search operation.
func (*Client) TrackRecommended ¶
TrackRecommended calls the spotify-track-recommended operation.
func (*Client) TrackSimilarAlbums ¶
TrackSimilarAlbums calls the spotify-track-similar-albums operation.