{"id":28227,"library":"spotifywebapi","title":"Spotify Web API for Python","description":"A simple Python wrapper for the Spotify Web API. Current version 1.2.8, supports Python >=3.6. Released under MIT license, maintained on GitHub. Release cadence is irregular.","status":"active","version":"1.2.8","language":"python","source_language":"en","source_url":"https://github.com/Firius0408/spotifywebapi","tags":["spotify","web-api","wrapper","music"],"install":[{"cmd":"pip install spotifywebapi","lang":"bash","label":"Pip install"}],"dependencies":[],"imports":[{"note":"The API class is named SpotifyAPI, not Client.","wrong":"from spotifywebapi import Client","symbol":"SpotifyAPI","correct":"from spotifywebapi import SpotifyAPI"}],"quickstart":{"code":"from spotifywebapi import SpotifyAPI\napi = SpotifyAPI(client_id='YOUR_CLIENT_ID', client_secret='YOUR_CLIENT_SECRET')\napi.authenticate()\ntrack = api.get_track('6y0igZArWVi3k3N9S20QXN')\nprint(track)","lang":"python","description":"Initialize API with credentials, authenticate, then use get_track etc."},"warnings":[{"fix":"Make sure to call api.authenticate() after creating the instance.","message":"Always call authenticate() before making API calls. The library does not auto-refresh tokens.","severity":"gotcha","affected_versions":"all"},{"fix":"Use another library like spotipy if you need user authorization.","message":"The library uses Spotify's Client Credentials Flow only. It does not support Authorization Code flow for user-specific endpoints.","severity":"gotcha","affected_versions":"<2.0 (if ever 2.0 changes this)"},{"fix":"Upgrade to Python 3.8+ for future compatibility.","message":"Python 3.6 support may be deprecated in future releases.","severity":"deprecated","affected_versions":">=1.2.8"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run pip install spotifywebapi in the correct Python environment.","cause":"Library not installed or wrong environment.","error":"ModuleNotFoundError: No module named 'spotifywebapi'"},{"fix":"Call api.authenticate() and do not reuse expired tokens.","cause":"Forgot to call authenticate() before making requests, or token expired.","error":"spotifywebapi.exceptions.InvalidTokenError: Token is invalid or expired"},{"fix":"Provide both client_id and client_secret as arguments.","cause":"Missing credentials when creating SpotifyAPI instance.","error":"TypeError: __init__() missing 2 required positional arguments: 'client_id' and 'client_secret'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}