Experiments with Spotify Web API: Decoding their recommendation system

Rinkesh Patel
2 min readMay 14, 2022
Genre Cloud

In this article I am extending my experiments with Spotify Web API to discover how their recommendation system works. Let’s see if we can answer these questions:

  • Does exploring the patterns in user data provide any cues about their taste of music?
  • Can we relate the data they expose through their Web APIs to the recommendations they make?

Step-by-step procedure for the experiment

Fig.1. Step-by-step process for the experiment
  1. Download Liked Songs from Spotify Web API.
  2. Create a list of all the artists appearing on the liked songs.
  3. Get the information for each of the artist appearing on your liked songs.
  4. Create the list of genres of the artists.
  5. Count the number of times a particular genre appears in the genre list.
  6. Plot the genre cloud using counts developed in step 5.
Fig.2. The results of each step of the process
Fig. 3. Top Genres in the order they appear in the Spotify Clients
Fig. 4. Top mixes in the order they appear in Spotify Clients
Fig. 6. Why pop appears as top genre?

Key observations

  • In my case, I can clearly see a link between the genre of the artists appearing on my liked songs and the mixes recommended by Spotify. For example, Pop Mix and House Mix are the clear examples of this.
  • The genre counts also give us clear insight into the top genres. It is clear that pop should be the top genre.
  • Instead of making a playlist, adding songs to the ‘liked songs’ can significantly improve the recommendation. Recommendations will further improve if you decide to enhance the liked songs, and like the songs added by Spotify. Specifically, this will narrow down their understanding of your taste of music.

Thanks for your time. Please feel free to leave your thoughts on the experiment.

--

--

Rinkesh Patel

A persistent problem solver trying to dig deeper into day-to-day challenges in Software Engineering and share insights. Love simple and effective solutions.