A typed read of the public web player.
SpotifyScraper reads the same JSON Spotify's own web player uses and returns clean, typed objects — without app registration, OAuth, or rate-limited credentials. This page calls a small Cloudflare Function that mirrors the library's own tiers: the embed/pathfinder read for metadata, the anonymous token tier for search, then renders the result. It's 261 GitHub stars' worth of maintenance, shown honestly.
pip install spotifyscraper
from spotify_scraper import SpotifyClient
with SpotifyClient() as client:
track = client.get_track("https://open.spotify.com/track/0VjIjW4GlUZAMYd2vXMi3b")
print(track.name, "—", track.artists[0].name)
print(track.preview_url) # 30s preview, when available
hits = client.search("daft punk") # anonymous aggregate search (v3.4)
print(hits.tracks[0].name)
print(track.to_dict()) # full, JSON-safe A live demo of the open-source SpotifyScraper library. Not affiliated with or endorsed by Spotify; all data and media belong to their respective owners and are fetched from Spotify's public endpoints for demonstration.