Exploring the Last.fm API - What does the world scrobble?

Last.fm is a music website that allows users to track their listening activity across multiple listening platform and provides composite statistics on users listening behaviour and provides recommendations to users based on their listening habits. The process of a song listening being recorded on last.fm is called a scrobble.

The website has an API which allows token-authenticated users to request various sets of information on tracks, artists, albums amongst other things either at an individual website user level or aggregate statistics from multiple users.

One of the available API methods is to get the top artists for a specified country. I decided to do this to get the artist with the most listeners for each country for which data is available. Remember that this is only of unique last.fm users so if the fans of different artists have variable affinities towards using a site like last.fm (as you would imagine they certainly would) then the map below would be influenced by that as well as, of course, by how much people like the given artist.

Artist with most last.fm listeners by country

Another API method allows you to get the top artists on the last.fm chart, the returned response gives you the number of listeners and also the playcount. I retrieved this data for the top 2000 artists on the last .fm chart and plotted the top 20 for each in the below plots.

Artist with most last.fm listeners by country Artist with most last.fm listeners by country

I also created a plays per listener statistic to see to what degree listeners are obsessed with the top artists. The top 20 for this statistic are shown in the plot below.

Artist with most last.fm listeners by country

A further API method available allows you to get the complete listening history (or a time interval thereof) for a specified user. I started using last.fm in late 2014 so I decided to retrieve my complete listening history in order to look at my daily listening pattern over the years. Below is a heatmap showing the average number of tracks scrobbled for each hour of the day for the complete years since then.

Artist with most last.fm listeners by country

If you are interested in seeing how this was done the code for this project is available on my GitHub here