ListenBrainz & MusicBrainz: The Wikipedia of Music Metadata
How I integrated ListenBrainz into my website – and why the entire MetaBrainz ecosystem of open, collaborative databases and free software is simply brilliant.
My homepage has been running a small widget for a while now: a pulsing dot shows what I’m currently listening to — or, if I’m offline, what I last played. The Consumption page shows an album grid pulled from songs I’ve liked on ListenBrainz.
The data source: ListenBrainz — my replacement for Last.fm, which I used for years. And that’s where a story begins that goes far beyond a simple scrobbling widget.
What is MusicBrainz?
MusicBrainz is an open, collaborative music database — run by the non-profit MetaBrainz Foundation. The concept is deceptively simple and enormously ambitious at the same time: every artist, every album, every recording, every release gets a unique ID — a so-called MBID (MusicBrainz Identifier) that is globally unique and permanently valid.
The Wikipedia analogy fits well: a worldwide community maintains the data voluntarily, following clear rules and with an open API. The result today is one of the most complete and structured music databases in the world — with millions of artists, albums, tracks, lyrics, relationships between bands, remixes, release dates, and more.
What Wikipedia is for encyclopedic knowledge, MusicBrainz is for music metadata: an open, free, shared commons.
The MetaBrainz Ecosystem
MetaBrainz is more than just MusicBrainz. Over the years it has grown into an entire universe of related projects:
ListenBrainz
ListenBrainz is the free, open-source successor to classic Last.fm scrobbling. Play music → scrobbler captures the track → ListenBrainz stores it in your profile, permanently and exportably.
I used Last.fm for many years to track my listening habits. Switching to ListenBrainz was straightforward: your full listen history can be imported completely, and in hindsight the move feels long overdue.
What sets ListenBrainz apart from Last.fm: your data belongs to you. No lock-in, no subscription model for statistics, no opaque data usage. The entire API is publicly and freely accessible — including data from other profiles, as long as they’re public.
On top of that there are nice extras: recommendations, year-in-review summaries, playlist export, and a growing community of developers building clients and integrations.
Cover Art Archive
The Cover Art Archive is a joint project between MusicBrainz and the Internet Archive. It stores album artwork freely and openly — linked via the MBIDs of releases. This means: anyone who knows an MBID can retrieve the corresponding cover art at various resolutions with a single URL.
That’s exactly what I do in my Consumption page implementation: for each liked album I fetch the release year via the MusicBrainz API — and the cover image via the Cover Art Archive.
AcoustID & AcousticBrainz
AcoustID solves a classic problem: how do you identify a music file when you only have the audio but no tags? AcoustID generates an acoustic fingerprint of the audio signal and matches it against a database — again linked to MusicBrainz IDs.
AcousticBrainz was an attempt to capture acoustic properties (tempo, key, mood) for millions of tracks. The project was discontinued in 2022, but the collected data remains publicly available.
BookBrainz
Naturally, there is also BookBrainz — the same concept applied to books: authors, publishers, editions, translations, all with permanent IDs and an open API.
The Software
The ecosystem also includes a range of practical tools that use MusicBrainz data:
MusicBrainz Picard is the official tag editor for music files. It calculates acoustic fingerprints of local files, finds the matching releases in the database, and writes back clean, standardised tags — including MBIDs, cover art, and everything else. For anyone with a large MP3 collection, this is invaluable.
Beets is a command-line tool for managing music libraries. It uses MusicBrainz under the hood to automatically identify and sort imported files. With plugins it can be extended into a full music management system.
ListenBrainz Scrobbler — for scrobbling there are clients for practically everything: plugins for Spotify, VLC, MPD, Plex, Kodi, Jellyfin, and many more. Spotify users can link directly; those running their own setup pick the appropriate plugin.
My Integration
”Now Playing” on the Homepage
The widget on the start page polls the ListenBrainz endpoint /user/altner/playing-now every 60 seconds (cached). If a track is listed there, a pulsing dot appears — the classic “currently playing” signal.
There is one edge case: ListenBrainz doesn’t send an explicit “stop” signal when a track ends. If a track has been in “playing-now” status for more than 15 minutes, I treat it as a missing stop event and fall back to the last entry from the regular listen history.
const PLAYING_NOW_MAX_MS = 15 * 60 * 1000;
if (
cache.playingNow.data &&
playingSince &&
Date.now() - playingSince > PLAYING_NOW_MAX_MS
) {
return null; // No longer "now playing" — stale signal
}
Album Grid on the Consumption Page
The more interesting part: I query the /feedback API and filter by score=1 — those are all the tracks I’ve liked with a heart. From these tracks I extract the associated releases via the mbid_mapping field in the response.
Then two things happen in parallel:
- Via the MusicBrainz API I fetch the release year for each release MBID.
- Via the Cover Art Archive I load the album artwork.
Both sources are cached server-side — album covers as files on the server (1-hour TTL), metadata in a JSON file. This avoids unnecessary API requests on every page load and keeps the page fast.
The result is a horizontal scroll grid showing which albums are accompanying me right now — linked directly to the respective MusicBrainz release page.
Why All of This Is So Good
What genuinely excites me about MusicBrainz and ListenBrainz isn’t any single feature — it’s the philosophy behind it.
Open data instead of silos. Music metadata is a collective cultural asset. That a non-profit organisation keeps it consistently free, publishes it under open licences, and makes it accessible via a stable API is anything but obvious. Spotify, Apple Music, and their peers sit on enormous metadata stores and give nothing back.
Stable IDs. An MBID for a track is permanent. No streaming service can delete or rename it. Anyone who knows an MBID today can call up the same URL in ten years and retrieve the data. That makes it genuinely archival.
Community quality. Millions of entries, maintained by real people who love music and care about accurate data. That beats algorithmically generated metadata in many areas.
No lock-in. All listening data can be exported from ListenBrainz — as JSON, as JSPF playlists, whatever you need. If you want to leave, you can leave. In a world of platforms that treat data as a retention mechanism, that feels almost radical.
If you listen to music and have only been scrobbling to Last.fm: ListenBrainz is worth a look. The privacy promise is genuine, the API is great, and the community is growing.
And if you have a messy music collection on your hard drive: run Picard through it once, and you’ll have tags that actually match.