Music Preference Analysis with Spotify API

How the world’s taste in music changes through 2019 and 2020

Intan Dea Yutami
Analytics Vidhya
5 min readSep 11, 2020

--

Photos by Mohammed Metri (Unsplash)

About The Analysis

This analysis is to explore changes and trends in the songs people around the world listened to from 2019 till August 2020.

The data was collected from International Billboard Charts. If you clicked on the ‘International’ tab around the bottom of the page, you will get a list of international charts. I only took Single charts, since the analysis is about the songs.

There are 12 countries collected in the data, which are Argentina (ARG), Australia (AUS), Canada (CAN), Spain (ESP), France (FRA), Germany (GER), Italy (ITA), Japan (JPN), Korea (KOR), Mexico (MEX), Switzerland (SUI), and UK (GBP).

From each of these charts, the number one song was selected for every week existed in the data. Then, the characteristics of these songs were obtained from Spotify API. The characteristic then will be used to described the change in preference when listening to music from 2019 up to August 2020.

Who Frequented #1 on Most Music Charts Every Week?

Songs That Have Topped ≥ 5 Charts from 2019 until August 2020 in 12 Billboard International Charts

For every week existed in the data, we get which songs are dominating in these countries. Here are the songs that have majored more than 5 charts simultaneously in the same week.

Dance Monkey by Tones and I has topped multiple charts since October 2019 to January 2020. It has topped 8 charts in 14 December 2019 and 7 charts for 3 times/weeks. This song also has topped multiple charts in 12 weeks in 2019.

Shallow by Lady Gaga & Bradley Cooper also has topped 6 charts in 9 March 2019.

Meanwhile in 2020, Blinding Lights by The Weeknd has topped 6 charts in 7 March and 5 charts in 15 & 22 February.

Modalities and Keys in #1 Songs in 2019 and 2020

Modality and Keys for #1 Songs

In 2019 and 2020, most songs have major modality by 58.8%. Meanwhile the keys of the songs are quite diverse. 13.5% of them are based on C#/Db, followed by C (12.5%)

Changes in Audio Features of #1 Songs from 2019 to 2020

Valence and Danceability

Changes in Valence & Danceability Features of #1 Songs from 2019 to 2020

Most music charts show the trend of declining valence scores of the #1 songs in 2020. In 2020, people who come from these countries listen more to less happier songs than in 2019.

Argentine listen more to sadder songs than other countries. Meanwhile, Canada, Italy, Japan, Korea, Switzerland are the countries which listen more to happy songs in 2020.

Danceability feature also show declining trend in most of the charts in 2020. Australian chart has the steepest decline in terms of danceability. Argentine, Japanese, Korean, and Mexican audiences listen to more danceable songs in 2020 than in 2019.

According to the description in Spotify API, Valence represents musical positiveness, with higher values mean songs are more positive (cheerful, happy, euphoric). Danceability represents how easy a song is to dance to, with 0 is least danceable and 1 is most danceable.

Energy and Loudness

Changes in Energy & Loudness Features of #1 Songs from 2019 to 2020

While danceability and valence mostly decline in 2020, 8 from 12 charts show inclining scores in Energy feature for the #1 songs.

Argentine, Spanish, Italian, and Mexican audiences listen more to less energetic songs in 2020. Argentina’s chart has the steepest decline, while Korea’s chart has the most significant incline in Energy.

Energy measures the intensity and activity of the songs, so that energetic tracks will sound fast, loud and noisy.

Most charts have the loudness of the songs reduced in 2020, while #1 songs in Canada, Spanish and Korean charts are louder. In 2020 Korean audiences listen more to louder songs than in 2019.

Audio Feature Trends Based on Seasons and Regions in 2019 and 2020

Valence and Danceability

Valence and Danceability Trends Based in Seasons and Regions

Except in Asia, the audiences listened to happy songs the most in Summer 2019. For Asia, they listened to more happy songs the most in Winter 2019, followed by in Spring in the same year.

Both Asia and Europe preferred more danceable songs in summer and winter 2019, seen from the incline in both seasons. Nevertheless, throughout 2019 and 2020, European audiences preferred more songs with higher score of valence than other regions.

For Australia and America, audience listened more to danceable songs in Summer & Autumn 2019, then lost appetite of this kind of song in Winter 2019/2020.

Songs in the #1 spot of Asian charts have relatively less score of danceability than the other regions’ charts.

Energy and Loudness

Energy and Loudness Trends Based in Seasons and Regions

In Summer and Autumn 2019, audience in Asia changed their preference to less energetic songs. They are also the audiences who relatively preferred listening to more energetic songs than other regions.

Over time, American and Australian audiences showed increasing appetite to energetic songs, but they were declining toward Summer in 2020.

Asian audiences preferred louder song throughout Winter 2019 and Spring 2020. Australian audiences generally preferred listening to less energetic songs than other regions.

Codes can be checked here.

--

--

Intan Dea Yutami
Analytics Vidhya

Machine learning and data analysis enthusiast. Also a badminton observer. linkedin.com/in/intandea/