skillfed

spotifywebapipython

Spotify Web API Python3 Library

spotifywebapipython v1.0.288 88.0K downloads/30d#13,752 on PyPI13
Permissive license Active released

What it is and what it does

spotifywebapipython is a Python 3 client library for the Spotify Web API that handles OAuth2 authorization flows (Authorization Code, Authorization Code PKCE, Client Credentials) with automatic token storage and renewal. It provides access to Spotify's full API surface—albums, artists, audiobooks, playlists, tracks, user profiles, search, and player control—plus support for Spotify Connect device management and playback control.

The library depends on requests, oauthlib, and requests-oauthlib for HTTP and authentication, plus lxml, pillow, and zeroconf for media handling and device discovery. It includes built-in caching for rarely-changed data like categories and genres, and integrates with smartinspectpython for optional structured logging. A Spotify account and registered app (for Client ID and Secret) are required to use it; some endpoints require a premium account.

Use it for:

  • Build a Python application that searches Spotify's catalog and retrieves album, artist, or track metadata.
  • Create a playlist manager that reads, modifies, and creates playlists programmatically on behalf of a user.
  • Control Spotify playback on Connect devices (pause, resume, skip, volume) from a custom Python application.
  • Fetch user profile data, top tracks, and listening history for analytics or personalization.
  • Integrate Spotify recommendations and audio feature analysis into a music discovery or curation tool.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A Python library that wraps the Spotify Web API, enabling retrieval of music data and control of Spotify Connect playback devices through OAuth2 authentication.

Yes. The library is actively maintained, has low install friction, carries no known vulnerabilities, and is licensed permissively. It covers a comprehensive API surface and handles OAuth complexity internally. Install it if you need to build Spotify integrations in Python; verify that your use case doesn't require endpoints not yet exposed by the wrapper.

Install

spotifywebapipython on PyPI

pip

pip install spotifywebapipython

uv

uv add spotifywebapipython

poetry

poetry add spotifywebapipython

Installing spotifywebapipython

Before you install

Low install friction with a pure-Python wheel distribution. Actively maintained with a recent release (4 days old) and an active repository. Requires Python 3.11.0 or greater.

License in practice

Licensed under MIT (permissive), allowing use in commercial and private projects with minimal restrictions.

Quickstart

pip install spotifywebapipython

from spotifywebapipython.spotifyclient import SpotifyClient

client = SpotifyClient(client_id='YOUR_CLIENT_ID', client_secret='YOUR_CLIENT_SECRET')
results = client.search('track:Bohemian Rhapsody artist:Queen')

Requires Python 3.11.0 or greater. You must register a Spotify App to obtain a Client ID and Client Secret from the Spotify Developer Portal.

Verify before relying

  • Whether all Spotify Web API endpoints are fully covered or if some remain unimplemented.
  • Performance characteristics when handling large playlists or frequent API calls.
  • Rate-limiting behavior and how the library handles Spotify API throttling.
  • Whether premium account features are clearly documented per endpoint.

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.11.0)
Install friction low — pure-Python wheel
Runtime dependencies 13 — lxml, numpy, oauthlib, pillow, platformdirs, PyChromecast, pyotp, requests, requests-oauthlib, smartinspectpython, soco, urllib3, zeroconf
Maintenance actively maintained — 4 days since the last release
Last repo commit
First released
Downloads 88,050/month — #13,752 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: spotifywebapipython-1.0.288-py3-none-any.whl

Keywords: spotify, spotifywebapi, api, audio, music, library

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: UnixProgramming Language :: Python :: 3Topic :: Multimedia :: Sound/Audio :: PlayersTopic :: Software Development :: Libraries

Tags

spotify api python clientspotify web api wrapperspotify playback control pythonspotify music data retrievalspotify oauth authenticationspotify connect device controlspotify playlist management
spotify-integrationoauth-clientmusic-api

More Libraries packages