Unique Song Collector for Spotify

Python
JavaScript
HTML
CSS
Released: 2025 June 9 Last updated: 2025 July 31

Have you ever wanted to see what new songs you have listened to in a span of a year? Well, I have, and that is why I started this project! What it does is take in your Spotify extended streaming history data and parse those files to find every unique song you've listened to (as long as they fit the settings). It then removes songs so that all that remains are songs that had been listened to for the first time in the given date range. Afterwards, you may download the results as a .json file, and even add all of these songs to a Spotify playlist automatically! The program houses numerous settings, so that you can fully utilize it to your liking and have it be adaptable to any unique use cases.

This project originally started as a Python-only program, in which the user would interact with it via the terminal line. When it came time to share with the public, I learned the difficulties in publicly sharing code that contains API keys. I wanted to keep the functionality of adding songs to Spotify using Spotify's Web API, so I had to get creative. That's when I found I could make it work by turning it into a webpage. The program that it is now still uses Python as its primary language (thanks to pyscript) and Spotify's web API. Now, it incorporates JavaScript for the Spotify credentials and to connect it with the UI on the page.

The original program is public and functions the same as this page; it just requires the user to enter their own Spotify API client ID and secret. Click the button below on the right to view the repository of the Python-only version of the project. The button below on the left will direct you to the files for this page, since the program below is all contained in my GitHub webpage repository. To be able to use this or the original program, you must have access to your Spotify extended streaming history data. To request the data, please visit your Spotify account privacy page.

Web-based program repository Python-only program repository

Spotify Logo Logged in as user. Welcome, Name!   Sign Out

Settings

Basics

Beginning Date The date that a song must be first listened to for it possible to be added to the collection. Default is one year from today.
Minimum Count Remove songs that have been listened to fewer times than this number. Default is 2.
Minimum Milliseconds Minimum number of milliseconds (1,000ms = 1 second) the song needs to be listened to in one sitting for it to count in this data. Note: track fully finishing will override this setting. Default is 30,000.
Song Preference If a song has multiple IDs (usually from it being on different albums), have it keep the oldest, newest, both copies, or ask which of the IDs to keep every time. Default is ask.

Extra

Minimum Count Override If a song has been listened to this many more times in the collection range than out of it, then it will be included in the collection. If this number is -1, it will not do this. Default is -1.
Earliest Date The earliest date this program will parse through in the given data. Default is 2000-01-01.
Last Date The last date this program will parse through in the given data. Default is tomorrow's date.
Playlist Add Timer Amount of time (in seconds) to wait in between adding each song to the given playlist so that the 'sort by date added' feature will work properly on Spotify. Default is 0.
Song Grace Period Period at which a song has a chance to be included in the playlist, regardless if it reaches Minimum Count (will still be rejected if it was listened to before Beginning Date). The range starts from the given day through today. Default is a week from today.
Universal Minimum Count Determines if songs before beginningDate should also meet the minimum count requirement to be looked at. Default is False.