spotify

spotify is a skill for Claude Code, Codex from furkangonel/cowrangler. It costs 15 tokens per session (3,577 once invoked), scanned A, original, MIT.

A guide for connecting software to Spotify through the Spotify Web API, which lets programs search music, control playback, manage playlists, and request recommendations.

In plain words
What is it for?
Use it to search tracks, albums, or artists; play, pause, skip, seek, or change volume; create and update playlists; request recommendations; or retrieve track audio features such as tempo and energy.
Why use it?
It explains the authentication setup needed before a program can work with a user's Spotify account or public Spotify data.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it to search tracks, albums, or artists; play, pause, skip, seek, or change volume; create and update playlists; request recommendations; or retrieve track audio features such as tempo and energy.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/furkangonel/cowrangler/spotify
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add furkangonel/cowrangler --skill spotify
Clone the repo
git clone --depth 1 https://github.com/furkangonel/cowrangler

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for spotify

README.md
[![agentmods](https://agentmods.dev/badge/skills/furkangonel/cowrangler/spotify.svg)](https://agentmods.dev/skills/furkangonel/cowrangler/spotify)
Your own site
<a href="https://agentmods.dev/skills/furkangonel/cowrangler/spotify"><img src="https://agentmods.dev/badge/skills/furkangonel/cowrangler/spotify.svg" alt="Measured on agentmods" height="20"></a>
Per session 15 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,577 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00015 $0.03577
Opus 5 $0.00008 $0.01788
Sonnet 5 $0.00003 $0.00715
Haiku 4.5 $0.00002 $0.00358

Measured 7d ago against content hash e8326d3be8df, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

spotify scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

TOKEN=$(curl -s -X POST "https://accounts.spotify.com/api/token" \
bundled_skills/media/spotify/SKILL.md · 443 lines

How it starts

The opening of the file, as written. The whole thing — 443 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Spotify API Integration SOP

Control Spotify playback, manage playlists, search tracks, and fetch recommendations via the Spotify Web API.

When to Use

  • User wants to search for tracks, albums, or artists on Spotify
  • User wants to control playback (play, pause, skip, seek, volume)
  • User wants to create, update, or manage playlists
  • User wants to get track recommendations based on seeds
  • User wants to fetch audio features (tempo, energy, danceability) for tracks

Part 1 — Auth Setup

Spotify uses OAuth 2.0. For personal/CLI use, Authorization Code + PKCE is preferred (no server needed). For server-side scripts, use Client Credentials (no user context, limited endpoints).

1. Create an App

  1. Go to https://developer.spotify.com/dashboard
  2. Click Create app → name it → set Redirect URI to http://localhost:8888/callback
  3. Copy Client ID and Client Secret

2. Environment Variables

export SPOTIFY_CLIENT_ID="your_client_id"
export SPOTIFY_CLIENT_SECRET="your_client_secret"
export SPOTIFY_REDIRECT_URI="http://localhost:8888/callback"

Or in ~/.cowrangler/credentials.env:

SPOTIFY_CLIENT_ID=your_client_id
SPOTIFY_CLIENT_SECRET=your_client_secret
SPOTIFY_REDIRECT_URI=http://localhost:8888/callback

3. Client Credentials Token (no user context)

Grants access to public data: search, catalog, audio features. Does not allow playback control or playlist writes.

TOKEN=$(curl -s -X POST "https://accounts.spotify.com/api/token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials&client_id=${SPOTIFY_CLIENT_ID}&client_secret=${SPOTIFY_CLIENT_SECRET}" \
  | python3 -c "import sys,json; print(json.load(sys.stdin)['access_token'])")

echo "Token: $TOKEN"

4. Authorization Code Flow (user context — full access)

#!/usr/bin/env python3
"""get_spotify_token.py — run once to obtain a refresh token."""
import os, json, hashlib, base64, secrets, urllib.parse, urllib.request, http.server

CLIENT_ID     = os.environ["SPOTIFY_CLIENT_ID"]
CLIENT_SECRET = os.environ["SPOTIFY_CLIENT_SECRET"]
REDIRECT_URI  = os.environ.get("SPOTIFY_REDIRECT_URI", "http://localhost:8888/callback")
SCOPES        = " ".join([
    "user-read-playback-state",
    "user-modify-playback-state",
    "user-read-currently-playing",
    "playlist-read-private",
    "playlist-modify-public",
    "playlist-modify-private",
])

# Step 1 — Build auth URL
verifier = secrets.token_urlsafe(64)
challenge = base64.urlsafe_b64encode(
    hashlib.sha256(verifier.encode()).digest()
).rstrip(b"=").decode()

params = urllib.parse.urlencode({
    "client_id": CLIENT_ID, "response_type": "code",
    "redirect_uri": REDIRECT_URI, "scope": SCOPES,
    "code_challenge_method": "S256", "code_challenge": challenge,
})
print(f"Open this URL:\nhttps://accounts.spotify.com/authorize?{params}\n")

# Step 2 — Catch redirect
code = input("Paste the `code` query param from the redirect URL: ").strip()

# Step 3 — Exchange for tokens
body = urllib.parse.urlencode({
    "grant_type": "authorization_code", "code": code,
    "redirect_uri": REDIRECT_URI, "client_id": CLIENT_ID,
    "code_verifier": verifier,
}).encode()
req = urllib.request.Request(
    "https://accounts.spotify.com/api/token", data=body,
    headers={"Content-Type": "application/x-www-form-urlencoded"}, method="POST"
)
with urllib.request.urlopen(req) as r:
    tokens = json.load(r)

print("\nAdd to credentials.env:")
print(f"SPOTIFY_ACCESS_TOKEN={tokens['access_token']}")
print(f"SPOTIFY_REFRESH_TOKEN={tokens['refresh_token']}")

Read the full file on GitHub · 443 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 443 lines · 15 tokens per session scan A e8326d3be8df

Subscribe to this mod's changes

spotify is a skill published in the GitHub repository furkangonel/cowrangler (2 stars, last pushed today), licensed MIT. It adds 15 tokens to every session and 3,577 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.