Last.fm Web Services

user.getArtistTracks

Get a list of tracks by a given artist scrobbled by this user, including scrobble time. Can be limited to specific timeranges, defaults to all time.

Example URLs

JSON: /2.0/?method=user.getartisttracks&user=rj&artist=metallica&api_key=YOUR_API_KEY&fo...
XML: /2.0/?method=user.getartisttracks&user=rj&artist=metallica&api_key=YOUR_API_KEY

Params

user (Required) : The last.fm username to fetch the recent tracks of.
artist (Required) : The artist name you are interested in
startTimestamp (Optional) : An unix timestamp to start at.
page (Optional) : The page number to fetch. Defaults to first page.
endTimestamp (Optional) : An unix timestamp to end at.
api_key (Required) : A Last.fm API key.

Auth

This service does not require authentication.

Sample Response

<?xml version="1.0" encoding="utf-8"?>
    <lfm status="ok">
        <artisttracks user="RJ" artist="Metallica" page="1" perPage="50" totalPages="6" items="278">
            <track> 
                <artist mbid="65f4f0c5-ef9e-490c-aee3-909e7ae6b2ab">Metallica</artist>
                <name>Better Than You</name>
                <streamable>0</streamable>
                <mbid></mbid>
                <album mbid="b05cf8e3-67ad-4d40-9dc1-3a697e3a1bf8">Reload</album>
                <url>http://www.last.fm/music/Metallica/_/Better+Than+You</url>
                <image size="small">http://userserve-ak.last.fm/serve/34s/8600317.jpg</image>
                <image size="medium">http://userserve-ak.last.fm/serve/64s/8600317.jpg</image>
                <image size="large">http://userserve-ak.last.fm/serve/126/8600317.jpg</image>
                <image size="extralarge">http://userserve-ak.last.fm/serve/300x300/8600317.jpg</image>
                <date uts="1262887346">7 Jan 2010, 18:02</date>
        </track>
        ...
</artisttracks>
</lfm>

Errors

  • 2 : Invalid service - This service does not exist
  • 3 : Invalid Method - No method with that name in this package
  • 4 : Authentication Failed - You do not have permissions to access the service
  • 5 : Invalid format - This service doesn't exist in that format
  • 6 : Invalid parameters - Your request is missing a required parameter
  • 7 : Invalid resource specified
  • 8 : Operation failed - Something else went wrong
  • 9 : Invalid session key - Please re-authenticate
  • 10 : Invalid API key - You must be granted a valid key by last.fm
  • 11 : Service Offline - This service is temporarily offline. Try again later.
  • 13 : Invalid method signature supplied
  • 16 : There was a temporary error processing your request. Please try again
  • 26 : Suspended API key - Access for your account has been suspended, please contact Last.fm
  • 29 : Rate limit exceeded - Your IP has made too many requests in a short period