Skip to main content
Home

Built and signed on GitHub Actions

MusicBrainz API client which aims for fully typed results

This package works with Node.js, Deno, Bun, BrowsersIt is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
3 months ago (0.3.1)

MusicBrainz

MusicBrainz API client which aims for fully typed results.

Warning

This library is still in development and does not support all API endpoints so far. While most of them are trivial to implement in code, the type definitions are not.

Please read the automatically generated client documentation to see which methods are supported.

Example

import { MusicBrainzClient } from "@kellnerd/musicbrainz";

const client = new MusicBrainzClient();

// Lookup a group artist by MBID and include its artist relationships.
// Type of the result is affected by the specified include parameters.
const group = await client.lookup(
  "artist",
  "83d91898-7763-47d7-b03b-b92132375c47",
  { inc: ["artist-rels"] },
);

// Find the members of the group from its relationships.
// Property `relations` only exists because a relationship include was specified.
const members = group.relations
  // Filter by type name (for illustration, ideally you should use "type-id").
  .filter((rel) => rel.type === "member of band")
  // Extract the target artist. The `artist` property is guaranteed to exist
  // and not optional because "artist-rels" is the only relationship include.
  .map((rel) => rel.artist);

console.log(members);
Built and signed on
GitHub Actions

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@kellnerd/musicbrainz

Import symbol

import * as musicbrainz from "@kellnerd/musicbrainz";
or

Import directly with a jsr specifier

import * as musicbrainz from "jsr:@kellnerd/musicbrainz";

Add Package

pnpm i jsr:@kellnerd/musicbrainz
or (using pnpm 10.8 or older)
pnpm dlx jsr add @kellnerd/musicbrainz

Import symbol

import * as musicbrainz from "@kellnerd/musicbrainz";

Add Package

yarn add jsr:@kellnerd/musicbrainz
or (using Yarn 4.8 or older)
yarn dlx jsr add @kellnerd/musicbrainz

Import symbol

import * as musicbrainz from "@kellnerd/musicbrainz";

Add Package

npx jsr add @kellnerd/musicbrainz

Import symbol

import * as musicbrainz from "@kellnerd/musicbrainz";

Add Package

bunx jsr add @kellnerd/musicbrainz

Import symbol

import * as musicbrainz from "@kellnerd/musicbrainz";