Keep your favorite Spotify playlist synced with your latest liked songs
Automatically syncs your last 50 liked songs to a playlist — every 30 minutes, no server required.
- 🔄 Auto-sync — Runs every 30 minutes via GitHub Actions
- 🎯 Always fresh — Your playlist reflects your most recent likes
- ☁️ Serverless — No hosting costs, runs free on GitHub
- 🔒 Secure — Credentials stored as GitHub Secrets
- ⚡ Fast — Powered by Deno, syncs in seconds
Click the Fork button at the top right of this page.
- Go to Spotify Developer Dashboard
- Click Create app
- Fill in any name and description
- Set Redirect URI to:
http://localhost:3000/callback - Check Web API and save
- Copy your Client ID and Client Secret
Open this URL in your browser (replace YOUR_CLIENT_ID):
https://accounts.spotify.com/authorize?client_id=YOUR_CLIENT_ID&response_type=code&redirect_uri=http://localhost:3000/callback&scope=user-library-read%20playlist-modify-public%20playlist-modify-private
After authorizing, you'll be redirected to a URL like:
http://localhost:3000/callback?code=AQBx...YOUR_CODE_HERE
Copy the code and run this command:
curl -X POST https://accounts.spotify.com/api/token \
-d grant_type=authorization_code \
-d code=YOUR_CODE \
-d redirect_uri=http://localhost:3000/callback \
-d client_id=YOUR_CLIENT_ID \
-d client_secret=YOUR_CLIENT_SECRETCopy the refresh_token from the response.
- Open Spotify and create a new playlist
- Copy the playlist link → the ID is the last part of the URL
https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M └──────────────────────┘ Playlist ID
Go to your fork: Settings → Secrets and variables → Actions
Add these 4 secrets:
| Secret | Value |
|---|---|
SPOTIFY_CLIENT_ID |
Your Client ID |
SPOTIFY_CLIENT_SECRET |
Your Client Secret |
SPOTIFY_REFRESH_TOKEN |
Your refresh token |
PLAYLIST_ID |
Your playlist ID |
Go to the Actions tab and enable workflows.
🎉 Done! Your playlist will sync automatically every 30 minutes.
Tip: Click Run workflow to trigger an immediate sync.
| Option | Default | Description |
|---|---|---|
TRACK_COUNT |
50 |
Number of liked songs to sync (max: 50) |
You can customize TRACK_COUNT when manually triggering the workflow.
# Clone your fork
git clone https://github.com/YOUR_USERNAME/spotwik.git
cd spotwik
# Create .env.local with your credentials
cp .env.example .env.local
# Run tests
deno task test
# Run sync locally
deno task sync:devInvalid refresh token
Your token may have been revoked. Generate a new one by repeating Step 3.
Playlist not found
- Check that the playlist ID is correct
- Make sure the playlist is owned by your account
Sync not running
- Go to Actions tab and check for errors
- Make sure workflows are enabled
MIT © Alexis Delabre