Turn any KEXP radio show into a Spotify playlist. Browse programs, pick an episode, and sync the tracklist — or automate it with CLI flags.
- Fetches the tracklist from a KEXP show episode via the public KEXP API
- Searches for each track on Spotify using a multi-strategy search (exact match, quoted search, fuzzy artist matching)
- Creates a Spotify playlist and adds the found tracks, skipping duplicates
- Python 3.13+
- A Spotify Developer application
git clone https://github.com/johnmmdavidson/kexp-spotify-sync.git
cd kexp-spotify-sync
python -m venv venv
source venv/bin/activate
pip install -r requirements.txtcp .env.example .envEdit .env with your Spotify app credentials:
SPOTIFY_CLIENT_ID=your_client_id
SPOTIFY_CLIENT_SECRET=your_client_secret
SPOTIFY_REDIRECT_URI=http://127.0.0.1:8080/callback
Your Spotify app must have http://127.0.0.1:8080/callback as a redirect URI in its settings.
On first run, a browser window will open for Spotify OAuth. The token is cached locally in .spotify_cache for subsequent runs.
Browse all active KEXP programs, pick an episode, and sync:
python main.pySync a specific show and date:
python main.py --show "Astral Plane" --date 2026-02-19Sync the latest episode of a show:
python main.py --show "Audioasis" --latestSync into an existing playlist instead of creating a new one:
python main.py --show "Audioasis" --latest --playlist PLAYLIST_ID# List all active KEXP programs
python main.py --list
# Preview what would sync without touching Spotify
python main.py --show "Midnight in a Perfect World" --latest --dry-runSpotify search uses three strategies in order:
- Exact field search —
track:"Song Name" artist:"Artist Name" album:"Album" - Quoted search —
"Artist Name" "Song Name"as a combined query - Title-only with artist similarity — searches by song title, then filters results by how closely the artist name matches
This catches most tracks, including ones with slight naming differences between KEXP metadata and Spotify's catalog.
main.py # CLI entrypoint and orchestrator
config.py # Loads Spotify credentials from .env
kexp_client.py # Fetches songs from a KEXP show episode
kexp_shows.py # Lists KEXP programs and episodes
spotify_client.py # Spotify OAuth, search, and playlist management