Spotify Provider
The Spotify provider enables syncing your Spotify listening history and playlists with Spotter.
Features
- Sync recently played tracks (last 50)
- Import Spotify playlists
- Sync playlists to Navidrome with track matching
- OAuth 2.0 authentication with automatic token refresh
Limitations
Important Limitation
Spotify's API only provides access to your 50 most recently played tracks. For comprehensive listening history, we recommend also connecting Last.fm.
Setup
1. Create Spotify App
- Go to the Spotify Developer Dashboard
- Log in with your Spotify account
- Click Create App
- Fill in the app details:
- App name: Spotter (or any name)
- App description: Personal music tracking app
- Redirect URI:
http://localhost:8080/auth/spotify/callback - Check the Web API checkbox
- Click Save
- Click Settings on your app's dashboard
- Copy the Client ID and Client Secret
2. Configure Spotter
Add these to your .env file:
SPOTTER_SPOTIFY_CLIENT_ID=your_client_id_here
SPOTTER_SPOTIFY_CLIENT_SECRET=your_client_secret_here
SPOTTER_SPOTIFY_REDIRECT_URL=http://localhost:8080/auth/spotify/callback
3. Connect Account
- Open Spotter and go to Preferences > Services
- Click Connect Spotify
- Authorize Spotter in the Spotify popup
- You'll be redirected back to Spotter
Configuration
| Variable | Description | Default |
|---|---|---|
SPOTTER_SPOTIFY_CLIENT_ID | Spotify Client ID | Required |
SPOTTER_SPOTIFY_CLIENT_SECRET | Spotify Client Secret | Required |
SPOTTER_SPOTIFY_REDIRECT_URL | OAuth callback URL | http://127.0.0.1:8080/auth/spotify/callback |
Synced Data
Listening History
- Last 50 recently played tracks
- Play timestamps
- Track metadata
Playlists
- All your Spotify playlists
- Track listings
- Playlist images and descriptions
Playlist Syncing
Spotify playlists can be synced to your Navidrome library:
- Go to any Spotify playlist in Spotter
- Enable Sync to Navidrome
- Spotter matches tracks to your Navidrome library
- A new playlist is created in Navidrome
- Updates automatically when the Spotify playlist changes
Track Matching
Tracks are matched using:
- ISRC: International Standard Recording Code (most reliable)
- Exact Match: Artist + track name
- Fuzzy Match: Similar names with confidence threshold
Token Management
Spotter automatically handles OAuth tokens:
- Access tokens are refreshed automatically
- Refresh tokens are stored securely in the database
- Disconnecting removes all stored tokens
Troubleshooting
"Invalid redirect URI"
The redirect URI in your Spotify app must exactly match SPOTTER_SPOTIFY_REDIRECT_URL.
Common issues:
- Missing trailing slash
- HTTP vs HTTPS mismatch
- Different port number
"Access token expired"
Spotter should automatically refresh tokens. If issues persist:
- Disconnect Spotify from Preferences
- Reconnect your account
Missing Playlists
Only playlists you own or follow are synced. Collaborative playlists may have limited access depending on permissions.
Rate Limiting
Spotify has rate limits. If you see 429 errors:
- Wait a few minutes
- Spotter will automatically retry
- Consider increasing sync interval
Production Deployment
For production use:
- Update the redirect URI in your Spotify app settings
- Update
SPOTTER_SPOTIFY_REDIRECT_URLto match your production domain - Ensure HTTPS is configured