The web service discussed in this document is an interface to the MusicBrainz Database. It is aimed at developers of media players, CD rippers, taggers, and other applications requiring music metadata. The service's architecture follows the REST design principles. Interaction with the web service is done using HTTP and all content is served in a simple but flexible XML format.
The same web service is also available in JSON format.

Relax NG Schema

Lookups

You can perform a lookup of an entity when you have the MBID for that entity:

lookup: /<ENTITY>/<MBID>?inc=<INC>

Note that unless you have provided an MBID in exactly the format listed, you are not performing a lookup request. If your URL includes something like artist=<MBID>, then please see the Browse section. If it includes query=<QUERY>, please see the Web Service Search page.

Subqueries

The inc= is parameter allows you to request more information to be included about
the entity. Any of the entities directly linked to the entity can be included.

In addition, Relationships are available for all entity types via inc parameters.

To include more than one subquery in a single request, separate the arguments to inc= with a + (plus sign), like inc=recordings+labels.

All lookups which include release-groups allow a type= argument to narrow down the release-groups.
All lookups which include releases also allow the type= argument, and a status= argument is allowed.

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

Linked entities are always ordered alphabetically by gid.

inc= arguments which affect subqueries

Some additional inc= parameters are supported to specify how much of the data about
the linked entities should be included:

- discids include discids for all media in the releases
- media include media for all releases, this includes the # of tracks on each medium and its format.
- isrcs include isrcs for all recordings
- artist-credits include artists credits for all releases and recordings
- various-artists include only those releases where the artist appears on one of the tracks,
but not in the artist credit for the release itself (this is only valid on a
/ws/2/artist?inc=releases request).

Misc inc= arguments

- aliases include artist, label, area or work aliases; treat these as a set, as they are not deliberately ordered
- annotation include annotation
- tags, ratings include tags and/or ratings for the entity
- user-tags, user-ratings same as above, but only return the tags and/or ratings submitted by the specified user

Requests with user-tags or user-ratings require authentication. You can authenticate using HTTP Digest, use the same username and password used to access the main https://musicbrainz.org website.

Relationships

By default, these 'inc=' arguments will only load relationship for the requested entity. When you are loading a release, you might want to load relationships for all its recordings and also works linked to the recordings. This is useful to get full release credits. There are additional arguments that can be used only on release requests and allow you to specify for which entities to load relationships:

- recording-level-rels
- work-level-rels

Non-MBID Lookups

Instead of MBIDs, you can also perform lookups using several other unique identifiers. However, because clashes sometimes occur, each of these lookups return a list of entities (there is no limit, all linked entities will be returned, paging is not supported).

discid

lookup: /discid/<discid>?inc=<INC>&toc=<TOC>

A discid lookup returns a list of associated releases, the 'inc=' arguments supported are identical to a lookup request for a release.

If there are no matching releases in MusicBrainz, but a matching CDStub exists, it will be returned. This is the default behaviour. If you do not want to see CD stubs, pass 'cdstubs=no.' CD stubs are contained within a <cdstub> element, and otherwise have the same form as a release. Note that CD stubs do not have artist credits, just artists.

If you provide the "toc" query parameter, and if the provided discid is not known by MusicBrainz, a fuzzy lookup will done to find matching MusicBrainz releases. Note that if CD stubs are found this will not happen. If you do want TOC fuzzy lookup, but not cdstub searching, specify "cdstubs=no". For example:

a list of sector offsets for each track, beginning with track 1 (generally 150 sectors)

isrc

lookup: /isrc/<isrc>?inc=<INC>

isrc lookups return a list of recordings, the 'inc=' arguments supported are identical to a lookup request for a recording.

iswc

lookup: /iswc/<iswc>?inc=<INC>

An iswc lookup returns a list of works, the 'inc=' arguments supported are identical to a lookup request for a work.

Browse

Browse requests are a direct lookup of all the entities directly linked to another entity. (with directly linked I am referring to any relationship inherent in the database, so no ARs). For example, you may want to see all releases on netlabel ubiktune:

/ws/2/release?label=47e718e1-7ee4-460c-b1cc-1192a841c6e5

Note that browse requests are not searches, in order to browse all the releases on the ubiktune label you will need to know the MBID of ubiktune.

Browsed entities are always ordered alphabetically by gid. If you need to sort the entities, you will have to fetch all entities (see "Paging" below) and sort them yourself.

Linked entities

The following list shows which linked entities you can use in a browse request:

As a special case, release also allows track_artist, which is intended to allow you to browse various artist appearances for an artist. It will return any release where the artist appears in the artist_credit for a track, but NOT in the artist_credit for the entire release (as those would already have been returned in a request with artist=<MBID>).

Paging

Browse requests are the only requests which support paging, any browse request supports an 'offset=' argument to get more results. Browse requests also support 'limit=', the default limit is 25, and you can increase that up to 100.

inc=

Just like with normal lookup requests, the server can be instructed to include more data about the entity using an 'inc=' argument. Supported values for inc= are:

In addition, Relationships are available for all entity types via inc parameters, as with lookup requests.

Release Type and Status

