Spotify Web API for Openclaw

A cross-platform skill allowing AI agents to control Spotify playback, search tracks, and analyze listening history via the official Web API.

mvanhorn
v1.0.0
Jan 22, 2026
0
0
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install spotify-web-api

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install spotify-web-api using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Spotify Web API?

The Spotify Web API skill for Openclaw Skills provides a robust interface for managing music and audio content directly from your AI agent environment. By utilizing the official Spotify Web API, this skill bypasses platform-specific limitations, making it compatible with Windows, Linux, and macOS. It empowers users to integrate music management into their automated workflows, allowing for a more immersive and personalized developer experience within the Openclaw Skills ecosystem.

This integration allows an agent to act as a personal DJ and music librarian. Whether you need to identify a current track, skip to the next song during a focus session, or retrieve your top artists for the year, this skill handles the authentication and API communication seamlessly. It represents a significant step in making media control a first-class citizen in the world of Openclaw Skills.

Spotify Web API Use Cases

  • Managing music playback (play, pause, skip) via conversational commands while coding.
  • Retrieving listening history to document or share recently played tracks.
  • Generating reports on top tracks and artists for personal productivity analysis.
  • Searching the massive Spotify library for specific songs or albums without switching applications.
  • Switching or identifying active playback devices across a local network.

How Spotify Web API Works

  1. The skill utilizes a Python-based script to interface with the Spotify Web API endpoints.
  2. Users authorize the application via a standard OAuth 2.0 flow, which is initiated through a local redirect URI.
  3. Upon successful authentication, an access token is generated and securely cached in the user's home directory.
  4. Commands issued to the AI agent are parsed and translated into specific API requests (e.g., GET /me/player/currently-playing or POST /me/player/next).
  5. The skill processes the JSON responses from Spotify and presents the relevant metadata or confirmation back to the Openclaw Skills interface.

Spotify Web API Setup

1. Developer Portal Configuration

Log in to the Spotify Developer Dashboard and create a new application. Ensure you add http://localhost:8888/callback as a valid Redirect URI in the settings.

2. Environment Setup

Configure your shell with the credentials obtained from the dashboard:

export SPOTIFY_CLIENT_ID="your_client_id"
export SPOTIFY_CLIENT_SECRET="your_client_secret"

3. Authentication

Run the built-in authentication routine to link your Spotify account to your Openclaw Skills environment:

python3 scripts/spotify.py auth

Follow the browser prompts to grant permission.

Spotify Web API Data Schema & Taxonomy

The skill manages data primarily through local caching and API response mapping:

  • Token Storage: Credentials and refresh tokens are stored in ~/.spotify_cache.json.
  • Command Mapping:
    Command Action API Endpoint
    now Current Track /v1/me/player/currently-playing
    top Analytics /v1/me/top/{type}
    play Playback /v1/me/player/play
    devices Hardware /v1/me/player/devices

Spotify Web API Advanced Features

  • Support for time-period filtering (month/year) when retrieving top tracks and artists.
  • Intelligent search functionality that parses song titles and artist names for immediate playback.
  • Multi-device awareness, allowing the agent to list all active Spotify Connect devices.
  • Full support for both Spotify Free (history/search) and Spotify Premium (playback control) users.
  • Local token caching for persistent, headless operation within the Openclaw Skills framework.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*