=head1 NAME

WebService::Spotify - A simple Perl interface to the  L<Spotify Web API|https://developer.spotify.com/web-api/>

=head1 SYNOPSIS

  my $spotify = WebService::Spotify->new;
  my $results = $spotify->search('weezer', limit => 20);
  say $_->{name} for @{$results->{tracks}->{items}};
  

More examples can be found in the eg/ directory.

=head1 METHODS

See L<Method::Signatures> for details of the parameter spec used below. 

Refer to the L<Spotify API documentation|https://developer.spotify.com/spotify-web-api/> for details on the methods and parameters.

Methods that take item IDs (such as the track, album and artist methods) accept URN, URL or simple ID types. The following 3 ids are all acceptable IDs:

 http://open.spotify.com/track/3HfB5hBU0dmBt8T0iCmH42
 spotify:track:3HfB5hBU0dmBt8T0iCmH42
 3HfB5hBU0dmBt8T0iCmH42

The following methods are supported:

=head4 album ($album_id)

returns a single album given the album's ID, URN or URL

=head4 album_tracks ($album_id)

Get Spotify catalog information about an album's tracks

=head4 albums (\@albums)

returns a list of albums given the album IDs, URNs, or URLs

=head4 artist ($artist_id)

returns a single artist given the artist's ID, URN or URL

=head4 artist_albums ($artist, :$album_type, :$country, :$limit = 20, :$offset = 0)

Get Spotify catalog information about an artist’s albums

=head4 artist_top_tracks ($artist, :$country = 'US')

Get Spotify catalog information about an artist’s top 10 tracks by country.

=head4 artists (\@artists)

returns a list of artists given the artist IDs, URNs, or URLs

=head4 me()

returns info about me

=head4 next ($result)

returns the next result given a result

=head4 previous ($result)

returns the previous result given a result

=head4 search ($q, limit => 10, offset => 0, type => 'track')

searches for an item

=head4 track ($track_id)

returns a single track given the track's ID, URN or URL

=head4 tracks (\@track_ids)

returns a list of tracks given the track IDs, URNs, or URLs

=head4 user ($user_id)

Gets basic profile information about a Spotify User

=head4 user_playlist ($user_id, :$playlist_id, :$fields)

Gets playlist of a user

=head4 user_playlist_add_tracks ($user_id, $playlist_id, $tracks, :$position)

Adds tracks to a playlist

=head4 user_playlist_create ($user_id, $name, :$public = 1)

Creates a playlist for a user

=head4 user_playlists ($user_id)

Gets playlists of a user


=head1 AUTHOR

Nick Langridge <nickl@cpan.org>

=head1 CREDITS

This module was ported from L<Spotipy|https://github.com/plamere/spotipy>, a Python wrapper for the Spotify Web API

=head1 LICENSE

This module is free software; you can redistribute it or 
modify it under the same terms as Perl itself.

=head1 SEE ALSO

L<WebService::EchoNest> - wrapper for the EchoNest API which has some integration with the Spotify Web API

L<Net::Spotify> - wrapper for the old Spotify metadata API
