This release is a pre-release and may not be stable for production use.
SpotifyScraper
Extract public Spotify data — tracks, albums, artists, playlists, and podcasts — without the official API or any credentials.
SpotifyScraper bootstraps an anonymous token from Spotify's own public embed pages and reads the same JSON endpoints the web player uses, returning typed, immutable models. v3 is a ground-up rewrite focused on reliability and a clean, modern API.
Upgrading from v2? See the migration guide. The previous line lives on the
v2.xbranch.
Install
pip install spotifyscraper # core (only depends on httpx)
pip install "spotifyscraper[media]" # + cover/preview embedding (mutagen)
pip install "spotifyscraper[browser]" # + Playwright browser fallback
pip install "spotifyscraper[all]" # everything
Python 3.10+.
Quickstart
from spotify_scraper import SpotifyClient
with SpotifyClient() as client:
track = client.get_track("https://open.spotify.com/track/4uLU6hMCjMI75M1A2tKUQC")
print(track.name, "—", track.artists[0].name)
print(track.duration_ms, "ms |", track.preview_url)
print(track.to_dict()) # JSON-safe dict, if you prefer dicts
Every entity has its own method — get_track, get_album, get_artist,
get_playlist, get_episode, get_show — each accepting a URL, URI, or bare
ID.
Async
import asyncio
from spotify_scraper import AsyncSpotifyClient
async def main():
async with AsyncSpotifyClient() as client:
track, album = await asyncio.gather(
client.get_track("4uLU6hMCjMI75M1A2tKUQC"),
client.get_album("4aawyAB9vmqN3uQ7FjRGTy"),
)
print(track.name, "|", album.name)
asyncio.run(main())
Download a cover and preview
from spotify_scraper import SpotifyClient
with SpotifyClient() as client:
track = client.get_track("4uLU6hMCjMI75M1A2tKUQC")
client.download_cover(track, dest="covers/")
client.download_preview(track, dest="previews/", embed_cover=True) # needs [media]
Features
- All core entities + podcasts — tracks, albums, artists, playlists, shows, episodes.
- Sync & async clients sharing one sans-io core.
- Typed, frozen models with JSON-safe
to_dict()/from_dict(). - Two-tier resilience — Spotify's GraphQL API with automatic fallback to the embed page.
- One core dependency (
httpx); media and browser support are optional extras. - Anti-ban built in — per-host rate limiting, retries with backoff, UA rotation, proxies.
- Browser fallback via Playwright when you need a real browser.
Roadmap
| Version | Scope |
|---|---|
| 3.0 | The library: all entities, pagination, media downloads, browser fallback, docs |
| 3.1 | Command-line interface and cookie-authenticated lyrics |
Documentation
Full docs, guides, and the API reference: https://spotifyscraper.readthedocs.io
Legal
SpotifyScraper is an unofficial, independent project, not affiliated with Spotify. It reads publicly available data and the ~30-second previews Spotify publishes; it does not download full tracks or circumvent DRM. Use it for educational and personal purposes, and in line with Spotify's Terms of Service. See the legal notice.
Contributing
Contributions are welcome — see CONTRIBUTING.md. The project
is developed spec-first with OpenSpec;
specs live in openspec/.
License
MIT © Ali Akhtari
Metadata
Release files for spotifyscraper 3.0.0rc1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| spotifyscraper-3.0.0rc1.tar.gz | 276.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| spotifyscraper-3.0.0rc1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 330.5 kB
Release files / spotifyscraper-3.0.0rc1.tar.gz
| Download URL | spotifyscraper-3.0.0rc1.tar.gz |
|---|---|
| Size | 276.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c6dedaf3b09c51a1d4d5bcdb4d9503432c57bd87001b494b62e49976ac449c20
|
|
BLAKE2b-256 checksum How to use checksums |
2d60c7612f671551408d735489e43dd007cf13f811f398a312445510c35a9bf8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / spotifyscraper-3.0.0rc1-py3-none-any.whl
| Download URL | spotifyscraper-3.0.0rc1-py3-none-any.whl |
|---|---|
| Size | 54.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d740bf7689f94a94be6e05334e188380eea5f19e4cbac55da71aaf93baf2f5bd
|
|
BLAKE2b-256 checksum How to use checksums |
8d99b8febd3ecfc188fe3dc1446ccfc5d2735590307f19c72ca713b79b0e277f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|