spotipy
A light weight Python library for the Spotify Web API
What it is and what it does
Spotipy wraps the Spotify Web API in a lightweight Python library, letting you search for tracks and artists, retrieve metadata, manage playlists, and access user library data without building HTTP requests by hand. It handles OAuth2 authentication for both application-level and user-level access, and depends on requests and urllib3 for HTTP communication, with optional redis support for caching.
The library is designed for developers who want to build Python applications that interact with Spotify's music catalog and user accounts. It abstracts away API endpoint details and response parsing, so you can focus on your application logic rather than REST mechanics.
Use it for:
- Build a music discovery app that searches Spotify's catalog and displays track details programmatically
- Sync a user's saved tracks or playlists to a local database or external service
- Create a recommendation engine that analyzes user listening history via the Spotify API
- Automate playlist creation or management based on external data or user preferences
- Integrate Spotify data into a web or desktop application without writing raw HTTP code
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Spotipy is a Python client library for the Spotify Web API that provides access to Spotify's music data, search, and user account features through a simple interface.
Yes. Spotipy is actively maintained, has no known vulnerabilities, installs with low friction, and is widely used. It's the standard choice for Python developers who need programmatic access to Spotify's API. Install it if you're building any application that needs to query or manipulate Spotify data.
Install
spotipy on PyPI
pip
pip install spotipyuv
uv add spotipypoetry
poetry add spotipyInstalling spotipy
Before you install
Low friction install with a pure-Python wheel distribution. The project is actively maintained with recent commits and a large community following (5467 stars), suggesting stable, well-tested code.
License in practice
MIT license is permissive—you can use, modify, and distribute this library freely in commercial or private projects with minimal restrictions.
Quickstart
pip install spotipy
import spotipy
from spotipy.oauth2 import SpotifyClientCredentials
sp = spotipy.Spotify(auth_manager=SpotifyClientCredentials(
client_id="YOUR_CLIENT_ID",
client_secret="YOUR_CLIENT_SECRET"
))
results = sp.search(q='weezer', limit=20)
Requires a Spotify Developer account with app credentials (client ID and secret) obtained from https://developer.spotify.com/dashboard
Verify before relying
- Whether redis is required at runtime or only for optional caching features
- Specific Spotify API endpoints and scopes supported beyond the general 'full access' claim
- Rate limiting behavior and retry strategies when hitting Spotify API quotas
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — redis, requests, urllib3 |
| Maintenance | actively maintained — 164 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 476,276/month — #6,448 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: spotipy-2.26.0-py3-none-any.whl
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
spotapiSpotAPI wraps Spotify's private and public APIs…
unclear · top 15,000 on PyPI
spotifywebapipythonA Python library that wraps the Spotify Web…
permissive · top 15,000 on PyPI
LucoPyLucoPy is a Python SDK for interacting with the…
permissive · top 15,000 on PyPI
spotipyFreeProvides a Spotipy-compatible interface to…
unclear · top 15,000 on PyPI
spotdlspotDL downloads songs from Spotify playlists…
permissive · top 15,000 on PyPI
pylibrespot-javaProvides a Python interface to communicate with…
permissive · top 15,000 on PyPI
ytmusicapiytmusicapi lets you programmatically interact…
permissive · top 15,000 on PyPI
youtube-search-pythonSearch YouTube for videos, channels, and…
permissive · top 15,000 on PyPI
pylastpylast provides a Python interface to Last.fm…
permissive · top 15,000 on PyPI
shazamioAsynchronous Python library that recognizes…
permissive · top 15,000 on PyPI