Spotify's audio features with streaming performance metrics to uncover patterns in successful music.
Fetch and analyze the top tracks of popular artists using the Spotify Web API. The analysis includes data on artist name, track name, track popularity, album, release year, and duration.
Provide visualizations and insights into top artist, tracks, streaming trends, and audio features such as danceability, energy, and valence.
Python
Spotify Developer Account (https://developer.spotify.com/)
- Log in to Spotify Developer Dashboard
- Create new application to get Client ID and Client Secret
-
spotipy
-
pandas
-
numpy
-
matplotlib
-
seaborn
-
datetime
-
time
-
plotly
- Initialize Spotify client by providing Client ID and Client Secret
- Define genres and top artists to analyze
-
- Run Analysis and Visualization. The code outputs:
-Combined data in a CSV file (spotify_top_tracks_analysis.csv).
-Summary statistics and top tracks.
-Variety of visuals including box plot and bar chart for popularity and average track duration.
- Convert release date to datetime
- Filter data to last two years
- Create monthly averages for streams
- Get top 10 artists per genre based on total streams
- Plot data
- Filter data to last two years
- Create monthly averages for streams
- Get the top 10 artists per genre based on total streams
- Create a figure with subplots
- Add traces for all genre
- Add stats table
- Create buttons for dropdown (switch genres)
- Display figure (interactive)
Dashboards:
Video: https://drive.google.com/file/d/1TFFFYrxsTeveyamYu0zln3lswC0UGJO_/view?ts=67638f28










