Skip to content

dnblankedelman/WebService-Spotify

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NAME

WebService::Spotify - A simple Perl interface to the Spotify Web API

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.

METHODS

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

Refer to the Spotify API documentation 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:

album ($album_id)

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

album_tracks ($album_id)

Get Spotify catalog information about an album's tracks

albums (\@albums)

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

artist ($artist_id)

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

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

Get Spotify catalog information about an artist’s albums

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

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

artists (\@artists)

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

me()

returns info about me

next ($result)

returns the next result given a result

previous ($result)

returns the previous result given a result

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

searches for an item

track ($track_id)

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

tracks (\@track_ids)

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

user ($user_id)

Gets basic profile information about a Spotify User

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

Gets playlist of a user

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

Adds tracks to a playlist

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

Creates a playlist for a user

user_playlists ($user_id)

Gets playlists of a user

AUTHOR

Nick Langridge <[email protected]>

CREDITS

This module was ported from Spotipy, a Python wrapper for the Spotify Web API

LICENSE

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

SEE ALSO

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

Net::Spotify - wrapper for the old Spotify metadata API

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 46:

Non-ASCII character seen before =encoding in 'artist’s'. Assuming UTF-8

About

A simple Perl interface to the Spotify Web API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Perl 63.0%
  • Other 37.0%