
This will be needed later to get the audio features for each track from the API. I also extracted the Track ID from each song’s URL and stored it in a separate column. The data scraped from the charts does not contain fields for the date or region, so I needed to add them during processing. streams = pd.DataFrame() while start_date < end_date: url = '' % start_date.strftime('%Y-%m-%d') result = requests.get(url) if result.status_code = 200: fileobj = cStringIO.StringIO(('utf8', 'ignore')) try: df = pd.read_csv(fileobj, header=1) except Exception as e: pass df = start_date df = 'Global' df = df.str streams = streams.append(df) start_date += datetime.timedelta(1) else: print result.status_code print result.text raise Exception('Response code not 200') Instead, I used Python to write a script which would scrape each day’s chart, process the file, and join the data together to create a single CSV file for analysis. So if you're one of millions who binged season 4 of "Stranger Things," don't turn upside down if you see Kate Bush there, thanks to the resurgence of 1985 hit "Running Up That Hill (Deal With God).Although Spotify Charts provides a handy “download to CSV” link at the top of the page, manually downloading each day for the full year is too time-consuming, and will also result in 365 files to be imported for analysis. Social media users have shared some of their favorite and confusing music genres, including "post-teen pop," "Ohio hip-hop" and "New England emo."īelow the chart will also be a list of your top artists, with your top artists in bold and bigger font, and the following artists' names in smaller font. If you click on a genre on the chart, you will see what artists are part of said genre.

The chart is divided by music genre, with genres listed with their corresponding color.

Once allowed, your Spotify Pie Chart will be generated, which you can take a screenshot of to share with friends or on social media.
On the website, you will be asked to sign into your Spotify account and allow the app to have access to your listening history. You can see your Spotify Pie Chart on the third-party app by clicking on the website, on your phone or desktop.
