Export all your Spotify liked songs to JSON and CSV — with full metadata including title, artist, album, release date, ISRC, and more.
You'll need to register an app on Spotify's developer portal to get API credentials.
- Go to developer.spotify.com/dashboard and log in
- Click Create app
- Fill in any name and description, then set the Redirect URI to:
http://127.0.0.1:8888/callback - Tick the "Web API" checkbox.
- Once created, open the app settings and copy your Client ID and Client Secret
1. Clone the repo
git clone https://github.com/dev26git/spoteafy.git
cd spoteafy2. Create a virtual environment (optional but recommended)
# Using pip
python -m venv venv
source venv/bin/activate # macOS/Linux
venv\Scripts\activate # WindowsOR
# Using conda
conda create -n spoteafy-env python=3.11
conda activate spoteafy-env3. Install dependencies
python -m pip install -r requirements.txt4. Configure credentials
Create a .env file in the project root with your Spotify credentials:
SPOTIFY_CLIENT_ID=your_client_id_here
SPOTIFY_CLIENT_SECRET=your_client_secret_herepython download_spotify_saved_tracks.pyOn first run, a browser window may open asking you to log in and authorize the app. Allow that.
Two files are saved to the project directory:
| File | Format | Contents |
|---|---|---|
spotify_saved_songs_YYYYMMDD.json |
JSON | Full structured data, easy to parse |
spotify_saved_songs_YYYYMMDD.csv |
CSV | Flat table, opens in Excel/Sheets |
Each song entry contains:
title,artist,album,release_dateduration,duration_msspotify_id,spotify_urladded_at— when you liked the songpopularity— Spotify's 0–100 scoreexplicit,is_localisrc— universal track ID, useful for migrating to other platforms
- Local files saved to your Spotify library are included but will have empty fields for
spotify_id,isrc, andpopularity - The ISRC code can be used to find the same track on Apple Music, YouTube Music, Tidal, etc.
- This script only reads your library — it makes no changes to your Spotify account