Deduplicate a Playlist
Over time, playlists can accumulate duplicate tracks - especially collaborative playlists or playlists you’ve been adding to for years. This guide shows you how to clean them up.
Use Cases
Section titled “Use Cases”- Clean up a collaborative playlist with duplicate additions
- Remove duplicates after merging multiple playlists
- Identify and remove re-releases or remasters
Pipeline Configuration
Section titled “Pipeline Configuration”Web App
Section titled “Web App”- Create a new pipeline
- Add a Get Playlist Tracks task for the playlist you want to clean
- Add a Deduplicate Tracks task
- Choose your deduplication strategy
- Add a Save to Playlist task
- Select the same playlist
- Set mode to Replace
name: Clean Up My Playlisttasks: - type: getPlaylistTracks playlistId: "your-playlist-id" - type: deduplicateTracks strategy: byTrackId - type: saveToPlaylist playlistId: "your-playlist-id" mode: replaceDeduplication Strategies
Section titled “Deduplication Strategies”| Strategy | Description | Best For |
|---|---|---|
byTrackId | Exact match by Spotify track ID | Most accurate, but won’t catch re-releases |
byNameAndArtist | Match by track name and artist name | Catches re-releases and remasters |
- Preview first - Run with
--dry-runin the CLI to see what would be removed before making changes - Backup first - Consider creating a backup of your playlist before deduplicating
- Choose the right strategy - Use
byNameAndArtistif you have multiple versions of the same song and want to keep only one