Skip to content

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.

  • Clean up a collaborative playlist with duplicate additions
  • Remove duplicates after merging multiple playlists
  • Identify and remove re-releases or remasters
  1. Create a new pipeline
  2. Add a Get Playlist Tracks task for the playlist you want to clean
  3. Add a Deduplicate Tracks task
    • Choose your deduplication strategy
  4. Add a Save to Playlist task
    • Select the same playlist
    • Set mode to Replace
deduplicate.yaml
name: Clean Up My Playlist
tasks:
- type: getPlaylistTracks
playlistId: "your-playlist-id"
- type: deduplicateTracks
strategy: byTrackId
- type: saveToPlaylist
playlistId: "your-playlist-id"
mode: replace
StrategyDescriptionBest For
byTrackIdExact match by Spotify track IDMost accurate, but won’t catch re-releases
byNameAndArtistMatch by track name and artist nameCatches re-releases and remasters
  • Preview first - Run with --dry-run in 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 byNameAndArtist if you have multiple versions of the same song and want to keep only one