The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


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


Version 0.03


    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(
        q => 'hendrix'


This module provides a simple interface to the Spotify Metadata 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.



Class constructor.

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

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



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


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


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

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

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



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


Mandatory, it's the search string.


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


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


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


Edoardo Sabadelli, <edoardo at>


Please report any bugs or feature requests to bug-net-spotify at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


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

    perldoc Net::Spotify

You can also look for information at:


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 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.