A Streamlit web app that fetches and exports metadata from Spotify tracks, albums, artists, and playlists. Built to work with Spotify's Development Mode restrictions (post-November 2024).
✅ Track Metadata - Get detailed information about any Spotify track
✅ Album Metadata - Fetch album details including full tracklist
✅ Artist Metadata - Retrieve artist info, genres, followers, and popularity
✅ Playlist Metadata - Export all tracks from user-created playlists
✅ User Profile - View your Spotify account information
✅ CSV Export - Download all data as CSV files
- Audio Features (danceability, energy, tempo, etc.)
- Audio Analysis
- Recommendations
- Related Artists
- Featured/Algorithmic Playlists
To access these features, you need Extended Quota Mode, which requires a registered business with 250k+ monthly active users.
pip install -r requirements.txt- Go to Spotify Developer Dashboard
- Click "Create app"
- Fill in the app details:
- App name: Spotify Metadata Explorer
- App description: Personal metadata fetcher
- Redirect URI:
http://localhost:8501
- Click "Save"
- Copy your Client ID and Client Secret
If using the Streamlit web app with OAuth, you need to allowlist yourself:
- In your Spotify app dashboard, click Settings
- Go to User Management tab
- Click Add new user
- Enter your name and the email address associated with your Spotify account
- Click Add User
Note: The standalone Python script (spotify_metadata.py) uses Client Credentials flow and doesn't require user allowlisting.
streamlit run app.pyThe app will open at http://localhost:8501
- Enter your Client ID and Client Secret in the sidebar
- Click "Click here to login with Spotify"
- Authorize the app with your Spotify account
- Use the tabs to fetch different types of metadata:
- 🎵 Track - Paste a Spotify track URL
- 💿 Album - Paste a Spotify album URL
- 🎤 Artist - Paste a Spotify artist URL
- 📋 Playlist - Paste a Spotify playlist URL
- 👤 Profile - View your account info
- Download data as CSV files
Use spotify_metadata.py for programmatic access without Streamlit:
from spotify_metadata import SpotifyMetadataFetcher
# Initialize
fetcher = SpotifyMetadataFetcher(
client_id="your_client_id",
client_secret="your_client_secret"
)
# Get track metadata
track = fetcher.get_track("https://open.spotify.com/track/...")
print(f"{track['name']} by {track['artists']}")
fetcher.save_to_csv(track, "track.csv")
# Get album metadata (includes all tracks)
album = fetcher.get_album("https://open.spotify.com/album/...")
fetcher.save_to_csv(album, "album.csv")
# Get artist metadata
artist = fetcher.get_artist("https://open.spotify.com/artist/...")
print(f"{artist['name']}: {artist['followers']:,} followers")
# Get playlist metadata (includes all tracks)
playlist = fetcher.get_playlist("https://open.spotify.com/playlist/...")
fetcher.save_to_csv(playlist, "playlist.csv")Run the included examples:
# Edit spotify_metadata.py to add your credentials, then:
python spotify_metadata.py- Track:
https://open.spotify.com/track/7C0LbWtZgDYjmaSuz10AeD - Album:
https://open.spotify.com/album/1A2GTWGtFfWp7KSQTwWOyo - Artist:
https://open.spotify.com/artist/06HL4z0CvFAxyc27GXpf02 - Playlist:
https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M
To deploy the Streamlit app on Streamlit Cloud:
- Push your code to GitHub
- Go to share.streamlit.io
- Deploy your app
- Update the
REDIRECT_URIinapp.pyto your deployed URL (e.g.,https://your-app.streamlit.app) - Add the new redirect URI to your Spotify app settings
For the standalone Python script, simply copy spotify_metadata.py and use it in your own projects.
- Make sure you've added yourself to the User Management allowlist in your Spotify app settings
- Verify your Client ID and Client Secret are correct
- Check that the Redirect URI in your code matches exactly what's in your Spotify app settings
- Double-check your Client ID and Client Secret
- Make sure there are no extra spaces when copying
- Streamlit app: Make sure you've authorized with the correct scopes
- Python script: Some playlists may require OAuth (user authentication) instead of Client Credentials
- Only user-created playlists work in Development Mode (not Spotify's algorithmic playlists)
This app was created as a response to Spotify's November 2024 API changes, which restricted access to audio features and other endpoints for individual developers. While we can't access the more advanced audio analysis features anymore, this tool still provides valuable metadata extraction capabilities for personal use.
MIT License - Feel free to use and modify as needed.
This is a personal project, but feel free to fork and adapt it for your own use!