SpotifyScraper

raw JSON →
2.1.5 verified Sat May 09 auth: no python

A Python library for extracting playlist and track metadata from Spotify without requiring authentication. Version 2.1.5 uses the library's own internal parser and requests. Rapid release cadence with frequent breaking API changes.

pip install spotifyscraper
error ModuleNotFoundError: No module named 'spotifyscraper'
cause Package not installed or installed under a different name (e.g., 'SpotifyScraper' with capitals).
fix
Run: pip install spotifyscraper
error AttributeError: 'NoneType' object has no attribute 'get'
cause Internal parsing failed because the target playlist or track does not exist or is private.
fix
Verify the Spotify ID and that the content is publicly accessible. If the problem persists, the scraping format may have changed.
error ImportError: cannot import name 'Spotify' from 'spotifyscraper'
cause Using a version prior to 2.0.0 where the class-based API didn't exist.
fix
Upgrade to the latest version: pip install --upgrade spotifyscraper
breaking In v2.0.0, the entire API changed from function-based to class-based. Old code like 'import spotifyscraper; spotifyscraper.get_track(...)' will fail.
fix Use the Spotify class and its methods (get_playlist, get_track, etc.).
breaking Return types changed in v2.1.0: 'get_playlist' now returns a dict instead of a custom Playlist object. Code relying on attribute access (e.g., 'playlist.name') will break.
fix Access data via dictionary keys: 'playlist['name']' instead of 'playlist.name'.
gotcha This library does NOT use the official Spotify Web API. It scrapes public-facing data from Spotify's web pages. Data may be incomplete or break without notice.
fix Use the official Spotify API (spotipy) if you need reliability and structured data.
deprecated The 'get_track_lyrics' method is no longer functional since Spotify removed lyrics from public web endpoints in late 2024.
fix Remove calls to 'get_track_lyrics' or catch exceptions gracefully.

Fetch a Spotify playlist by its ID (found in URL) and print the first three tracks.

from spotifyscraper import Spotify

sp = Spotify()
playlist = sp.get_playlist('37i9dQZF1DXcBWIGoYBM5C')
print(playlist['name'])
for track in playlist['tracks'][:3]:
    print(track['name'], '-', track['artists'])