How to listen along a Last.fm user on Spotify

tl;dr “I dont want to read your article, I want to download the code” : Skip to this section of the article for the link to the Github repository.

Lately I started using Last.fm a bit more thoroughly. For those who don’t know what Last.fm is, it’s a webstite that allows you to “scrobble” (log) every song you listen to.
It’s cool because then you can have cool stats about your listening habits, but also discover new artists related to what you like (Spotify largely copied what Last.fm was doing, with the artist/album/song radio and “daily mix” playlists).

The idea

I was browsing the website and looking at what my friends were listening to, when suddenly I thought that it would be cool to be able to listen to what another user is listening to, at the same time. It’s a cool way to discover new music while relying on someone’s tastes isntead of the Spotify algorithms, that unfortunately often brings you the same songs that you already know too well.

I started googling, but unfortunately didn’t find anything remotely close to what I was trying to do, except a very old website called “overhere” that apparently did the same thing, but is now long dead.

So I knew I had to do it myself.

The program

After a few moments researching the Last.fm API and the Spotify API, I came to the conclusion it should be doable and reasonably easy to do.

I ended up doing it in Python, since it makes such little scripts easy and quick to code, and libraries were available to interact with the aforementionned APIs.

Basically, the program checks what a user (of your choice) is listening to on Last.fm, and if he/she is listening to a song, it will search for it on Spotify, and play it, if available. At the end of the song, it does it again. Rinse and repeat.

And voilà, you are listening along a Last.fm user, to the exact same songs, at the same time.

Where to get it ?

You can find the code on this Github repository :
Hexalyse/LastFmListenAlong

Everything needed is explained in the README.md file.

Have fun discovering new music 🙂

3 thoughts on “How to listen along a Last.fm user on Spotify

  1. This sounds like a nice idea. I’ll take a look at your code! I recently built a similar program using the Spotify and Last.fm API’s: You can “time travel” through your last.fm history by specifying a date, asking Last.fm for your listening history for that day and automatically building a Spotify playlist with those songs.

    • Cool idea, Judith ! Traveling back to what you were listening years ago could be fun indeed 🙂

      There are definitely lots of interesting things to do by mixing informations you can get on last.fm, and Spotify !

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.