{"id":28228,"library":"spotifywebapipython","title":"Spotify Web API Python Library","description":"A modern, typed Python3 library for the Spotify Web API, supporting OAuth, pagination, and all major endpoints. Current version 1.0.270, released on PyPI with active development.","status":"active","version":"1.0.270","language":"python","source_language":"en","source_url":"https://github.com/thlucas1/spotifywebapiPython","tags":["spotify","api","music","oauth","async"],"install":[{"cmd":"pip install spotifywebapipython","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"HTTP client for API requests","package":"httpx","optional":false},{"reason":"Data validation and settings management","package":"pydantic","optional":false}],"imports":[{"note":"Main client class.","symbol":"SpotifyClient","correct":"from spotifywebapipython import SpotifyClient"},{"note":"Base exception class.","symbol":"SpotifyError","correct":"from spotifywebapipython import SpotifyError"}],"quickstart":{"code":"from spotifywebapipython import SpotifyClient\n\nclient = SpotifyClient(\n    client_id=os.environ.get('SPOTIFY_CLIENT_ID', ''),\n    client_secret=os.environ.get('SPOTIFY_CLIENT_SECRET', ''),\n    redirect_uri=os.environ.get('SPOTIFY_REDIRECT_URI', '')\n)\n# Authenticate (requires user interaction for authorization code flow)\n# For simplicity, use client credentials flow (no user-specific data):\nclient.authenticate()\n# Search for a track\nresults = client.search('Never Gonna Give You Up', type='track')\nprint(results)","lang":"python","description":"Initialize client, authenticate, and search for a track."},"warnings":[{"fix":"Use `SpotifyClient(client_id, client_secret, redirect_uri)` and call `authenticate()`.","message":"In version 1.0.0, the authentication flow changed from implicit grant to authorization code flow. The old `SpotifyClient(access_token=...)` pattern no longer works.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Replace `client.playlist(id)` with `client.get_playlist(id)`.","message":"The `SpotifyClient.playlist()` method is deprecated in favor of `SpotifyClient.get_playlist()` as of v1.0.100. It will be removed in v2.0.0.","severity":"deprecated","affected_versions":">=1.0.100"},{"fix":"Use the exact URI string, e.g., 'http://localhost:8888/callback'.","message":"When using the authorization code flow, the `redirect_uri` must exactly match the one registered in the Spotify Developer Dashboard, including trailing slashes.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run `pip install spotifywebapipython` in the correct Python environment (e.g., venv).","cause":"Library not installed or installed in wrong environment.","error":"ModuleNotFoundError: No module named 'spotifywebapipython'"},{"fix":"Update code to `SpotifyClient(client_id, client_secret, redirect_uri)`.","cause":"Using old instantiation pattern from version <1.0.0.","error":"TypeError: __init__() missing 3 required positional arguments: 'client_id', 'client_secret', 'redirect_uri'"},{"fix":"Re-authenticate with proper scopes (e.g., `client.authenticate(scopes=['user-library-read'])`).","cause":"Invalid or expired access token; or missing scopes.","error":"spotifywebapipython.exceptions.SpotifyError: 401 - Unauthorized"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}