Habib Afolabi
Case study02

Listenprint

Your Spotify Liked Songs: who you actually save, when you saved them, and what you'd never guess from a playlist.

Listenprint on a real library: 1,502 saved tracks across 890 artists, with the top 10 artists holding 14%, above artists ranked by tracks saved, led by Khalid.
Listenprint genre breakdown on a real library: a note that only 35% of songs have genre tags, then bars for the top genres, led by afrobeats at 58.5%.
Genres and data coverage
Listenprint library timeline on a real library: busiest month February 2024 with 67 songs saved, above a monthly bar chart from 2020 to 2026.
Listening timeline
  • Vite
  • React 19
  • TypeScript
  • TanStack Router
  • TanStack Query
  • React Compiler

The problem

Spotify Wrapped tells you your top artists, based on what you played over the last year. It doesn’t tell you which artists you save, the ones you came back to album after album, sometimes over multiple years. Listenprint reads your Liked Songs and answers that. It ranks every artist in your library, gives each one a page, shows when you saved what, and breaks the library down by genre.

One constraint shaped the rest. Spotify keeps new apps in Development Mode, which caps them at five accounts the developer adds by hand. Almost nobody reading this can sign in, so the sample library is how most people use the app. The screenshots on this page show my own library, from one of those five accounts. /demo generates 10,000 liked songs across 1,737 invented artists from a fixed seed. Everyone gets the same library, and it has the shapes a real one has: a long tail, ties, and a few artists who dominate. Every feature works on it. Its export carries a SAMPLE DATA mark, so nobody can pass it off as their real history.

No backend

Everything runs in the tab, including sign-in, paging through Liked Songs, the aggregation, the charts and the export. I run no server and keep no database of other people’s listening history.

That has costs. A scanned library lives in one browser’s IndexedDB, so opening the app on a phone means scanning again. If IndexedDB is unavailable, the app falls back to memory and says so. Every user also spends their own Spotify rate limit, so the app handles 429 responses itself instead of relying on a shared cache.

PKCE, written by hand

A client-only app can’t keep a secret, so it signs in with PKCE, which proves the app started the sign-in without a client secret. I wrote the flow myself instead of adding an auth library, because there is one provider and one flow. It’s a pure state machine plus one object that takes every side effect as an argument, including fetch, storage, the clock, randomness and the redirect.

Only a 4xx from Spotify’s token endpoint ends a session. Network errors, 5xx responses and 429s never sign anyone out, so a dropped connection on a train doesn’t cost anyone their library.

The URL holds the state

Ranking mode, sort order, search and chart grain are all search params, and the router validates each one. There’s no store. My test was whether a piece of state should survive someone pasting the link into a message. If it should, it belongs in the URL, and a store would be a second copy that could disagree with it.