Getting Started with Spotify Skills for Claude
October 22, 2025 · View on GitHub
Quick setup guide for the Spotify API Skill
Prerequisites
- Python 3.8 or higher
- Spotify account (Free or Premium)
- Claude Desktop (if using with Claude)
Quick Setup (3 Steps)
1. Enable Network Access in Claude Desktop
⚠️ REQUIRED - The skill needs to access api.spotify.com
- Open Claude Desktop → Settings → Developer
- Toggle "Allow network egress" to ON (blue)
- Choose domain access:
- "All domains" (easiest), OR
- "Specified domains" → add
api.spotify.com(more secure)

2. Install Dependencies
pip install -r requirements.txt
This installs:
requests- For HTTP API callspython-dotenv- For loading credentialscairosvg- For SVG → PNG conversion (cover art generation)pillow- For image optimization (cover art generation)
3. Get Spotify Credentials
-
Create a new app
-
Copy your Client ID and Client Secret
-
Add redirect URI:
http://127.0.0.1:8888/callback -
Create
spotify-api/.envfrom the example:# Copy the example file cp spotify-api/.env.example spotify-api/.env # Edit with your credentials code spotify-api/.envUpdate these values:
SPOTIFY_CLIENT_ID=your_client_id_here SPOTIFY_CLIENT_SECRET=your_client_secret_here
4. Get Your Refresh Token
Run the token generator:
python get_refresh_token.py
This will:
- Open your browser to authorize with Spotify
- Generate a refresh token
- Display it in your terminal
Copy the refresh token and add it to spotify-api/.env:
SPOTIFY_REFRESH_TOKEN=your_refresh_token_here
5. Test It!
python spotify-api/scripts/test_credentials.py
You should see: ✅ ALL TESTS PASSED!
What's Next?
Use the Skill
from spotify_client import create_client_from_env
# Initialize client
client = create_client_from_env()
client.refresh_access_token()
# Get your playlists
playlists = client.get_user_playlists()
for playlist in playlists:
print(f"📋 {playlist['name']} - {playlist['tracks']['total']} tracks")
Create Playlists
from playlist_creator import PlaylistCreator
creator = PlaylistCreator(client)
# Create playlist from an artist
playlist = creator.create_from_artist(
artist_name="Radiohead",
playlist_name="Best of Radiohead",
limit=25
)
Generate Cover Art 🎨 (NEW!)
⚡ UNIQUE: Claude cannot generate images natively, but this skill can!
from cover_art_generator import CoverArtGenerator
# Initialize generator
art_gen = CoverArtGenerator(
client_id=os.getenv("SPOTIFY_CLIENT_ID"),
client_secret=os.getenv("SPOTIFY_CLIENT_SECRET"),
access_token=client.access_token
)
# Generate and upload cover art
art_gen.create_and_upload_cover(
playlist_id=playlist['id'],
title="Best of Radiohead",
subtitle="Essential Tracks",
artist="radiohead" # Uses Radiohead's signature colors
)
# Or test locally first
art_gen.generate_cover_art(
title="Summer Vibes",
theme="summer",
output_path="test_cover.png"
)
Features:
- Automatic text wrapping for long titles
- 20+ mood themes, 15+ genre colors, 10 artist palettes
- Large fonts (60-96px) optimized for thumbnails
- WCAG 2.1 accessibility compliant
See USER_GUIDE.md - Cover Art Generation for complete documentation.
Common Issues
"Network error" or "Connection refused"
The skill now automatically detects network issues and provides helpful guidance:
❌ NETWORK ACCESS BLOCKED
The Spotify API skill cannot access api.spotify.com.
🔧 FIX: Enable network egress in Claude Desktop:
1. Open Claude Desktop → Settings → Developer
2. Toggle 'Allow network egress' to ON (blue)
3. Set 'Domain allowlist' to either:
• 'All domains' (easiest), OR
• 'Specified domains' and add 'api.spotify.com'
If you see this message:
- Follow the steps above in Claude Desktop settings
- Restart Claude Desktop
- Try running your script again
"Missing credentials"
→ Check that your .env file has all required values:
SPOTIFY_CLIENT_IDSPOTIFY_CLIENT_SECRETSPOTIFY_REFRESH_TOKEN
"Token expired"
→ Run python get_refresh_token.py again to get a new refresh token
Documentation
- USER_GUIDE.md - Complete API documentation
- spotify-api/SKILL.md - Skill reference
Support
Having issues? Check:
- Network egress is enabled in Claude Desktop
- All credentials are in
spotify-api/.env - Dependencies are installed:
pip install -r requirements.txt - Your Spotify app redirect URI matches:
http://127.0.0.1:8888/callback
For detailed help, see USER_GUIDE.md