Any query which includes release-groups in the results can be filtered to only include release groups of a certain type. Any query which includes releases in the results can be filtered to only include releases of a certain type and/or status. Valid values are:

Submitting data

You can use the web service to submit certain kinds of data. Currently tags, ratings and ISRCs can be entered through the web service.

Authentication

All POST requests require authentication. You should authenticate using HTTP Digest, use the same username and password you use to access the main https://musicbrainz.org website. The realm is "musicbrainz.org".

POST requests should always include a 'client' parameter in the URL (not the body). The value of 'client' should be the ID of the client software submitting data. This has to be the application's name and version number, not that of a client library (client libraries should use HTTP's User-Agent header). The recommended format is "application-version", where version does not contain a - character.

User Data

You can submit tags and ratings through the web service using POST requests. As described above, client software needs to identify itself using the 'client=' parameter. In the following examples I will use 'example.app-0.4.7' as the client identifier, this is obviously a fictitious client.

tags

To submit tags, perform a POST request to the /ws/2/tag url, like this:

/ws/2/tag?client=example.app-0.4.7

The body of your request should be an XML formatted list of entities with <user-tag> elements.

Because you're sending XML in the body of your POST request, make sure to also set the Content-Type to "application/xml; charset=utf-8".

Our tag functionality includes the ability to upvote and downvote tags. This terminology can be confusing. Whenever you tag something, you are in fact "upvoting" it (which will add 1 to the vote count for the tag). Downvoting is the inverse operation, and will subtract 1 from the tag's vote count. Tags that you downvote will be hidden from the UI for you (and if their total vote count drops to 0 or below, they'll be hidden for everyone). The "user-tag" elements can include a "vote" attribute that specifies what action you want to take:

The "withdraw" vote will remove any upvote or downvote that you previously added (as if you had never voted).

If you do not supply any "vote" attributes in your request (as in the example above), then the list of tags you submit will be treated as upvotes and will completely replace all existing upvoted tags you have on that entity. (So, tags that are not included in the request will be withdrawn, if they were previously upvoted. Downvoted tags are left in place.) This is a legacy behavior that we maintain from before we had tag voting. Including any "vote" attribute in the request will cause it to only apply those votes that you specified.

ratings

To submit ratings, perform a POST request to the /ws/2/rating url, like this:

/ws/2/rating?client=example.app-0.4.7

The body of your request should be an XML formatted list of entities with <user-rating> elements.

Other types of entities supported by collections can be submitted, too; just substitute "releases" in the URI with one of: areas, artists, events, labels, places, recordings, release-groups, or works, depending on the type of collection.

You may submit up to ~400 entities in a single request, separated by a semicolon (;), as the PUT example above shows. You are restricted to a maximum URI length of 16kb at the moment (which roughly equates to 400 gids).

To get the description of a collection, perform a lookup request with the collection MBID:

GET /ws/2/collection/4a0a2cd0-3b20-4093-bd99-92788045845e

To get the description and the summarized contents of a collection, perform a lookup request with the collection MBID and the appropriate entity subquery:

GET /ws/2/collection/4a0a2cd0-3b20-4093-bd99-92788045845e/areas
GET /ws/2/collection/f4784850-3844-11e0-9e42-0800200c9a66/releases
...

To get the contents of a collection, perform a browse request on the appropriate entity endpoint, using the collection MBID as a parameter:

GET /ws/2/area?collection=4a0a2cd0-3b20-4093-bd99-92788045845e
GET /ws/2/release?collection=f4784850-3844-11e0-9e42-0800200c9a66
...

To get a list of collections for a given user (including the number of entities in each collection), you can browse the collection endpoint by editor name:

GET /ws/2/collection?editor=rob

This will only return collections that rob has made public. If you wish to see private collections as an authenticated user, do:

GET /ws/2/collection?editor=rob&inc=user-collections

Barcode submission

Barcodes may be associated with releases by issuing an XML POST request to:

/ws/2/release/?client=example.app-0.4.7

The body of the request must be an XML document with a list of <releases>s in a <release-list>, and a single barcode in a <barcode> element for each release. For example:

Upon issuing this request MusicBrainz will create a single edit in the edit queue for applying these changes. These changes will not be automatically applied, though they will be applied if either no one votes against your changes, or your changes expire (this edit is applied on expiration).

ISRC submission

ISRCs may be associated with recordings by issuing an XML POST request to:

/ws/2/recording/?client=example.app-0.4.7

The body of the request must be an XML document with a list of <recording>s in a <recording-list>, and a list of <ISRC>s in a <isrc-list> to be associated with the recordings. For example:

Example code which illustrates this process can be found in our subversion repository: isrcsubmit-python.

Limiting Connections to the MusicBrainz Web Service

All users of the XML web service must ensure that each of their client applications never make more than ONE web service call per second. Making more than one call per second drives up the load on the servers and prevents others from using MusicBrainz. If you impact the server by making more than one call per second, your IP address may be blocked preventing all further access to MusicBrainz. For more details on this, please see our rate limiting page.

Identifying your application to the MusicBrainz Web Service

It is important that your application set a proper User-Agent string in its HTTP request headers. Please read our rate limiting documentation for more details.