#!/usr/local/bin/perl -w use strict; use LWP::UserAgent; use JSON qw( from_json ); my $ua = LWP::UserAgent->new(); my $resp = $ua->get( "https://api.spotify.com/v1/search?" . "q=weezer&type=track" ); my $data = from_json( $resp->content() ); for my $item ( @{ $data->{ tracks }->{ items } } ) { print "$item->{ name } ", "($item->{ album }->{ name })\n"; }