Registry / http-networking / spotify-sdk

spotify-sdk

JSON →
library0.10.0pypypi✓ verified 88d ago

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.

pip install spotify-sdk
INSTALL
IMPORT
SIG · SPOTIFY-SDK
S
spotify-sdk
http-networkingpythonv0.10.0
harness data pending
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())
Debug
Known issues
breakingVersion 0.10.0 introduces breaking changes: the async client is now the default. The synchronous client has been removed. All methods require await.
fix
Update your code to use async/await. Remove any synchronous calls.
affects: >=0.10.0
gotchaTokens must be set explicitly on the client after authentication. Forgetting to assign client.token results in an unauthorized error.
fix
After fetching a token, set client.token = token.
affects: all
deprecatedThe use of ClientCredentialsFlow without explicit scopes is deprecated. Provide scopes parameter for future functionality.
fix
Use ClientCredentialsFlow(client_id, client_secret, scopes=...).
affects: >=0.9.0
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.
fix
Ensure 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.
fix
Double-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.
fix
Ensure 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.

Agent activity
30 hits · last 30 days
node
26
OpenAI (training)
1
Resources
spotify-sdk — pip install spotify-sdk · libregistry