Spotify Configuration¶
Configure Spotify API access to fetch your liked tracks, followed artists, and playlists.
Create a Spotify App¶
- Go to the Spotify Developer Dashboard
- Log in with your Spotify account
- Click "Create app"
- Fill in the app details:
- App name: Artist Scraper (or any name you prefer)
- App description: Personal music library scraper
- Redirect URI:
http://localhost:8888/callback - APIs used: Web API
- Click "Save"
- In your app settings, note your:
- Client ID
- Client Secret (click "View client secret")
Get a Refresh Token¶
You need a refresh token to access your Spotify data.
Option 1: Using spotify-refresh-token-generator¶
-
Install the tool:
-
Run it:
-
Follow the prompts and paste your Client ID and Client Secret
-
Authorize the scopes:
user-library-readuser-follow-readplaylist-read-privateplaylist-read-collaborative
-
Copy the refresh token
Option 2: Using Spotipy (Python)¶
import spotipy
from spotipy.oauth2 import SpotifyOAuth
sp = SpotifyOAuth(
client_id='YOUR_CLIENT_ID',
client_secret='YOUR_CLIENT_SECRET',
redirect_uri='http://localhost:8888/callback',
scope='user-library-read user-follow-read playlist-read-private playlist-read-collaborative'
)
token_info = sp.get_access_token(as_dict=False)
print(f"Refresh token: {token_info}")
Update config.json¶
Add your Spotify credentials to config.json:
{
"spotify": {
"client_id": "your_spotify_client_id_here",
"client_secret": "your_spotify_client_secret_here",
"refresh_token": "your_spotify_refresh_token_here"
}
}
Required Scopes¶
The refresh token must have these scopes:
user-library-read- Access your liked tracksuser-follow-read- Access your followed artistsplaylist-read-private- Access your private playlistsplaylist-read-collaborative- Access collaborative playlists
What Data is Accessed?¶
Artist Scraper fetches:
- All tracks you've liked
- All artists you follow
- All your playlists (public, private, and collaborative)
- Track metadata (artist names, play counts)
It does not modify any data - all access is read-only.
Troubleshooting¶
"Failed to authenticate with Spotify"¶
- Verify your
client_id,client_secret, andrefresh_tokenare correct - Make sure your refresh token hasn't expired (regenerate if needed)
- Check that your redirect URI is exactly
http://localhost:8888/callback
"Insufficient client scope"¶
Your refresh token doesn't have the required scopes. Regenerate it with all required scopes listed above.
Next Steps¶
Configure YouTube Music to fetch artists from your YouTube Music library.