To control Spotify from OpenClaw, install the spotify-player skill with `clawhub install spotify-player`, then create a Spotify app at developer.spotify.com to get a Client ID and Client Secret. Store both in OpenClaw's config, complete the one-time OAuth login, and type playback commands directly in OpenClaw chat — play, pause, skip, queue, and search from any messaging platform you have connected to OpenClaw.
Why Use Spotify Player in OpenClaw?
The Spotify Player skill turns OpenClaw into a hands-free music controller. Instead of switching apps or finding your phone, you can type a command in any OpenClaw-connected chat and Spotify responds instantly — on whatever device is active. This is especially useful for users who have OpenClaw integrated into their workflow tools: imagine queuing a focus playlist from Slack, skipping a track from Telegram, or asking OpenClaw to find music similar to what you just listened to, all without leaving your current context.
With 35 clicks and 842 impressions in Google Search Console, spotify-player is the highest-performing non-search skill in the OpenClaw ecosystem, which reflects how universally useful music control is for OpenClaw users. The integration uses Spotify's official Web API, which supports all premium playback features including queue management, shuffle, repeat, and device switching. Free Spotify accounts have limited API access (no on-demand playback), so Spotify Premium is required for the full command set.
The OAuth setup takes about 10 minutes on the first run. After that, the skill silently refreshes tokens in the background, so you can use it continuously for months without re-authenticating. The SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET credentials come from a free Spotify Developer account — you create a development app to get them, and Spotify does not charge for API access on personal projects.
Integration method
The Spotify Player skill integrates with OpenClaw via ClawHub, using Spotify's official Web API for playback control. After a one-time OAuth authentication flow, the skill stores your access tokens locally and refreshes them automatically — you never need to log in again. All playback commands are issued through natural language in OpenClaw chat, which the skill translates into Spotify API calls. This means you can control Spotify from any platform connected to OpenClaw, including Discord bots, Telegram, or your own chat interfaces.
Prerequisites
- OpenClaw installed and running (version 1.0 or later)
- A Spotify Premium account — free accounts have restricted Web API access for playback
- A Spotify Developer account at developer.spotify.com (free, same Spotify login)
- Spotify open and active on at least one device before issuing playback commands
- The clawhub CLI available in your terminal
Step-by-step guide
Install the spotify-player Skill via ClawHub
Install the spotify-player Skill via ClawHub
Open your terminal and install the spotify-player skill from the ClawHub registry. The skill package includes the Spotify Web API client, OAuth handling, and the natural language command parser that maps chat messages to Spotify API calls. After installation completes, verify it is active by listing your installed skills. You should see spotify-player with a version number and 'installed' status. The skill will appear as 'inactive' until you complete the OAuth authentication in a later step — this is expected. If you are running OpenClaw on a server or headless machine, note that the OAuth step requires a browser redirect. You can complete the auth on a machine with a browser, then copy the resulting token files to your server. The spotify-player documentation on ClawHub explains the manual token transfer process for headless setups.
1# Install the Spotify Player skill2clawhub install spotify-player34# Verify installation5clawhub list --installed | grep spotify-player67# Check initial status (will show 'inactive' until OAuth is complete)8clawhub status spotify-playerPro tip: If you see 'version conflict' during install, run `clawhub update` first to refresh the registry, then retry. The spotify-player skill requires OpenClaw 1.2+ for multi-device support.
Expected result: The terminal shows 'spotify-player installed successfully' and the skill appears in the installed list with 'inactive' status.
Create a Spotify Developer App to Get Your API Credentials
Create a Spotify Developer App to Get Your API Credentials
The Spotify Player skill requires a Spotify Developer app to authenticate. This is a free step — Spotify provides API access at no cost for personal and development projects. Go to developer.spotify.com and log in with your regular Spotify account. Click 'Create App' in the top-right corner. Fill in the form: - App name: 'OpenClaw Controller' (or any name you choose) - App description: 'OpenClaw Spotify integration' - Redirect URI: enter `http://localhost:8888/callback` exactly — this is where Spotify sends the auth code during the OAuth flow - API/SDKs: check 'Web API' Click 'Save'. Spotify creates the app and takes you to its dashboard. Click 'Settings' in the top-right of the app dashboard. You will see your Client ID displayed — copy it. Click 'View client secret' to reveal your Client Secret — copy it immediately. Keep this browser tab open — you will need both values in the next step. Never share your Client Secret or commit it to version control.
1# Redirect URI to enter in Spotify Developer dashboard:2http://localhost:8888/callback34# Scopes required by the spotify-player skill (automatically requested during OAuth):5# user-read-playback-state6# user-modify-playback-state7# user-read-currently-playing8# playlist-read-private9# user-library-readPro tip: The app name and description do not affect functionality. Use descriptive names so you remember what the app is for if you return to the Spotify Developer dashboard months later.
Expected result: You have a Spotify Developer app with a Client ID and Client Secret visible in the Settings panel.
Configure Your Spotify Credentials in OpenClaw
Configure Your Spotify Credentials in OpenClaw
Add your Spotify Client ID and Client Secret to the OpenClaw config file. Open `~/.openclaw/config.yaml` in a text editor and add the spotify-player skill section under the `skills` key. If a `skills` section already exists from other installed skills, add the spotify-player block inside it. The SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET values go directly in the config file under the skill's settings block. OpenClaw encrypts sensitive values in the config at rest — the values you enter here are not stored as plaintext after OpenClaw first reads them. If you prefer to use environment variables instead of the config file (for example, in a server deployment), the skill also reads SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET from the shell environment automatically. Both approaches work; the config file is simpler for personal desktop setups.
1# ~/.openclaw/config.yaml2skills:3 spotify-player:4 client_id: "YOUR_SPOTIFY_CLIENT_ID_HERE"5 client_secret: "YOUR_SPOTIFY_CLIENT_SECRET_HERE"6 redirect_uri: "http://localhost:8888/callback"7 default_device: "" # Optional: set to your preferred device name8 volume_step: 10 # Volume increment for 'turn up/down' commands (default: 10)9 queue_limit: 10 # Max songs to add when queuing a playlist (default: 5)Pro tip: The `default_device` setting accepts the exact name of a Spotify device as it appears in the Spotify app (Settings > Devices). Setting this avoids 'no active device' errors when Spotify is not currently playing on any device.
Expected result: The config file saves with your credentials. OpenClaw reads the updated config on the next command.
Complete the One-Time Spotify OAuth Authentication
Complete the One-Time Spotify OAuth Authentication
With credentials configured, trigger the OAuth flow to authorize OpenClaw to control your Spotify account. Run the auth command in your terminal — this starts a local server on port 8888 and opens your browser to the Spotify authorization page. In the browser, you will see a Spotify permission screen listing the actions OpenClaw is requesting: read playback state, control playback, read playlists, and read your library. Click 'Agree'. Spotify redirects back to localhost:8888/callback, completes the token exchange, and the terminal shows 'Authentication successful'. The skill stores the access token and refresh token locally in `~/.openclaw/tokens/spotify-player.json`. The access token expires every 60 minutes, but the skill refreshes it automatically using the refresh token — you will not need to repeat this step unless you revoke the app's access from your Spotify account settings.
1# Trigger the OAuth authentication flow2clawhub auth spotify-player34# The command will output something like:5# Opening browser for Spotify authorization...6# Waiting for callback on http://localhost:8888/callback7# Authentication successful! Token saved.89# Verify auth succeeded10clawhub status spotify-player11# Should now show 'active' statusPro tip: If the browser does not open automatically, the terminal will print the authorization URL. Copy and paste it into your browser manually. This is common on Linux systems without a default browser configured.
Expected result: The terminal shows 'Authentication successful! Token saved.' and `clawhub status spotify-player` shows 'active'.
Test Playback Commands in OpenClaw Chat
Test Playback Commands in OpenClaw Chat
Open the OpenClaw chat interface and test Spotify commands. Make sure Spotify is open and active on at least one device before issuing commands — the Spotify API requires an active device to receive playback instructions. Start with a simple command to confirm the integration is working, then explore more complex commands. The spotify-player skill understands natural language, so you do not need to memorize specific syntax. Commands like 'play some jazz', 'skip to the next track', 'turn the volume up', and 'what song is playing' all work as you would expect. For the best results, phrase commands clearly and include the artist or track name when searching for specific music. The skill uses Spotify's search API to find the best match and plays or queues it automatically.
What song is currently playing on Spotify? Then skip to the next track.
Paste this in OpenClaw chat
1# Example OpenClaw chat commands for spotify-player:23# Basic playback control4"Play Spotify"5"Pause"6"Skip to the next track"7"Go back to the previous song"89# Search and play10"Play 'Bohemian Rhapsody' by Queen on Spotify"11"Play my Discover Weekly playlist"12"Play some lo-fi hip hop for studying"1314# Queue management15"Add 'Hotel California' to my Spotify queue"16"Clear my queue and play my liked songs on shuffle"1718# Volume and device19"Turn Spotify volume up to 80%"20"Switch playback to my iPhone"2122# Information23"What album is this song from?"24"Who is the artist currently playing?"Pro tip: If you get a 'No active device found' error, open Spotify on any device and play something manually first. Once a device is active, all subsequent OpenClaw commands will route to it automatically.
Expected result: OpenClaw controls Spotify playback and confirms actions — 'Now playing: [song] by [artist]' or 'Skipped to next track'.
Common use cases
Hands-Free Music Control During Work
Control Spotify without switching apps while working. Type playback commands directly in OpenClaw chat — pause for a meeting, skip a track you don't like, or search for a new album without losing your flow in whatever tool you're currently using.
Pause Spotify, then queue the album 'Kind of Blue' by Miles Davis and start playing it
Copy this prompt to try it in OpenClaw
Smart Playlist and Queue Management
Build and manage your queue through conversation rather than clicking through the Spotify app. Ask for music by mood, genre, or similarity to something you're already playing, and the skill handles the search and queue in one step.
Add 5 more songs similar to what I'm currently playing to my Spotify queue
Copy this prompt to try it in OpenClaw
Multi-Device Playback Switching
Switch Spotify playback between devices — laptop, phone, smart speaker — using OpenClaw chat commands. Useful when you move between rooms or want to hand off audio to a different device without opening the Spotify app.
Switch Spotify playback from my laptop to my living room speaker and increase volume to 70%
Copy this prompt to try it in OpenClaw
Troubleshooting
clawhub auth spotify-player opens the browser but shows 'INVALID_CLIENT: Invalid redirect URI'
Cause: The redirect URI in your OpenClaw config does not exactly match the URI registered in your Spotify Developer app. Even a trailing slash difference causes this error.
Solution: Go to developer.spotify.com, open your app settings, and verify the Redirect URI field contains exactly `http://localhost:8888/callback` with no trailing slash. Update either the Spotify app or your OpenClaw config so both match, then run `clawhub auth spotify-player` again.
1# Ensure this exact string is in both places:2redirect_uri: "http://localhost:8888/callback"3# NOT: http://localhost:8888/callback/4# NOT: https://localhost:8888/callbackOpenClaw returns 'No active Spotify device found' when issuing playback commands
Cause: Spotify's API requires at least one active device (one that has recently played audio) to receive playback commands. If Spotify has been idle for too long, all devices go inactive.
Solution: Open Spotify on any device, press play on any song, then return to OpenClaw and issue your command again. To avoid this in the future, set `default_device` in your config to your most-used device name — the skill will then try to activate that device automatically.
1# In ~/.openclaw/config.yaml:2skills:3 spotify-player:4 default_device: "MacBook Pro" # Use exact name from Spotify appSpotify commands stopped working after several weeks — 'token expired' or 'authentication required' error
Cause: The OAuth refresh token may have been revoked, typically because you changed your Spotify password, revoked the app's access in Spotify account settings, or the token file was deleted.
Solution: Run `clawhub auth spotify-player` to redo the OAuth flow. This generates fresh access and refresh tokens. If you changed your Spotify password recently, this is the expected fix — Spotify revokes all third-party app access when passwords change.
1# Re-authenticate2clawhub auth spotify-player34# If token file is corrupted, delete it first:5rm ~/.openclaw/tokens/spotify-player.json6clawhub auth spotify-playerThe skill installs but commands return 'Premium required' or playback does not start
Cause: Spotify's Web API requires a Premium subscription for on-demand playback control. Free accounts can only play in shuffle mode and cannot control specific tracks via the API.
Solution: Upgrade to Spotify Premium to use the full command set. With a free account, only shuffle play commands will work — you cannot play specific tracks or control the queue. Check your account status at spotify.com/account.
Best practices
- Set a `default_device` in your OpenClaw config to avoid 'no active device' errors — use the exact device name shown in the Spotify app under Settings > Devices.
- Keep your Spotify Developer app's redirect URI set to exactly `http://localhost:8888/callback` with no variation — even a trailing slash will break OAuth and require you to redo the setup.
- Never commit your SPOTIFY_CLIENT_SECRET to a Git repository or share it — anyone with this key can authenticate as your Spotify developer app and issue API calls on its behalf.
- Re-authenticate with `clawhub auth spotify-player` after changing your Spotify password — Spotify automatically revokes all third-party OAuth tokens when you update your password.
- Use specific track and artist names in your OpenClaw prompts ('Play Nightswimming by R.E.M.' rather than 'play that R.E.M. song') to get accurate search results rather than Spotify's best guess.
- For multi-room setups, name your Spotify devices descriptively in the Spotify app (Living Room Speaker, Office Mac) so you can switch between them with clear OpenClaw commands.
- Keep the spotify-player skill updated with `clawhub update spotify-player` to pick up Spotify API compatibility improvements — Spotify occasionally updates their API endpoints and the skill needs to stay in sync.
Alternatives
YouTube Watcher monitors video channels and sends notifications rather than controlling playback — better for staying on top of new content than for music listening.
The YouTube skill handles video search and interaction rather than dedicated music playback control — use it for video content, Spotify Player for music.
Sonos CLI is better if you use Sonos speakers as your primary audio system rather than Spotify as your music source — it controls the hardware directly regardless of the streaming service.
Frequently asked questions
How do I install OpenClaw Spotify integration?
Run `clawhub install spotify-player` in your terminal, then create a free Spotify Developer app at developer.spotify.com to get a Client ID and Secret. Add both to your OpenClaw config file, run `clawhub auth spotify-player` to complete the one-time OAuth login, and you are ready to control Spotify from OpenClaw chat.
Do I need Spotify Premium to use the OpenClaw spotify-player skill?
Yes — Spotify Premium is required for on-demand playback control via the Web API. With a free account, the API only allows shuffle play and you cannot control specific tracks or the queue. The skill will install and authenticate on a free account, but most playback commands will return a 'Premium required' error.
How do I configure the OpenClaw Spotify API key?
Spotify uses OAuth rather than a single API key. You need a Client ID and Client Secret from a free Spotify Developer app at developer.spotify.com. Add these to `~/.openclaw/config.yaml` under the spotify-player skill settings, then run `clawhub auth spotify-player` to complete authentication. The skill manages token refresh automatically after that.
Why is clawhub install spotify-player not working?
First run `clawhub update` to refresh the registry index, then retry the install. If you see a version conflict, your OpenClaw installation may be older than the minimum required version (1.2+) — check with `openclaw --version`. For 429 rate limit errors, wait 60 seconds and use `clawhub install spotify-player --mirror eu` to use an alternate download mirror.
Can I control Spotify from Telegram or Discord using OpenClaw?
Yes — that is one of the primary use cases. If you have OpenClaw connected to Telegram, Discord, or another messaging platform, Spotify commands work from any of those interfaces. OpenClaw routes the command to the spotify-player skill regardless of which chat platform the message came from.
What should I do if my OpenClaw Spotify commands stopped working?
The most common cause after the skill was previously working is an expired or revoked OAuth token. Run `clawhub auth spotify-player` to re-authenticate. This is especially common after changing your Spotify password, since Spotify revokes all third-party access when passwords are updated. If you need help diagnosing more complex authentication issues, RapidDev's team can walk you through the token refresh configuration.
How do I switch Spotify playback to a different device using OpenClaw?
Type a command like 'Switch Spotify to my iPhone' or 'Transfer playback to Living Room Speaker' in the OpenClaw chat. The skill uses the device name exactly as it appears in the Spotify app. For faster switching, set a `default_device` value in your OpenClaw config so the skill defaults to your preferred device when multiple are available.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation