# MusicBrainz Music Metadata Fetcher (`brunofin/musicbrainz-music-metadata-fetcher`) Actor

Fetch metadata for music entities (artists, releases, recordings, labels, works) from the official MusicBrainz open database. Query by MBID, search by name, or browse by type. No API key required. Ideal for music apps, licensing, catalog enrichment, and LLM data prep.

- **URL**: https://apify.com/brunofin/musicbrainz-music-metadata-fetcher.md
- **Developed by:** [Bruno Finger](https://apify.com/brunofin) (community)
- **Categories:** AI, Developer tools
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-usage

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## MusicBrainz Music Metadata Fetcher

Fetch metadata for music entities (artists, releases, recordings, labels, works) from the official MusicBrainz open database. No API key required.

### Features

- **5 entity types**: Artists, Releases, Recordings, Labels, Works
- **Two input modes**:
  - Search by free-text query
  - Direct lookup by MusicBrainz IDs (MBIDs)
- **Structured output**: Consistent schema across all entity types
- **Rate-limited**: Respects MusicBrainz's 1 request/second policy
- **Pay-per-event**: Charged per music entity fetched

### Input

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `entityType` | string | Yes | Entity type: `artist`, `release`, `recording`, `label`, `work` |
| `query` | string | No\* | Free-text search query |
| `mbids` | array\[string] | No\* | List of MBIDs to look up directly (max 50) |
| `limit` | integer | No | Max results for search (1-100, default 20) |
| `offset` | integer | No | Pagination offset for search (default 0) |

\*Either `query` or `mbids` must be provided, not both.

### Output

Each result is a row with these fields:

| Field | Description |
|-------|-------------|
| `entityType` | Type of entity (artist, release, recording, label, work) |
| `mbid` | MusicBrainz ID |
| `name` | Primary name/title |
| `sortName` | Sort name (artists/labels) |
| `disambiguation` | Disambiguation comment |
| `type` | Entity type/subtype |
| `gender` | Gender (artists only) |
| `area` | Area/country name |
| `beginDate` | Begin date (YYYY-MM-DD or partial) |
| `endDate` | End date |
| `ended` | Whether the entity has ended |
| `country` | ISO country code |
| `labelCode` | Label code (labels/releases) |
| `status` | Release status |
| `packaging` | Release packaging |
| `language` | Language code (works) |
| `script` | Script code (works) |
| `isrcs` | ISRCs (recordings) |
| `video` | Has video flag |
| `error` | Error message if any |

### Examples

#### Search for artists named "Nirvana"

```json
{
  "entityType": "artist",
  "query": "Nirvana",
  "limit": 10
}
```

#### Look up specific releases by MBID

```json
{
  "entityType": "release",
  "mbids": [
    "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "b2c3d4e5-f6a7-8901-bcde-f12345678901"
  ]
}
```

#### Search for recordings

```json
{
  "entityType": "recording",
  "query": "Bohemian Rhapsody",
  "limit": 5
}
```

### API Reference

- [MusicBrainz API Documentation](https://musicbrainz.org/doc/MusicBrainz_API)
- [MusicBrainz Search](https://musicbrainz.org/doc/MusicBrainz_API/Search)
- [MusicBrainz Examples](https://musicbrainz.org/doc/MusicBrainz_API/Examples)

### Rate Limits

MusicBrainz allows **1 request per second** from a single IP. This actor automatically rate-limits to comply.

### Data License

MusicBrainz data is available under the [Creative Commons CC0 / Public Domain](https://creativecommons.org/publicdomain/zero/1.0/) license.

# Actor input Schema

## `entityType` (type: `string`):

Type of music entity to fetch (artist, release, recording, label, work)

## `query` (type: `string`):

Free-text search query (name, alias, etc.) — mutually exclusive with mbids

## `mbids` (type: `array`):

List of MBIDs to look up directly — mutually exclusive with query. Maximum 50.

## `limit` (type: `integer`):

Maximum number of results to return (1-100, default 20). Only applies when using query search.

## `offset` (type: `integer`):

Number of results to skip for pagination (default 0). Only applies when using query search.

## Actor input object example

```json
{
  "entityType": "artist",
  "limit": 20,
  "offset": 0
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("brunofin/musicbrainz-music-metadata-fetcher").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("brunofin/musicbrainz-music-metadata-fetcher").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call brunofin/musicbrainz-music-metadata-fetcher --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,brunofin/musicbrainz-music-metadata-fetcher"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/FySaRiAhgQeR2TSqP/builds/Lp7OgIp1gDzh1iwa7/openapi.json
