Spotify Song Recommender - Using the Spotify API in 2026
Spotify's AI-powered playlists are bad
| Landing page for the Song Recommender |
What I really wanted was the option to send a playlist as input, with the instruction of "find more music like this", and then have a nice new playlist of songs to check out.
2025: Spotify's changing API restrictions
In mid-2025, Spotify issued some new rules for use of their API. If you wanted to make an app that used their Web API, you need to be:
- A registered company
- Already launched to the public
- Have at least 250,000 monthly users
- And more!
This completely locks out indie developers from making public apps using Spotify's Web API. As an indie developer, you're only able to manually add up to 25 Spotify users to your app. No matter what you do, you can't get to 250,000 monthly users from a limit of 25 total users.
2026: What if you really want to make an app with the Spotify API?
There are still ways! But you're quite limited. You have read-only permissions for all of the public APIs, so you can read playlists, read user profiles, but you can't make or edit anything. If you create a "system" Spotify account for your app that is one of the special 25 members, you can still have full control over that.
I decided to go this route, and logged the server side of my app into a Spotify account I made for this project. The backend would be logged into my Spotify account, and handle making playlists, and the frontend would never have to be logged in. The one downside to this approach is that playlists would belong to my account, and not to the user generating them.
With this in mind, I could generate playlists on this account that could be publicly accessible. But generating playlists was only half of the battle, I needed to take a playlist as input too. Originally, my goal was to look up a Spotify user and find their playlists that way, but Spotify API requests require Spotify usernames (which are often randomly generated, and are not the display name that shows in the app!). Additionally, most users don't know if their playlists are public or private.
Fortunately, there's still a way to make this work with the public Spotify APIs. You can make users paste in a public playlist link, and read the songs in that playlist. If the playlist is private, you can alert the user right then and there, and they can quickly fix it, rather than it not showing in the list of all of their playlists.
Additionally, once you've gotten a user's playlist, you can read their Spotify username and retrieve the rest of their public playlists too!
| Selecting a playlist as input to generate a new playlist with similar taste. Note that you can also generate a playlist from a text description if you prefer. |
With the Spotify side done, let's recommend some songs with AI
I started writing up a document on how I wanted the song recommendation to work. I would read the songs from the input playlist, and provide the useful info the LLM. This consisted of song name, artist, album, and release year. Based on that, the LLM can draw conclusions on genres, eras, and artists. Later on, I can come back and add support for passing in genres, but I figured the AI could figure that out on its own.
In early 2025, I started work as an intern at an AI startup, Logic Inc. Logic allows me to write a Google-docs like set of instructions for an LLM, and Logic would provide a single API I could call that would guarantee a perfect result matching the schema that got automatically defined.
As such, I could write some instructions on suggesting music based on a playlist, and Logic would provide an output I could easily parse in some Python code to make into Spotify playlists. Once I got this all wired up, it was easy to keep making recommendation changes. I started providing more info to the API, including release dates and albums of songs, and told the AI to write a reason for the song recommendations for the Spotify playlist description. I could make these changes, and the schema wouldn't change unless I made a change that required it, unlike many AI tools.
Give it a shot!
The song recommender is up at song-rec.romangarms.com. It's free to use, and doesn't require any login. Make sure any playlists you want to use as input are marked as public, and if you want them to show in the list, make sure you've selected "add to profile" on the playlists as well.
If you'd like to try generating a playlist from a text description, that is available at the top of the page after you've pasted a playlist URL in.
| Generate a playlist from a text description! You can make references to movies, games, compilations, and all sorts of other things |
Future plans
Now that the project is up and running, I'll be fine-tuning the recommendation system, providing more info from Spotify to the LLM. I'll likely combine the text box input and playlist selection input, so users can include instructions for their playlist generation.
Additionally, I'll have to get some better instructions in the ReadMe so users can set this project up on their own, now that Logic is free to try.
Check out the GitHub repo here: https://github.com/romangarms/Spotify-Song-Recommender
Comments
Post a Comment