Why I'm Building My Music Matching Algorithm Instead of Using Spotify's API

Why I'm Building My Music Matching Algorithm Instead of Using Spotify's API
hero

The Flock camera story that tracks way more than license plates hit 349 points on HN last week. Reading those comments about surveillance creep got me thinking about a different kind of tracking problem I've been wrestling with: how Spotify's algorithm decides what music I should hear next. Six months ago, I started building my own music recommendation engine instead of just accepting whatever their black box serves up.

The Dependency Realization

I originally planned to build something simple — just use Spotify's API like everyone else, maybe add a few custom filters on top. The standard approach: pull my listening history, feed it through their recommendation endpoints, display the results with a cleaner interface.

Then I hit the first wall. Spotify's API gives you recommendations optimized for Spotify's business model, not your music taste. Their algorithm maximizes for engagement metrics I can't even see: skip rates, playlist additions, time spent browsing. I started noticing my "personalized" recommendations felt increasingly generic — safe bets designed to keep me listening, not necessarily to surface music I'd love.

The turning point came when I realized I was building a prettier wrapper around someone else's taste-making system. I wasn't creating a recommendation engine; I was optimizing for their optimization. That felt like algorithmic sharecropping.

What I Found Under the Hood

Building my own data pipeline meant scraping my listening history directly instead of relying on platform exports. The difference was striking. Spotify's data export gives you basic play counts and timestamps. My scraper captured interaction patterns they don't expose: how often I skip certain tracks at specific times of day, which songs I replay immediately, the gap between when I save something and when I actually listen.

My algorithm started surfacing patterns Spotify never showed me. It found connections between obscure tracks in my library based on harmonic progressions rather than genre tags. It noticed I tend to crave heavier music around 3 PM and suggested accordingly. Most surprising: it discovered I have a consistent preference for songs with specific vocal cadences that span completely different genres.

These weren't insights hidden in some advanced machine learning model. They emerged from basic pattern matching on data I could actually inspect and understand.

The Engagement vs. Discovery Problem

The core tension became obvious once I started measuring differently. Spotify optimizes for time-on-platform. Keep users scrolling through recommendations, building playlists, discovering "new" music that fits comfortably within their established preferences.

I designed my system to optimize for "songs I want to hear again" rather than "songs that keep me scrolling." Simple difference, completely different outcomes. My recommendations became fewer but more resonant. I started spending less time searching for music and more time actually listening to it.

The success metrics shifted too. Instead of tracking discovery breadth (how many new artists I found), I measured discovery depth (how many songs from new artists made it into regular rotation). The hit rate improved.

Technical Trade-offs I'm Living With

What I lost: convenience, social features, access to massive catalogs. My system only knows about music I already own or have explicitly fed into it. No collaborative filtering from millions of other users. No seamless integration with streaming platforms.

What I gained: algorithmic transparency, optimization control, genuine surprise. When my system makes a weird recommendation, I can trace exactly why. When it misses something obvious, I can adjust the logic. When it surfaces something perfect, I understand the reasoning well enough to find similar gems.

The infrastructure burden is real. I'm running scrapers, maintaining databases, debugging recommendation logic that sometimes goes sideways. This takes more time than just trusting Spotify's algorithm. But the time feels different — I'm building something that gets better at understanding my taste rather than just consuming someone else's interpretation of it.

The Broader Question of Algorithmic Autonomy

This project made me realize how many other "personalized" systems I'm just renting instead of owning. My news feed, my shopping recommendations, my social media timeline — all optimized for someone else's metrics, using my behavioral data to feed me back engagement-maximizing suggestions.

There's something unsettling about how comfortable I'd become with this arrangement. Letting platforms harvest my behavioral data to sell me back optimized engagement bait felt normal until I tried building an alternative.

The strangest part: how much resistance I felt to building my own recommendation logic. It seemed easier to complain about algorithmic manipulation than to actually take control of it. The technical barrier isn't that high, but the psychological barrier of taking responsibility for my own algorithmic experience was surprisingly steep.

I'm still not sure if building my own music algorithm is sustainable long-term, or if I'm just procrastinating on more important projects. The system works well enough that I rarely open Spotify anymore, but I'm probably missing music I'd love because it's not in my self-imposed data bubble. The question that keeps surfacing: in how many other areas am I confusing algorithmic convenience with actual preference discovery?