Install
openclaw skills install clawspotifyControl Spotify playback: play, pause, resume, skip, previous, restart, search, queue, set volume, shuffle, repeat, and view now-playing status.
openclaw skills install clawspotifyControl your Spotify playback directly from your OpenClaw agent or terminal. Works with both Free and Premium Spotify accounts.
clawhub install clawspotify
# Clone main skill
git clone https://github.com/ejatapibeda/ClawSpotify.git ~/.openclaw/workspace/skills/ClawSpotify
# Create virtual environment
python3 -m venv ~/.venv-clawspotify
# Install SpotAPI (modified version with session support)
git clone https://github.com/ejatapibeda/SpotAPI.git ~/.openclaw/workspace/skills/SpotAPI
~/.venv-clawspotify/bin/pip install -e ~/.openclaw/workspace/skills/SpotAPI
# Create wrapper script
cat > ~/.local/bin/clawspotify << 'EOF'
#!/bin/bash
VENV="/home/$(whoami)/.venv-clawspotify"
SCRIPT_DIR="/home/$(whoami)/.openclaw/workspace/skills/ClawSpotify"
exec "$VENV/bin/python" "$SCRIPT_DIR/scripts/spotify.py" "$@"
EOF
chmod +x ~/.local/bin/clawspotify
# Ensure ~/.local/bin is in PATH
export PATH="$HOME/.local/bin:$PATH"
clawspotify authenticates using two session cookies from your browser (sp_dc and sp_key). You only need to do this once per account.
https://open.spotify.comsp_dcsp_keyclawspotify setup --sp-dc "AQC..." --sp-key "07c9..."
Session is saved to ~/.config/spotapi/session.json and reused automatically.
clawspotify setup --sp-dc "..." --sp-key "..." --id "work"
clawspotify status --id "work"
Note: Cookies expire periodically. If commands fail with a 401 error, re-run setup with fresh cookies.
clawspotify status # default account
clawspotify status --id work # specific account
clawspotify search "Bohemian Rhapsody" # search tracks, show top 5
clawspotify search-playlist "Workout" # search playlists, show top 5
clawspotify play "Bohemian Rhapsody" # play first result
clawspotify play "Bohemian Rhapsody" --index 2 # pick result #2 (0-indexed)
clawspotify play-playlist "Lofi Girl" # play first playlist result
clawspotify pause
clawspotify resume
clawspotify skip # next track
clawspotify prev # previous track
clawspotify restart # restart from beginning
clawspotify queue "Stairway to Heaven"
clawspotify queue "spotify:track:3z8h0TU..." # add by URI
clawspotify volume 50 # set to 50%
clawspotify volume 0 # mute
clawspotify volume 100 # max
clawspotify shuffle on
clawspotify shuffle off
clawspotify repeat on
clawspotify repeat off
"default". Use --id flag to manage multiple Spotify accounts.Searching for "...", Playing: URI).ls ~/.venv-clawspotify/bin/python~/.venv-clawspotify/bin/pip install -e ~/.openclaw/workspace/skills/SpotAPIsp_dc, sp_key) expire. Re-run clawspotify setup with fresh cookies from browser.command not found: clawspotify)~/.local/bin is in your PATH: echo $PATH~/.venv-clawspotify/bin/python ~/.openclaw/workspace/skills/ClawSpotify/scripts/spotify.py <command>| Component | Path |
|---|---|
| Skill folder | ~/.openclaw/workspace/skills/ClawSpotify |
| Wrapper script | ~/.local/bin/clawspotify |
| Virtualenv | ~/.venv-clawspotify |
| SpotAPI (editable) | ~/.openclaw/workspace/skills/SpotAPI |
| Session credentials | ~/.config/spotapi/session.json |
| Main script | ~/skills/ClawSpotify/scripts/spotify.py |
When using this skill via OpenClaw agent:
play, pause, skip, etc.) are asynchronous. The command returns once Spotify accepts the request. Actual playback may take a few seconds to start.play, search, and status to avoid premature termination.clawspotify bash script. Alternatively, run Python directly:
python ~/.openclaw/workspace/skills/ClawSpotify/scripts/spotify.py play "song name"
Version: 1.0.1 (skill) | SpotAPI: 1.2.7 (custom) Homepage: https://github.com/ejatapibeda/ClawSpotify Author: Deli (OpenClaw agent) + ejatapibeda (original author)