MusicBrainz API

Beginner's Pick Music / No Auth Required Beginner HTTPS
Free to Use Varies (check documentation)

Overview

MusicBrainz is a free, open music encyclopedia that provides detailed metadata about artists, releases, recordings, and labels. Its API requires no authentication for read queries, making it one of the easiest music APIs to start with. You can look up albums, track lengths, ISRCs, and much more using simple HTTP requests.

Beginner Tip

Always include a descriptive User-Agent header (e.g., "MyApp/1.0 (contact@example.com)") in your requests — MusicBrainz requires this and will block generic user agents.

Available Data

track name and artist
album metadata
audio preview URLs
popularity score
genre classification
Use case: Integrate music data into web and mobile applications

Example Response

JSON Response
{
  "name": "Bohemian Rhapsody",
  "artist": "Queen",
  "album": "A Night at the Opera",
  "duration_ms": 354000,
  "popularity": 92,
  "preview_url": "https://p.scdn.co/mp3-preview/..."
}

Field Reference

id The unique MusicBrainz Identifier (MBID) for the entity.
name The name of the artist, release, or recording.
score Relevance score (0–100) indicating how well the result matches your search query.
type Entity type, e.g. "Person", "Group", "Album", or "Single".
country ISO 3166-1 country code indicating where the artist or release originated.
life-span Object containing "begin" and "end" dates for the artist's or release's active period.

Implementation Example

Request
const url = "https://musicbrainz.org/doc/Development/XML_Web_Service/Version_2";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

503 Service Unavailable or rate limit Sending more than 1 request per second without a proper User-Agent.
Set a descriptive User-Agent and limit your requests to 1 per second as required by MusicBrainz's policy.
Empty or missing results Query string is too broad or contains special characters that need URL encoding.
URL-encode your query parameters (e.g., spaces as %20) and narrow searches with additional fields like "artist:" or "release:".
Unknown release or recording Using an incorrect or outdated MusicBrainz ID (MBID).
Look up the correct MBID by searching first, then use the UUID in the lookup endpoint.

Metadata Score Breakdown

Estimated from metadata — endpoint not independently tested

This score is estimated from observable metadata — HTTPS support, authentication model, declared CORS, and documentation reachability — because the API requires authentication or exposes no publicly testable endpoint. The five-signal breakdown is only shown for live-tested APIs.

Metadata estimate · endpoint not independently tested

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS UNKNOWN
Category Music
Difficulty Beginner
Verified: 2026-04-04

Related Tags

Alternatives to MusicBrainz

Technical alternatives for different use cases.

Community-maintained open music database

Better For

User listening statistics and social features

Trade-off

Accurate metadata and music identification

Open-source music database with community-maintained data

Better For

Audio streaming and user-facing features

Trade-off

Accurate music metadata and ISRC/ISWC identifiers

Similar APIs

View All →