Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

Integrate Genres to My Extended Streaming History on Jupyter Notebook

Integrate Genres to My Extended Streaming History on Jupyter Notebook

Hello,
I'm currently analyzing my extended streaming history and the data doesn't have a genre column. I'm using Python on a Jupyter Notebook/Google Colab for the analysis and the code read the JSON file as a table, as shown by the screenshot below. How can I find out the genre from the song title and/or artist without having to manually add them one by one? Of course since there are tens of thousands of data, it's impossible for me to do a manual way to add it. Hope there's any certain way to match it and add it as a new column.

Thank you.

 

Screenshot_2053.png

Reply
2 Replies

Spotify only provides artist genres. so get the artist uris over get tracks and then get artists -> ['genres']

And you can store the artists with their genres in s file after every request, so you don't have to call the API for genres of artists you already have.

XimzendSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

Suggested posts