Another Musicbrainz Node Client
NodeBrainz is a thin wrapper that gives you full access to the MusicBrainz API (Version 2). This includes search, lookup and browse. It has zero dependences, consumes only JSON (no blocking XML parsing), and includes a powerful Lucene search feature.
Example Usage
MusicBrainz asks that you identifying your application so be sure to set the userAgent
. You may consider following the conventions of RFC 1945
var NB = ; // Initialize NodeBrainzvar nb = userAgent:'my-awesome-app/0.0.1 ( http://my-awesome-app.com )';
Setting a custom host
, basePath
, port
and defaultLimit
(if not set, the defaultLimit
is 25 and port
is 80);
var nb = host:'localhost' port:8080 basePath:'/path/to/data/' defaultLimit:50;
Also supported are automatic retries for Musicbrainz rate-limiting.
var nb = retryOn: true retryDelay: 3000 retryCount: 3;
MusicBrainz Entities
There are eight entities: artist
, label
, recording
, release
, release-group
, work
, area
, url
Lookup
Lookups can be preformed on any of the eight entities.
Lookup an artist
and include their releases
, release-groups
and aliases
nb;
Lookup a release-group
with no filtering or subqueries
nb;
There are different subqueries you can include depending on the entities.
- Arists -
recordings
,releases
,release-groups
,works
- Label -
releases
- Recording -
artists
,releases
- Release -
artists
,labels
,recordings
,release-groups
- Release-group -
artists
,releases
Check out the some of the additional subqueries. Note that the number of linked entities returned is always limited to 25, if you need the remaining results, you will have to perform a browse
or search
.
Browse
Browse requests are a direct lookup of all the entities directly linked to another entity. For example, if you wanted to look up all the release-groups
for a particularly talented artist:
nb;
Browsed entities are always ordered alphabetically by gid. If you need to sort the entities, you will have to fetch all entities and sort them yourself. For pagination, set a limit
and offset
.
nb;
Note that browse
requests are not searches
, in order to browse all the releases-groups
for an artist
, you need to provide the MBID
for the artist
.
Search
Provides a way to search for entities. Behind the scenes, results are provided by a search server using Lucene technology.
nb;
Search Fields
There are different search fields depending on the entity.
Search for all releases
for the artists
named pink floyd. Limited to 20 and offset by 5
nb;
Search for all the studio albums for a specific artist
(identified by their artist ID)
nb;
Lucene Search
Create powerful queries using luceneSearch
. View the syntax guide
nb;