Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
SpotifyClient
✓ from spotify_sdk import SpotifyClient
✗ from spotify_sdk.client import SpotifyClient
Incorrect submodule import; SpotifyClient is directly importable from the top-level package.
ClientCredentialsFlow
✓ from spotify_sdk.auth import ClientCredentialsFlow
✗ from spotify_sdk import ClientCredentialsFlow
Auth flows are in the auth submodule, not top-level.
Authenticate via client credentials and perform a track search.
import asyncio
from spotify_sdk import SpotifyClient
from spotify_sdk.auth import ClientCredentialsFlow
async def main():
client = SpotifyClient()
flow = ClientCredentialsFlow(client_id='your_client_id', client_secret='your_client_secret')
token = await flow.fetch_token()
client.token = token
result = await client.search('Never Gonna Give You Up', types=['track'])
print(result)
asyncio.run(main())
Errors
Common errors & fixes
TypeError: object dict can't be used in 'await' expression
Calling a method that is not async or forgetting await on a coroutine.
fixEnsure you are using the async client (default) and prefix all method calls with 'await'.
spotify_sdk.exceptions.SpotifyAuthError: (400) 'invalid_client'
Incorrect client_id or client_secret, or using the wrong authentication flow.
fixDouble-check your credentials in the Spotify Developer Dashboard and use the correct flow (e.g., ClientCredentialsFlow for client-only apps).
AttributeError: 'NoneType' object has no attribute 'token'
Failed to fetch token or forgot to set client.token after authentication.
fixEnsure you await flow.fetch_token() and assign the returned token to client.token.
Upgrade
Version history
0.10.0latest on PyPI · released Mar 9, 2026
Audit
Dependencies
No dependency data recorded yet.