Menu

How to Export a Spotify Playlist to CSV with Python
📰

How to Export a Spotify Playlist to CSV with Python

DEV Community: datascience·Aran Services·1 day ago
#bqw0PHPl
#devtodatascience#science#devto#dev#playlist
Long article (315 words) — no AI summary yet.
Reading 0:00
15s threshold

Have you ever wanted to inspect your Spotify playlists in a spreadsheet, find repeated tracks, or build your own music analysis tool?

You can do this with Python and SpotAPI, an open-source library I maintain.

This example works with publicly accessible playlists without registering a Spotify developer application.

Getting started

Install SpotAPI:

python -m pip install spotapi

Enter fullscreen mode

Exit fullscreen mode

Download the playlist auditing example from the repository:

https://github.com/Aran404/SpotAPI/blob/main/examples/playlist_audit.py

Save it as playlist_audit.py .

Export your playlist

Copy a public Spotify playlist link and run:

python playlist_audit.py "YOUR_PLAYLIST_URL" --output playlist.csv

Enter fullscreen mode

Exit fullscreen mode

You can also limit the number of entries scanned:

python playlist_audit.py "YOUR_PLAYLIST_URL" \ --output playlist.csv \ --max-items 500

Enter fullscreen mode

Exit fullscreen mode

The full example supports up to 10,000 playlist…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.