Registry / http-networking / spotify-token

spotify-token

JSON →
library1.0.0pypypi✓ verified 79d ago

Python wrapper for fetching Spotify Webplayer access tokens, useful for interacting with the Spotify Webplayer API. Current version 1.0.0. Low maintenance cadence.

pip install spotify-token
INSTALL
IMPORT
SIG · SPOTIFY-TOKEN
S
spotify-token
http-networkingpythonv1.0.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.

start_session
from spotify_token import start_session
from spotify_token import SpotifyToken

Instantiate SpotifyToken with a client token and fetch an access token.

from spotify_token import SpotifyToken # You need a valid Spotify client token (from webplayer session) client_token = os.environ.get('SPOTIFY_CLIENT_TOKEN', '') st = SpotifyToken(client_token) try: access_token = st.get_access_token() print(f"Access token: {access_token}") except Exception as e: print(f"Error: {e}")
Debug
Known issues
gotchaThe library requires a valid Spotify webplayer client token, not a regular API client ID/secret. Common mistake: passing a client ID instead of the webplayer token.
fix
Obtain the client token from a logged-in Spotify web session (look for sp_dc or sp_key cookies).
affects: all
deprecatedThe library may break when Spotify changes its internal webplayer authentication flow. There has been no recent update.
fix
Consider using the official Spotify Web API with proper OAuth if possible.
affects: >=1.0.0
Upgrade
Version history
1.0.0latest on PyPI · released May 25, 2020
Audit
Dependencies

No dependency data recorded yet.

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