MusicBrainz API
musicbrainz.org · Media
Open music encyclopedia — metadata for 2M+ artists, 3M+ releases, recordings, labels, and relationships. Free, no API key required. Set User-Agent header.
Authentication
No authentication requiredFree to use with no key needed.
Sample Requests
GET
Search artists
Search for artists by name.
https://musicbrainz.org/ws/2/artist?fmt=json&limit=5&query=The Beatles
Hover any highlighted part to learn what it does
Headers — extra info sent with the request
| User-Agent | MyApp/1.0 ([email protected]) |
curl -X GET "https://musicbrainz.org/ws/2/artist?fmt=json&limit=5&query=The%20Beatles" \ -H "User-Agent: MyApp/1.0 ([email protected])"
import requests
params = {
"fmt": "json",
"limit": "5",
"query": "The Beatles"
}
headers = {
"User-Agent": "MyApp/1.0 ([email protected])"
}
response = requests.get(
"https://musicbrainz.org/ws/2/artist",
params=params,
headers=headers,
)
print(response.json())const url = new URL('https://musicbrainz.org/ws/2/artist');
url.searchParams.set('fmt', 'json');
url.searchParams.set('limit', '5');
url.searchParams.set('query', 'The Beatles');
const response = await fetch(url, {
headers: {
'User-Agent': 'MyApp/1.0 ([email protected])'
},
});
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://musicbrainz.org/ws/2/artist")
q := baseURL.Query()
q.Set("fmt", "json")
q.Set("limit", "5")
q.Set("query", "The Beatles")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
req.Header.Set("User-Agent", "MyApp/1.0 ([email protected])")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://musicbrainz.org/ws/2/artist")
uri.query = URI.encode_www_form({
"fmt" => "json",
"limit" => "5",
"query" => "The Beatles"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
req["User-Agent"] = "MyApp/1.0 ([email protected])"
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://musicbrainz.org/ws/2/artist?" . http_build_query([
"fmt" => "json",
"limit" => "5",
"query" => "The Beatles"
]);
$opts = ["http" => [
"method" => "GET",
"header" => implode("\r\n", [
"User-Agent: MyApp/1.0 ([email protected])"
]),
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- No API key needed
- Always set User-Agent: YourApp/1.0 ([email protected])
- Try GET https://musicbrainz.org/ws/2/artist?query=david+bowie&fmt=json&limit=5
- Rate limit: 1 req/sec — add &offset=0 for pagination
What can you build with MusicBrainz API?
MusicBrainz API is a Media API. Developers commonly use media APIs for:
- storing and delivering images, video, and audio
- building digital asset management and media libraries
- transcoding and optimising media for the web
- adding video streaming and playback to your app
- automating content tagging and metadata extraction
No authentication required. This API is open — no signup or key needed. Ideal for quick prototypes and public-facing features. MusicBrainz API is free to use, making it a low-risk choice to experiment with.
New to APIs? Read our beginner's guide