MusicBrainz metadata block
How to request and read the MusicBrainz metadata block on an AudD match: an array of recordings with MBIDs, ISRCs, match scores, and expanded releases.
The musicbrainz block attaches MusicBrainz data for the recognized
recording to the match. Unlike the streaming-provider blocks it is an
array of recordings, not a single object — one recording can map to more
than one MusicBrainz entity. Each element mirrors a MusicBrainz
recording with its releases
expanded, giving you MBIDs, ISRCs, a match score, and the releases the
recording appears on. It is present only when you request it — and only when
MusicBrainz has a match for the recording.
How to request it
In the SDKs, list the provider in the return_metadata option (Python) /
returnMetadata (Node):
from audd import AudD
audd = AudD("your-api-token") # dashboard.audd.io
result = audd.recognize(
"https://audd.tech/example.mp3",
return_metadata=["musicbrainz"],
)
import { AudD } from "@audd/sdk";
const audd = new AudD({ apiToken: "your-api-token" }); // dashboard.audd.io
const result = await audd.recognize("https://audd.tech/example.mp3", {
returnMetadata: ["musicbrainz"],
});
In raw curl, the form field is named return (the SDK option above is the
SDK name for the same thing):
curl https://api.audd.io/ \
-F api_token=your-api-token \
-F url=https://audd.tech/example.mp3 \
-F return=musicbrainz
How to access it
The block is the typed musicbrainz property on the result: a list of
recording models. Iterate it — take the first element, or the one with the
highest score. Each element’s sub-fields are typed attributes (attribute
access, not dict subscripts); the parts MusicBrainz returns with hyphenated
keys — artist-credit, release-group — and the isrcs and releases
arrays round-trip through Pydantic’s model_extra in Python / extras in
Node.
result = audd.recognize(
"https://audd.tech/example.mp3",
return_metadata=["musicbrainz"],
)
entries = result.musicbrainz or [] # None if not requested / no match
if entries:
top = max(entries, key=lambda e: e.score or 0)
mbid = top.id # Recording MBID
page = f"https://musicbrainz.org/recording/{mbid}"
title = top.title
extra = top.model_extra or {}
isrcs = extra.get("isrcs") or [] # the recording's ISRCs
releases = extra.get("releases") or []
const entries = result.musicbrainz ?? []; // undefined if not requested / no match
if (entries.length) {
const top = entries[0];
const mbid = top.id; // Recording MBID
const isrcs = top.isrcs; // via extras
}
The id is the Recording MBID: link to
https://musicbrainz.org/recording/<id>, or query the MusicBrainz API with
it for relationships, works, and more.
Fields
Each element of the array is a recording. The typed fields:
| Field | Type | Description |
|---|---|---|
id | string | null | The MusicBrainz Recording MBID. |
score | int | string | null | MusicBrainz’s own 0–100 match confidence. Sort or pick on this. |
title | string | null | Recording title. |
length | int | null | Recording length in milliseconds. |
A MusicBrainz recording carries more — isrcs[], artist-credit, video,
tags, and the releases[] array (each release with its own id (release
MBID), title, status, track-count, and nested release-group). These
aren’t typed properties; read them through the element’s model_extra
(Python) / extras (Node). The hyphenated keys (artist-credit,
release-group) come straight from the MusicBrainz API. For the full schema
see the MusicBrainz Recording and
Release documentation.
The block, its elements, and every field can be absent or null — request did
not include musicbrainz, no MusicBrainz match for the recording, or the
provider omitted a field. Treat the block as a possibly-empty list and
null-check elements before reading.
On streaming links
MusicBrainz is a metadata database, not a streaming service, so there is no
“open in MusicBrainz” redirect — link to the recording’s MBID page instead.
For a click-through to a streaming service, every match also carries a
song_link (a lis.tn URL such as https://lis.tn/NbkVb) plus the
streaming_url(provider) SDK helper for Spotify, Apple Music, and Deezer.
See the lis.tn song link
concept.
Related
Reading this as an AI agent? The raw Markdown is at reference/musicbrainz.md, and the full index is /resources/llms.txt.
