NAME

Net::Spotify - Perl interface to the Spotify Metadata API

VERSION

Version 0.03

SYNOPSIS

use Net::Spotify;

my $spotify = Net::Spotify->new();

# lookup a track
my $track_xml = $spotify->lookup(
    uri => 'spotify:track:6NmXV4o6bmp704aPGyTVVG'
);

# search an artist
my $artist_xml = $spotify->search(
    'artist',
    q => 'hendrix'
);

DESCRIPTION

This module provides a simple interface to the Spotify Metadata API https://developer.spotify.com/technologies/web-api/. The API allows to explore Spotify's music catalogue. It is possible to lookup a specific Spotify URI and retrieve various information about the resource it represents, and search for artists, albums and tracks. The output is in XML format.

METHODS

new

Class constructor.

lookup(uri => $uri [, extras => $extras])

Performs a lookup on a specific Spotify URI. Net::Spotify::Lookup is used for handling the request.

Parameters

$uri

Mandatory, represents the Spotify URI. Example: spotify:artist:4YrKBkKSVeqDamzBPWVnSJ

$extras

Optional, a comma separated list of words that defines the detail level in the response. Allowed values depend on the Spotify URI type.

For album: track and trackdetail For artist: album and albumdetail For track: none

Example

# lookup an album and retrieve detailed information about all its tracks
$spotify->lookup(
    uri => 'spotify:album:6G9fHYDCoyEErUkHrFYfs4',
    extras => 'trackdetail'
);

search($method, q => $query [, page => $page])

Performs a search. Net::Spotify::Search is used for handling the request.

Parameters

$method

Mandatory, represent the type of search. Possible values are: album, artist, track.

$query

Mandatory, it's the search string.

$page

Optional, represent the page of the resultset to return, defaults to 1.

Example

# search all the tracks where the track name, artist or album matches the
# the query string (purple) and return the results in page 2
$spotify->search(
    'track',
    q => 'purple',
    page => 2
);

SEE ALSO

Net::Spotify::Service, Net::Spotify::Lookup, Net::Spotify::Search

AUTHOR

Edoardo Sabadelli, <edoardo at cpan.org>

BUGS

Please report any bugs or feature requests to bug-net-spotify at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-Spotify. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Net::Spotify

You can also look for information at:

ACKNOWLEDGEMENTS

This product uses a SPOTIFY API but is not endorsed, certified or otherwise approved in any way by Spotify. Spotify is the registered trade mark of the Spotify Group.

COPYRIGHT & LICENSE

Copyright 2009 Edoardo Sabadelli, all rights reserved.

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