Media & StreamingDocumentedScanned
spotify-web-api
Spotify control via Web API - playback, history, top tracks, search.
Share:
Installation
npx clawhub@latest install spotify-web-apiView the full skill documentation and source below.
Documentation
Spotify Web API (Cross-Platform)
Control Spotify via Web API. Works from any platform — no Mac required.
Setup
1. Create Spotify App:
4. Copy **Client ID** and **Client Secret**
### 2. Set Environment Variables:
__CODE_BLOCK_0__
### 3. Authenticate:
__CODE_BLOCK_1__
Opens browser for OAuth. Token cached in ~/.spotify_cache.json`.Commands
# Currently playing
python3 {baseDir}/scripts/spotify.py now
# Recently played
python3 {baseDir}/scripts/spotify.py recent
# Top tracks/artists
python3 {baseDir}/scripts/spotify.py top tracks --period month
python3 {baseDir}/scripts/spotify.py top artists --period year
# Playback control
python3 {baseDir}/scripts/spotify.py play
python3 {baseDir}/scripts/spotify.py play "bohemian rhapsody"
python3 {baseDir}/scripts/spotify.py pause
python3 {baseDir}/scripts/spotify.py next
python3 {baseDir}/scripts/spotify.py prev
# Search
python3 {baseDir}/scripts/spotify.py search "daft punk"
# List devices
python3 {baseDir}/scripts/spotify.py devices
Example Chat Usage
- "What am I listening to?"
- "What have I listened to lately?"
- "What are my top tracks this month?"
- "Play Bohemian Rhapsody"
- "Skip this song"
- "Pause the music"
Requirements
- Spotify Premium (for playback control)
- Free accounts can still view history/top tracks
API Reference
Uses the Spotify Web API: