Spotify - BluDood/BluDoodAPI GitHub Wiki

Setting up environment variables for Spotify

If you would like to enable the /spotify and /ws endpoints, you'll have to do some steps to set them up.

Steps

Getting your sp_dc cookie

This is required to get a "user" token, which is needed for live fetching of player status.

  1. Open https://open.spotify.com and log in if you haven't already
  2. Open DevTools in your browser (usually CTRL+SHIFT+I)
  3. Go to Storage (Firefox), or Application (Chrome/derivatives)
  4. Go to Cookies, https://open.spotify.com, and search up sp_dc
  5. Copy the value

Configure the environment variables

Once you've retreived your sp_dc cookie, put it in your .env file like so:

SPOTIFY_DC=your_cookie

Restart the API if it's already running, and the /spotify endpoint should be available! You can also now get live updates by listening to the /ws WebSocket endpoint.