spotify-webapi
raw JSON → 1.0.3 verified Sat May 09 auth: no python abandoned
A lightweight Python library to fetch tracks from Spotify playlists without using the official Spotify Web API. Version 1.0.3 is current; release cadence is irregular. No longer actively maintained (abandoned by author).
pip install spotify-webapi Common errors
error AttributeError: module 'spotify_webapi' has no attribute 'Spotify' ↓
cause Incorrect import style: using `import spotify_webapi` then `spotify_webapi.Spotify` instead of `from spotify_webapi import Spotify`.
fix
Use: from spotify_webapi import Spotify
error TypeError: get_playlist_tracks() missing 1 required positional argument: 'playlist_id' ↓
cause Calling get_playlist_tracks() without the playlist ID argument.
fix
Pass playlist ID string: sp.get_playlist_tracks('37i9dQZF1DXcBWIGoYBM5M')
error requests.exceptions.HTTPError: 429 Client Error: Too Many Requests ↓
cause Sending many requests quickly; library does not implement rate limiting or retry.
fix
Add manual delays between calls with time.sleep().
Warnings
gotcha Library only supports fetching tracks from public playlists. Private/unpublished playlists will fail silently or return empty. ↓
fix Ensure playlist is set to public in Spotify client.
deprecated The library is no longer maintained. No updates for bug fixes or Spotify API changes. Consider migrating to spotipy. ↓
fix Use spotipy library with official API and proper authentication.
breaking Library uses web scraping of Spotify Web Player; Spotify may change frontend structure causing complete failure. ↓
fix No workaround. Use official API with spotipy instead.
Imports
- Spotify wrong
import spotify_webapicorrectfrom spotify_webapi import Spotify - TrackInfo
from spotify_webapi.models import TrackInfo
Quickstart
from spotify_webapi import Spotify
sp = Spotify()
playlist_id = '37i9dQZF1DXcBWIGoYBM5M' # example playlist
tracks = sp.get_playlist_tracks(playlist_id)
for track in tracks:
print(track.name, track.artists)