Access Spotify listening history, top artists/tracks, and get personalized recommendations via the Spotify Web API. Use when fetching a user's recent plays, analyzing music taste, or generating recommendations. Requires one-time OAuth setup.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install spotify-history或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install spotify-history⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/spotify-history/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: spotify-history description: Access Spotify listening history, top artists/tracks, and get personalized recommendations via the Spotify Web API. Use when fetching a user's recent plays, analyzing music taste, or generating recommendations. Requires one-time OAuth setup. ---
Access Spotify listening history and get personalized recommendations.
Run the setup wizard:
bash skills/spotify-history/scripts/setup.sh
This guides you through:
- Go to developer.spotify.com/dashboard - Click Create App - Fill in: - App name: Clawd (or any name) - App description: Personal assistant integration - Redirect URI: http://127.0.0.1:8888/callback ⚠️ Use exact URL! - Save and copy Client ID and Client Secret
Option A: Credentials file (recommended) ```bash mkdir -p credentials cat > credentials/spotify.json < Option B: Environment variables ```bash # Add to ~/.zshrc or ~/.bashrc export SPOTIFY_CLIENT_ID="your_client_id" export SPOTIFY_CLIENT_SECRET="your_client_secret" ``` With browser (local machine): ```bash python3 scripts/spotify-auth.py ``` Headless (no browser): ```bash python3 scripts/spotify-auth.py --headless ``` Follow the prompts to authorize via URL and paste the callback. Tokens are saved to When user asks about music: For recommendations, combine API data with music knowledge to suggest similar artists not in their library. ```bash rm ~/.config/spotify-clawd/token.json python3 scripts/spotify-auth.py ```~/.config/spotify-clawd/token.json and auto-refresh when expired.Usage
Command Line
# Recent listening history
python3 scripts/spotify-api.py recent
# Top artists (time_range: short_term, medium_term, long_term)
python3 scripts/spotify-api.py top-artists medium_term
# Top tracks
python3 scripts/spotify-api.py top-tracks medium_term
# Get recommendations based on your top artists
python3 scripts/spotify-api.py recommend
# Raw API call (any endpoint)
python3 scripts/spotify-api.py json /me
python3 scripts/spotify-api.py json /me/player/recently-playedTime Ranges
short_term — approximately last 4 weeksmedium_term — approximately last 6 months (default)long_term — all timeExample Output
Top Artists (medium_term):
1. Hans Zimmer [soundtrack, score]
2. John Williams [soundtrack, score]
3. Michael Giacchino [soundtrack, score]
4. Max Richter [ambient, modern classical]
5. Ludovico Einaudi [italian contemporary classical]Agent Usage
spotify-api.py recentspotify-api.py top-artistsspotify-api.py recommend + add your own knowledgeTroubleshooting
"Spotify credentials not found!"
credentials/spotify.json exists or environment variables are setbash skills/spotify-history/scripts/setup.sh to create credentials"Not authenticated. Run spotify-auth.py first."
python3 scripts/spotify-auth.py (or with --headless if no browser)"HTTP Error 400: Bad Request" during token refresh
bash skills/spotify-history/scripts/setup.shcredentials/spotify.json with correct Client ID/Secret"HTTP Error 401: Unauthorized"
Headless / No Browser
--headless flag: python3 scripts/spotify-auth.py --headlesshttp://127.0.0.1:8888/callback?code=...)Security Notes
127.0.0.1 (local only) for securityRequired Scopes
user-read-recently-played — recent listening historyuser-top-read — top artists and tracksuser-read-playback-state — current playbackuser-read-currently-playing — currently playing track
安装 Spotify History 后,可以对 AI 说这些话来触发它
Help me get started with Spotify History
Explains what Spotify History does, walks through the setup, and runs a quick demo based on your current project
Use Spotify History to access Spotify listening history, top artists/tracks, and get perso...
Invokes Spotify History with the right parameters and returns the result directly in the conversation
What can I do with Spotify History in my design & creative workflow?
Lists the top use cases for Spotify History, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/spotify-history/ 目录(个人级,所有项目可用),或 .claude/skills/spotify-history/(项目级)。重启 AI 客户端后,用 /spotify-history 主动调用,或让 AI 根据上下文自动发现并使用。
Spotify History 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Spotify History 可免费安装使用。请查阅仓库了解许可证信息。
Access Spotify listening history, top artists/tracks, and get personalized recommendations via the Spotify Web API. Use when fetching a user's recent plays, analyzing music taste, or generating recommendations. Requires one-time OAuth setup.
Spotify History 属于「Design & Creative」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my design & creative tasks using Spotify History
Identifies repetitive steps in your workflow and sets up Spotify History to handle them automatically