Net::iTMS - Interface to the information within the iTunes Music Store (iTMS)


    my $iTMS = Net::iTMS->new;
    my $artist = $iTMS->get_artist(2893902);
    print "Artist: ", $artist->name, "\n";
    for my $album ($artist->discography) {
        print $album->title, "\n";

        for my $track ($album->tracks) {
            print "\t ", $track->number, ": ", $track->title, "\n";


Net::iTMS is the main class (that is, the one you should be using) for interacting with Apple's iTunes Music Store (

Currently, it provides means to access individual artist, album, and song information in the iTMS.


All methods return undef on error and (should) set an error message, which is available through the error method.

new(debug => 1, ...)

Takes an argument list of optional key = value> pairs. The options available are:

debug => 0 or 1

If set to a true value, debug messages to be printed to STDERR.

show_xml => 0 or 1

If set to a true value, Net::iTMS::Request will print to STDERR the XML fetched during each request. The debug option must also be set to true for the XML to print.

Returns a blessed hashref (object) for Net::iTMS.


Takes an artistId and returns a Net::iTMS::Artist object.


Takes a genreId and returns a Net::iTMS::Genre object.


Takes an albumId and returns a Net::iTMS::Album object.


Takes a songId and returns a Net::iTMS::Song object.


If $query is a hashref, this method executes an advanced search using the hashref and returns a Net::iTMS::Search::Advanced object.

Otherwise, this method assumes $query to be a string and executes a simple search using the string and returns a Net::iTMS::Search object. PLEASE NOTE: This simple search does not work at this time due to unresolvable changes in the iTMS. Use the advanced search functionality instead.


        * browse, etc

        * browseAlbum URL... see what information
        * songMetaData... how to use this?  keep getting server errors

    Programmatic tests, instead of hand testing by me.
    Improved caching (more selective updates)
    Redo SYNOPSISes


All bugs, open and resolved, are handled by RT at

Please report all bugs via


Copyright 2004, Thomas R. Sibley.

You may use, modify, and distribute this package under the same terms as Perl itself.


Thomas R. Sibley,