{"id":28207,"library":"spotify-sdk","title":"Spotify SDK","description":"A Python SDK for the Spotify Web API. Current version is 0.10.0, requiring Python >=3.10. The library is actively maintained with a focus on async/await patterns.","status":"active","version":"0.10.0","language":"python","source_language":"en","source_url":"https://github.com/jakob-krieger/spotify-sdk","tags":["spotify","api","sdk","async"],"install":[{"cmd":"pip install spotify-sdk","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Incorrect submodule import; SpotifyClient is directly importable from the top-level package.","wrong":"from spotify_sdk.client import SpotifyClient","symbol":"SpotifyClient","correct":"from spotify_sdk import SpotifyClient"},{"note":"Auth flows are in the auth submodule, not top-level.","wrong":"from spotify_sdk import ClientCredentialsFlow","symbol":"ClientCredentialsFlow","correct":"from spotify_sdk.auth import ClientCredentialsFlow"}],"quickstart":{"code":"import asyncio\nfrom spotify_sdk import SpotifyClient\nfrom spotify_sdk.auth import ClientCredentialsFlow\n\nasync def main():\n    client = SpotifyClient()\n    flow = ClientCredentialsFlow(client_id='your_client_id', client_secret='your_client_secret')\n    token = await flow.fetch_token()\n    client.token = token\n    result = await client.search('Never Gonna Give You Up', types=['track'])\n    print(result)\n\nasyncio.run(main())","lang":"python","description":"Authenticate via client credentials and perform a track search."},"warnings":[{"fix":"Update your code to use async/await. Remove any synchronous calls.","message":"Version 0.10.0 introduces breaking changes: the async client is now the default. The synchronous client has been removed. All methods require await.","severity":"breaking","affected_versions":">=0.10.0"},{"fix":"After fetching a token, set client.token = token.","message":"Tokens must be set explicitly on the client after authentication. Forgetting to assign client.token results in an unauthorized error.","severity":"gotcha","affected_versions":"all"},{"fix":"Use ClientCredentialsFlow(client_id, client_secret, scopes=...).","message":"The use of ClientCredentialsFlow without explicit scopes is deprecated. Provide scopes parameter for future functionality.","severity":"deprecated","affected_versions":">=0.9.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Ensure you are using the async client (default) and prefix all method calls with 'await'.","cause":"Calling a method that is not async or forgetting await on a coroutine.","error":"TypeError: object dict can't be used in 'await' expression"},{"fix":"Double-check your credentials in the Spotify Developer Dashboard and use the correct flow (e.g., ClientCredentialsFlow for client-only apps).","cause":"Incorrect client_id or client_secret, or using the wrong authentication flow.","error":"spotify_sdk.exceptions.SpotifyAuthError: (400) 'invalid_client'"},{"fix":"Ensure you await flow.fetch_token() and assign the returned token to client.token.","cause":"Failed to fetch token or forgot to set client.token after authentication.","error":"AttributeError: 'NoneType' object has no attribute 'token'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}