For devs or anyone curious about their Spotify data - this is a full walkthrough of building your own listening history tracker. You'll register an app with Spotify, authenticate, poll for new plays going forward, and backfill your entire history using Spotify's data request tool. No frameworks, just raw API calls, so you can build it in whatever language you want.
I Show How To:
Register your app in the Spotify Developer Dashboard
Walk through the authorization code flow: authorize → get a code → trade it for an access + refresh token using Postman
Hit the Recently Played endpoint and confirm real data coming back using a Python script
Build a poller that checks for new plays on a schedule and stores them (I used Postgres via Neon)
Automate it with a scheduled job (I used a GitHub Action — let me know if you want a video on setting that up)
Request your full historical listening data from Spotify (including podcasts — there's no API endpoint for podcast history, this is the only way to get it)
Batch backfill your database from the historical data dump
Links & Docs referenced:
Spotify Developer Dashboard: https://developer.spotify.com/dashboard
Spotify Web API docs: https://developer.spotify.com/documen...
Authorization Code Flow guide: https://developer.spotify.com/documen...
Authorize endpoint (GET): `https://accounts.spotify.com/authorize`
Token endpoint (POST): `https://accounts.spotify.com/api/token`
Access Token docs: https://developer.spotify.com/documen...
Get Recently Played Tracks endpoint: https://developer.spotify.com/documen...
Full API Reference (all endpoints): https://developer.spotify.com/documen...
Download your Spotify data (account privacy page, select "Extended streaming history"): https://www.spotify.com/account/privacy/
Data rights & privacy info: https://support.spotify.com/us/articl...
Neon (Postgres): https://neon.com
Note: requires a Spotify Premium account to register an app. The historical data request can take up to 30 days to process. Spotify emails you when it's ready.
#Spotify #SpotifyAPI #WebDev #Python #Postman