# TheAudioDB Music Metadata Exporter (`automation-lab/theaudiodb-music-metadata`) Actor

Resolve exact artist names or IDs and export TheAudioDB artist metadata with nested public albums, tracks, release information and artwork links.

- **URL**: https://apify.com/automation-lab/theaudiodb-music-metadata.md
- **Developed by:** [Automation Lab](https://apify.com/automation-lab) (community)
- **Categories:** Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.80 / 1,000 item extracteds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## TheAudioDB Music Metadata Exporter

Export **TheAudioDB music metadata** for recurring artist, album, and track catalog enrichment. Supply exact artist names or TheAudioDB IDs and receive one enriched artist row with nested albums and tracks, public identifiers, genres, release information, and artwork links.

### What does it do?

The Actor resolves artists, discovers album links on their public pages, and enriches selected albums and tracks from public JSON detail endpoints. It does not download audio or artwork files. Each artist is one dataset item; albums and tracks have no separate event charge.

### Who is it for?

Music catalog operators, playlist researchers, and media librarians can join records to an existing catalog by TheAudioDB IDs or MusicBrainz artist IDs, inspect release years, and refresh artwork URLs.

### Why use this exporter?

The anonymous list API can expose only a sample of albums or tracks. This Actor discovers public page links before requesting individual metadata, so collection is not silently limited to that first API result. Source identity is checked at every artist→album→track join. Truncation flags distinguish your selected caps from missing source fields.

### Getting started

1. Enter artist names, such as `Coldplay`, or numeric TheAudioDB artist IDs.
2. Choose album and track caps appropriate for your enrichment job.
3. Run the Actor.
4. Inspect the default dataset and export JSON for nested catalogs.
5. Use a schedule if you need repeat snapshots; compare IDs and fields downstream.

```json
{"artistNames":["Coldplay"],"maxItems":1,"maxAlbumsPerArtist":1,"maxTracksPerAlbum":3}
```

### Inputs

| Input | Default | Behavior |
|---|---|---|
| artistNames | none | Up to 100 names; exact whole-name comparison after trim, whitespace collapse, and lowercase |
| artistIds | none | Up to 100 numeric TheAudioDB IDs as strings; processed before names |
| maxItems | 10 | Global cap on unique enriched artist rows, 1–100 |
| maxAlbumsPerArtist | 5 | Select up to 1–50 albums per artist in source page order |
| includeTracks | true | Fetch selected album tracks; false leaves empty track arrays |
| maxTracksPerAlbum | 25 | Select up to 1–100 tracks per album; collection effect only when tracks are enabled |

Supply at least one name or ID. Duplicate resolved artists emit once. No zero/unlimited mode exists. Name searches are not fuzzy or substring searches. Ambiguous exact names fail; use an ID to disambiguate. Names are processed after IDs, so an earlier ID can fill the global artist cap before a later name is searched.

### Extracted data

| Level | Fields |
|---|---|
| Artist | artistId, name, genre, country, formedYear, biography, artworkUrl, musicBrainzId, sourceUrl |
| Album | albumId, artistId, title, genre, releaseYear, releaseDate, artworkUrl, sourceUrl |
| Track | trackId, albumId, artistId, title, genre, trackNumber, durationMs, artworkUrl, sourceUrl |
| Coverage | availableAlbumCount, albumsTruncated, tracksIncluded; each album has availableTrackCount and tracksTruncated |
| Provenance | scrapedAt UTC timestamp |

Missing source metadata is null. `country` preserves the source's free-text location, which may be a city rather than an ISO country. Release years are not exact release dates. Page order is not guaranteed chronological; trackNumber preserves source numbering even if links are displayed out of order.

### Output example

A locally verified Coldplay export includes album `2433223` (Moon Music, 2024). A compact excerpt:

```json
{
  "artistId": "111239",
  "name": "Coldplay",
  "genre": "Alternative Rock",
  "availableAlbumCount": 10,
  "albumsTruncated": true,
  "tracksIncluded": true,
  "albums": [{
    "albumId": "2433223",
    "title": "Moon Music",
    "releaseYear": 2024,
    "availableTrackCount": 9,
    "tracksTruncated": true
  }]
}
```

This excerpt omits other returned fields and track rows. The default dataset contains full objects. A `SUMMARY` key-value record records saved count and applied caps.

### Coverage and limitations

This is a bounded public-metadata exporter, not a full music database mirror. Counts describe unique links currently exposed on public source pages, not a guarantee that TheAudioDB contains every release or recording. A source page can omit tracks; no missing metadata is synthesized. Public page discovery plus JSON detail enrichment avoids anonymous list sampling but cannot guarantee completeness beyond those public links.

No login, customer API key, proxy, cookies, or paid source subscription is required by the implemented route. There is no automatic browser or proxy fallback. No history, alerts, lyrics, private user data, audio files, or cross-source identity equivalence is promised.

### How much does it cost to export TheAudioDB music metadata?

The Actor uses pay-per-event pricing: a one-time start event and one item event per delivered enriched artist. Albums and tracks are included without separate event charges. Prices vary by Apify Store spend tier, which depends on aggregate qualifying Store spend, not this Actor's private volume.

Start fee: **$0.005 per run**. Per enriched artist: FREE **$0.0053636**, BRONZE **$0.004664**, SILVER **$0.0036379**, GOLD/PLATINUM/DIAMOND **$0.0027984**.

At BRONZE, estimated event charges are $0.009664 for 1 artist, $0.05164 for 10, and $0.4714 for 100. At FREE, 10 artists are $0.058636 including start. Empty valid searches incur the start fee but no item event. Malformed input is rejected before the start event. Confirm applicable live prices and billing limits before running; examples are estimates, not guaranteed invoices.

### Reliability and troubleshooting

Transient network failures, HTTP 429, and 5xx responses retry up to three attempts per request with bounded delay. Permanent HTTP errors, invalid JSON, and mismatched source identities fail rather than masquerade as successful empty catalogs. Earlier delivered artists may remain in a failed run; treat those as partial output.

- Empty result: check spelling and use a numeric TheAudioDB ID. An unmatched exact name is a valid empty outcome.
- Ambiguous name: use the ID of the intended artist.
- Missing albums/tracks: inspect coverage flags, caps, and the public source page.
- Failed run: inspect logs and report the run link through Apify Store issues.

### Integrations

Export JSON to preserve nested albums and tracks. Flatten those arrays downstream for relational tables or spreadsheets, joining artistId and albumId. CSV/Excel exports of artist rows may require downstream flattening. Compare successive snapshots by stable IDs, not array positions. Connect Apify dataset exports or webhooks to an ETL pipeline; keep full exports outside an AI model's context.

### API usage

Keep your Apify token in an environment variable, never in a published URL.

```bash
curl -X POST "https://api.apify.com/v2/acts/automation-lab~theaudiodb-music-metadata/runs" \
  -H "Authorization: Bearer $APIFY_TOKEN" -H 'Content-Type: application/json' \
  -d '{"artistNames":["Coldplay"],"maxItems":1}'
```

JavaScript:

```js
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('automation-lab/theaudiodb-music-metadata').call({ artistNames: ['Coldplay'] });
const rows = await client.dataset(run.defaultDatasetId).listItems({ limit: 10 });
console.log(rows.items);
```

Python:

```python
import os
from apify_client import ApifyClient
client = ApifyClient(os.environ['APIFY_TOKEN'])
run = client.actor('automation-lab/theaudiodb-music-metadata').call(run_input={'artistNames': ['Coldplay']})
rows = client.dataset(run['defaultDatasetId']).list_items(limit=10)
print(rows.items)
```

### MCP setup

Claude Code:

```bash
claude mcp add --transport http apify "https://mcp.apify.com?tools=automation-lab/theaudiodb-music-metadata"
```

Claude Desktop, Cursor, and VS Code: configure an HTTP-capable client or its supported bridge with this equivalent MCP JSON, supplying authorized authentication separately:

```json
{"mcpServers":{"apify":{"url":"https://mcp.apify.com?tools=automation-lab/theaudiodb-music-metadata"}}}
```

Example prompt: “Export Coldplay's music metadata with one album and three tracks, then show the IDs and release year.” Discover actual names/schemas through scoped `tools/list`; the selected Actor also exposes run/storage helper tools, not exactly one tool. Invoke only after authorization.

Start once and retain the run ID and storage IDs. They are not rows. `call-actor` waits at most 45 seconds; if pending, check the SAME run with 2, 4, 8 second backoff capped at 10 seconds and a 120-second total deadline. On a client timeout recover the known run, not a duplicate invocation. Report pending at deadline and failed runs as partial, not complete results.

After success, fetch dataset items in pages of 20 with explicit offset, limit, and needed fields. Example consumer budget: at most 100 source rows and 64 KiB serialized UTF-8 result content admitted to model context, whichever comes first. Enforce that byte cap host-side; omit/summarize oversized data with disclosure. If your client cannot intercept responses, do not claim a hard byte guarantee. Report continuation offset and truncation. These consumer limits do not reduce Actor collection defaults. No universal token-savings claim is made.

### Legality, responsible use and privacy

Independent tool, not affiliated with or endorsed by TheAudioDB. Use public music metadata responsibly and respect source/content rights; artwork URLs do not confer a license to redistribute images. Apify's standard terms apply; no extra end-user agreement is imposed.

The runtime uses no AI and sends no user input or scraped metadata to an AI provider. Source requests contain supplied artist names/IDs. Public artist biographies can contain professional personal information. Do not submit secrets or sensitive personal information as names. Run data and logs remain in your Apify storage under your retention settings; delete runs/storage when no longer needed. The Actor maintains no shared persistent customer cache.

Failed operations send sanitized diagnostic input, exceptions and actor/build/run IDs to our private GlitchTip service for repair; secret fields and URL queries are removed and reports are retained for 30 days. Apify hosts runs/storage; TheAudioDB receives metadata requests; our private diagnostic service receives sanitized failures.

### FAQ

**Can I export every album?** Increase caps within supported ranges. Counts represent discovered public links, not a complete source mirror.

**Are track lengths in seconds?** No, `durationMs` is milliseconds, as supplied by TheAudioDB.

**Can I search album names directly?** No. This Actor starts from artists. Albums and tracks are nested enrichment, not standalone input modes.

**Why are releaseDate and biography null?** Source fields are optional. The Actor does not infer exact dates or text when unavailable.

### Related Actors

[Apple iTunes Catalog Search & Lookup](https://apify.com/automation-lab/apple-itunes-search-lookup-metadata) complements this workflow with Apple's catalog metadata. Match cautiously by names/titles or established external identifiers; TheAudioDB IDs are not iTunes IDs.

### Support

Open an Apify Store issue with the run link, your nonsensitive input, expected entity, and observed behavior. Never paste credentials into issue reports.

# Changelog

This Actor's version history is a separate document: https://apify.com/automation-lab/theaudiodb-music-metadata/changelog.md

# Actor input Schema

## `artistNames` (type: `array`):

Up to 100 artist names. Matches whole artist names after trimming, collapsing whitespace and lowercasing; not substring or fuzzy matching. Ambiguous exact names fail: use IDs instead. Names are processed after IDs. Duplicate resolved IDs emit once.

## `artistIds` (type: `array`):

Up to 100 numeric TheAudioDB artist IDs as strings. Processed before names, with the same album/track caps. Not MusicBrainz IDs. Supply at least one name or ID.

## `maxItems` (type: `integer`):

Global cap on unique enriched artist rows, not albums or tracks. Default 10; range 1–100. Zero/unlimited is not supported. Processing stops when this cap is reached.

## `maxAlbumsPerArtist` (type: `integer`):

Select up to this many unique matching albums per artist in upstream order. Default 5, range 1–50; zero/unlimited unsupported. albumsTruncated discloses omitted available albums.

## `includeTracks` (type: `boolean`):

Fetch public tracks for each selected album. When false, tracks are empty arrays and availableTrackCount is null; maxTracksPerAlbum has no collection effect.

## `maxTracksPerAlbum` (type: `integer`):

Up to this many unique matching tracks per selected album in upstream order when includeTracks is true. Default 25, range 1–100; zero/unlimited unsupported. tracksTruncated discloses omitted tracks.

## Actor input object example

```json
{
  "artistNames": [
    "Coldplay"
  ],
  "maxItems": 10,
  "maxAlbumsPerArtist": 5,
  "includeTracks": true,
  "maxTracksPerAlbum": 25
}
```

# Actor output Schema

## `dataset` (type: `string`):

Default dataset of artist metadata and nested albums/tracks.

## `summary` (type: `string`):

Saved artist count and applied collection caps.

# 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 = {
    "artistNames": [
        "Coldplay"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation-lab/theaudiodb-music-metadata").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 = { "artistNames": ["Coldplay"] }

# Run the Actor and wait for it to finish
run = client.actor("automation-lab/theaudiodb-music-metadata").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 '{
  "artistNames": [
    "Coldplay"
  ]
}' |
apify call automation-lab/theaudiodb-music-metadata --silent --output-dataset

```

## MCP server setup

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

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/AQwnFeMLmjQKxJi5F/builds/wM8NH2QTvbmdLZ9G4/openapi.json
