Beyoncé Music Analytics

Who doesn’t love Beyonce? The 35x Grammy Award winning artist has released an iconic and memorable discography over the years - and as a fan of her work (and her in general), I was curious to explore the data underlying her tracks.

For the purposes of this analysis, I collected data from her LP releases. Deluxe editions were included, but live albums, remix albums, and soundtracks were excluded (sorry, Lion King…).

I pulled the basic track data using the Spotify API - specifically using the lightweight Python library, Spotipy. For other track data (more on that below), Spotify has unfortunately changed it’s developer API policies, meaning the API endpoints to retrieve audio features data have been deprecated. Luckily there was an equivalent API that I could use - that is summarized nicely in this article.

As outlined in the docs, I used the following track data dictionary in my initial prompt for Plotly Studio:

keyMusical key, e.g., “C”,“F#”,“Ab”

mode "major"or “minor”

tempo BPM (beats per minute), as an integer

camelotHarmonic mixing notation, e.g., “8B”

energyRelative energy level (0–100)

danceabilityGroove-ability of the track (0–100)

happinessBrightness/mood score (0–100)

acousticnessHow acoustic the track sounds (0–100)

instrumentalnessLikelihood of no vocals (0–100)

loudnessRMS loudness in decibels, e.g. “-5 dB”

speechinessSpoken word content (0–100)

livenessPresence of a live audience feel (0–100)

duratione.g., “2:28”

popularityRelative ranking or play count metric (0–100)

Two minutes later, there was my app! First thing I had to do was give it a theme that fit. Although I was tempted towards a black and yellow theme (a la the Bey Hive), in the post Renaissance era, we’re going for the futuristic silver and black theme.

I wanted to start off by seeing what the biggest hits were on every album. This bar chart illustrates that pretty nicely. The top 5 on I AM…SASHA FIERCE should be no surprise to anyone.

It also generated this cool radar chart to highlight the different audio features for a given song. No surprise to see high energy, danceability, and happiness on Crazy In Love.

How about some help putting together an on-the-fly Beyonce playlist? As a runner, I like a playlist that keeps me on tempo. Suppose I want to do a 5k tempo run - I can probably do that at a 4:30 min/km pace. Doing some math to convert steps per minute to BPM, I should aim for a tempo between 175-180bpm. I’ll broaden that slightly given the small(ish) sample size and make the range to 160 - 190 BPM. Include only high energy songs to keep me energized, and there’s my playlist!

Tempo consistency across the album is also nice for running - looks like RENAISSANCE is the one.

Then again, if I think of it in terms of Energy, some peaks and valleys might be nice for a long run. In that case, COWBOY CARTER might be my pick.

I had tons of fun making this app - check out the full version on Plotly Cloud!

1 Like