Authentication¶
All Spotify for Creators APIs share the same authentication chain:
sp_dc / sp_key cookies
│
└─▶ spotifyconnector._authenticate()
│
└─▶ Bearer token (used in Authorization header for all requests)
Step 1 — Obtain sp_dc and sp_key Cookies¶
These two cookies are the root credentials for the entire S4C session.
Security warning
sp_dc and sp_key grant full access to your Spotify account — music,
payments, and all features. Never share them with anyone and store them
in a .env file that is excluded from version control via .gitignore.
How to obtain them¶
- Open Chrome and navigate to
https://creators.spotify.com. - Log in with your Spotify account.
- Open DevTools (
F12orCmd+Option+I). - Go to Application → Cookies →
https://creators.spotify.com. - Copy the Value column for
sp_dcandsp_key.
Step 2 — Find Your Show ID¶
You can read your Show ID directly from the Spotify for Creators URL:
Step 3 — Obtain a Bearer Token¶
Use the unofficial spotifyconnector
Python library to exchange your cookies for a short-lived Bearer token.
Install¶
Usage¶
from spotifyconnector import SpotifyConnector
connector = SpotifyConnector(
base_url="https://generic.wg.spotify.com/podcasters/v0",
client_id="05a1371ee5194c27860b3ff3ff3979d2", # S4C public OAuth client_id
podcast_id="YOUR_SHOW_ID",
sp_dc="YOUR_SP_DC_COOKIE_VALUE",
sp_key="YOUR_SP_KEY_COOKIE_VALUE",
)
connector._authenticate() # internal method
bearer = connector._bearer # internal property — short-lived JWT
Note
_authenticate() and _bearer are internal (private) attributes of the
library. Their names may change in future versions of spotifyconnector.
The client_id value (05a1371ee5194c27860b3ff3ff3979d2) is the public
OAuth client ID embedded in the S4C web app and is the same for all users.
Using the Bearer Token¶
Once you have the Bearer token, include it in every API request:
GET requests¶
POST / PUT requests¶
headers_post = {
"Authorization": f"Bearer {bearer}",
"Accept": "application/json",
"Content-Type": "application/json",
"Origin": "https://creators.spotify.com",
"Referer": "https://creators.spotify.com/",
}
Warning
The Origin and Referer headers are required for POST requests.
Omitting them can cause the server to reject the request.