Development / XML Web Service / Version 2 / Search

The Web Service provides a way to search for MusicBrainz Entities, the results are returned in Xml format matching the MMD. The results are provided By a Search Server built using Lucene technology.

This sections lists the parameters common to all resource.

type Selects the index to be searched, artist, release, release-group, recording, work, label (track is supported but maps to recording)
query Lucene search query, this is mandatory
limit An integer value defining how many entries should be returned. Only values between 1 and 100 (both inclusive) are allowed. If not given, this defaults to 25.
offset Return search results starting at a given offset. Used for paging through more than one page of results.


The query field supports the full Lucene Search syntax; you can find a detailed guide at Lucene Search Syntax. For example, you can set conditions while searching for a name with the AND operator.

Example: http://musicbrainz.org/ws/2/recording?query=%22we%20will%20rock%20you%22%20AND%20arid:0383dadf-2a4e-4d10-a46a-e9e041da8eb3 will find any recordings of "We Will Rock You" by Queen.


When searching fields that come from a defined set of possible values such as country and gender, find matches where these fields have not been set by searching for unknown.

Example: http://musicbrainz.org/ws/2/release/?query=country:unknown


Most other textual fields can be searched on by looking for value - (need escaping to \-)

Example: http://musicbrainz.org/ws/2/release/?query=format:\-


Numeric count based fields can be searched for by looking for 0

Example: http://musicbrainz.org/ws/2/release-group/?query=releases:0

Contents

Annotation

Example

http://musicbrainz.org/ws/2/annotation/?query=entity:bdb24cb5-404b-4f60-bba4-7b730325ae47

Search Fields

The annotation index contains the following fields you can search:

Field Description
text The content of the annotation
type The entity type (artist, releasegroup, release, recording, work, label)
name The name of the entity
entity The entity's MBID

Xml

<metadata created="2013-02-05T04:41:32.273Z" xmlns="http://musicbrainz.org/ns/mmd-2.0#" xmlns:ext="http://musicbrainz.org/ns/ext#-2.0">
    <annotation-list count="1" offset="0">
        <annotation type="release" ext:score="100">
            <entity>bdb24cb5-404b-4f60-bba4-7b730325ae47</entity>
            <name>Pieds nus sur la braise</name>
            <text>Lyrics and music by Merzhin except:
04, 08, 09, 10 (V. L'hour - Merzhin),
03 (V. L'hour - P. Le Bourdonnec - Merzhin),
05 & 13 (P. Le Bourdonnec - Merzhin),
06 ([http://musicbrainz.org/artist/38cfa519-21bb-4e79-8388-3bf798b8c076.html|JM. Poisson] - Merzhin),
07 ([http://musicbrainz.org/artist/f2d7c07c-a8e7-45c9-a888-0b2e6e3a240d.html|Ignatus] - V. L'hour - Merzhin),
11 ([http://musicbrainz.org/artist/f2d7c07c-a8e7-45c9-a888-0b2e6e3a240d.html|Ignatus] - Merzhin),
12 ([http://musicbrainz.org/artist/38cfa519-21bb-4e79-8388-3bf798b8c076.html|JM. Poisson]).</text>
        </annotation>
    </annotation-list>
</metadata>

Area

Example

http://musicbrainz.org/ws/2/area/?query=%22%C3%8Ele-de-France%22

Search Fields

The area index contains the following fields you can search:

fieldDescription
aid the area ID
alias the aliases/misspellings for this area
area area name
begin area begin date
comment disambugation comment
end area end date
ended area ended
sortname area sort name
iso area iso1, iso2 or iso3 codes
iso1 area iso1 codes
iso2 area iso3 codes
iso3 area iso3 codes
type the aliases/misspellings for this label

Area search terms with no fields specified search the area and sortname fields.

Xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<metadata created="2013-06-12T10:51:14.668Z" xmlns="http://musicbrainz.org/ns/mmd-2.0#" xmlns:ext="http://musicbrainz.org/ns/ext#-2.0">
    <area-list count="1" offset="0">
        <area id="d79e4501-8cba-431b-96e7-bb9976f0ae76" type="Subdivision" ext:score="100">
            <name>Île-de-France</name>
            <sort-name>Île-de-France</sort-name>
            <iso-3166-2-code-list>
                <iso-3166-2-code>FR-J</iso-3166-2-code>
            </iso-3166-2-code-list>
            <life-span>
                <ended>false</ended>
            </life-span>
            <alias-list>
                <alias locale="nl" sort-name="Île-de-France" type="Area name" primary="primary">Île-de-France</alias>
                <alias locale="en" sort-name="Île-de-France" type="Area name" primary="primary">Île-de-France</alias>
                <alias locale="fr" sort-name="Île-de-France" type="Area name" primary="primary">Île-de-France</alias>
                <alias locale="it" sort-name="Île-de-France" type="Area name" primary="primary">Île-de-France</alias>
                <alias locale="fi" sort-name="Île-de-France" type="Area name" primary="primary">Île-de-France</alias>
                <alias locale="et" sort-name="Île-de-France" type="Area name" primary="primary">Île-de-France</alias>
                <alias locale="de" sort-name="Île-de-France" type="Area name" primary="primary">Île-de-France</alias>
                <alias locale="no" sort-name="Île-de-France" type="Area name" primary="primary">Île-de-France</alias>
                <alias locale="es" sort-name="Isla de Francia" type="Area name" primary="primary">Isla de Francia</alias>
                <alias locale="ja" sort-name="イル=ド=フランス地域圏" type="Area name" primary="primary">イル=ド=フランス地域圏</alias>
            </alias-list>
        </area>
    </area-list>
</metadata>

Artist

Example

http://musicbrainz.org/ws/2/artist/?query=artist:fred

Search Fields

The artist index contains the following fields you can search:

Field Description
area artist area
beginarea artist begin area
endarea artist end area
arid MBID of the artist
artist name of the artist
artistaccent name of the artist with any accent characters retained
alias the aliases/misspellings for the artist
begin artist birth date/band founding date
comment artist comment to differentiate similar artists
country the two letter country code for the artist country or 'unknown'
end artist death date/band dissolution date
ended true if know ended even if do not know end date
gender gender of the artist (“male”, “female”, “other”)
ipi IPI code for the artist
sortname artist sortname
tag a tag applied to the artist
type artist type (“person”, “group”, "other" or “unknown”)

Artist search terms with no fields specified search the artist, sortname and alias fields.

Xml

<metadata xmlns="http://musicbrainz.org/ns/mmd-2.0#" xmlns:ext="http://musicbrainz.org/ns/ext#-2.0">
    <artist-list offset="0" count="1">
        <artist type="group" id="8538e728-ca0b-4321-b7e5-cff6565dd4c0" ext:score="100" >
            <name>Depeche Mode</name>
            <sort-name>Depeche Mode</sort-name>
            <life-span>
                <begin>1980</begin>
            </life-span>
            <alias-list>
                <alias>Depech Mode</alias>
            </alias-list>
        </artist>
    </artist-list>
</metadata>

CDStubs

Example

http://musicbrainz.org/ws/2/cdstub/?query=title:Doo

Search Fields

The CD Stub index contains the following fields you can search:

Field Description
artist artist name
title release name
barcode release barcode
comment general comments about the release
tracks number of tracks on the CD stub
discid disc ID of the CD

Xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<metadata created="2013-02-05T08:20:53.231Z" xmlns="http://musicbrainz.org/ns/mmd-2.0#" xmlns:ext="http://musicbrainz.org/ns/ext#-2.0">
    <cdstub-list count="1" offset="0">
        <cdstub id="NKpg6j_S6swmiKYEYsFhYrSwgQA-" ext:score="100">
            <title>Stupid Doo Doo Dumb</title>
            <artist>Mac Dre</artist>
            <barcode>618763105025</barcode>
            <comment>CD Baby id:macdremusic5</comment>
            <track-list count="15"/>
        </cdstub>
    </cdstub-list>
</metadata>

Json

{

    "created": "2013-02-05T08:20:53.231Z",
    "cdstub-list": {
        "count": 1,
        "offset": 0,
        "cdstub": [
            {
                "id": "NKpg6j_S6swmiKYEYsFhYrSwgQA-",
                "score": "100",
                "title": "Stupid Doo Doo Dumb",
                "artist": "Mac Dre",
                "barcode": "618763105025",
                "comment": "CD Baby id:macdremusic5",
                "track-list": {
                    "count": 15
                }
            }
        ]
    }
}

Freedb

Example

http://musicbrainz.org/ws/2/freedb/?query=discid:6e108c07

Search Fields

The FreeDB index contains the following fields you can search:

Field Description
artist artist name
title release name
discid FreeDB disc id
cat FreeDB category
year year
tracks number of tracks in the release

Xml

<metadata xmlns="http://musicbrainz.org/ns/mmd-2.0#" xmlns:ext="http://musicbrainz.org/ns/ext#-2.0">
    <freedb-disc-list count="2" offset="0">
        <freedb-disc id="6e108c07" ext:score="100">
            <title>To the power of three</title>
            <artist>Laura Lippman</artist>
            <category>misc</category>
            <year>2005</year>
            <track-list count="7"/>
        </freedb-disc>
        <freedb-disc id="6e108c07" ext:score="100">
            <title>Doo-Doo-Doo</title>
            <artist>Ole Lukkoye</artist>
            <category>folk</category>
            <year>1997</year>
            <track-list count="7"/>
        </freedb-disc>
    </freedb-disc-list>
</metadata>

Json

{

    "freedb-disc-list": {
        "count": 2,
        "offset": 0,
        "freedb-disc": [
            {
                "id": "6e108c07",
                "score": "100",
                "title": "To the power of three",
                "artist": "Laura Lippman",
                "category": "misc",
                "year": "2005",
                "track-list": {
                    "count": 7
                }
            },
            {
                "id": "6e108c07",
                "score": "100",
                "title": "Doo-Doo-Doo",
                "artist": "Ole Lukkoye",
                "category": "folk",
                "year": "1997",
                "track-list": {
                    "count": 7
                }
            }
        ]
    }

}

Label

Example

http://musicbrainz.org/ws/2/label/?query=Devils

Search Fields

The label index contains the following fields you can search:

fieldDescription
alias the aliases/misspellings for this label
area label area
begin label founding date
code label code (only the figures part, i.e. without "LC")
comment label comment to differentiate similar labels
country The two letter country code of the label country
end label dissolution date
ended true if know ended even if do not know end date
ipi ipi
label label name
labelaccent name of the label with any accent characters retained
laid MBID of the label
sortname label sortname
type label type
tag folksonomy tag

Label search terms with no fields specified search the label, sortname and alias fields.

Xml

<metadata xmlns="http://musicbrainz.org/ns/mmd-2.0#" xmlns:ext="http://musicbrainz.org/ns/ext#-2.0">
    <label-list offset="0" count="1">
        <label type="original production" id="d2c296e3-10a4-4ba9-97b9-5620ff8a3ce0">
        <name>Devil's Records</name>
        <sort-name>Devil's Records</sort-name>
        <alias-list>
            <alias>Devils Records</alias>
            <alias>Devil Records</alias>
        </alias-list>
        </label>
   </label-list>
</metadata>

Place

Example

http://musicbrainz.org/ws/2/place/?query=chipping

Search Fields

The place index contains the following fields you can search:

fieldDescription
pid the place ID
address the address of this place
alias the aliases/misspellings for this area
area area name
begin place begin date
comment disambiguation comment
end place end date
ended place ended
lat place latitude
long place longitude
sortname place sort name
type the aliases/misspellings for this place

Place search terms with no fields specified search the place, alias, address and area fields. XML Web Service/Version 2/Search/PlaceXmlOutput

Recording

Example

http://musicbrainz.org/ws/2/recording/?query=Fred

Search Fields

Recording searches can contain you can search:

fieldDescription
arid artist id
artist artist name is name(s) as it appears on the recording
artistname an artist on the recording, each artist added as a separate field
creditname name credit on the recording, each artist added as a separate field
comment recording disambiguation comment
country recording release country
date recording release date
dur duration of track in milliseconds
format recording release format
isrc ISRC of recording
number free text track number
position the medium that the recording should be found on, first medium is position 1
primarytype primary type of the release group (album, single, ep, other)
puid PUID of recording
qdur quantized duration (duration / 2000)
recording name of recording or a track associated with the recording
recordingaccent name of the recording with any accent characters retained
reid release id
release release name
rgid release group id
rid recording id
secondarytype secondary type of the release group (audiobook, compilation, interview, live, remix soundtrack, spokenword)
status Release status (official, promotion, Bootleg, Pseudo-Release)
tid track id
tnum track number on medium
tracks number of tracks in the medium on release
tracksrelease number of tracks on release as a whole
tag folksonomy tag
type type of the release group, old type mapping for when we did not have separate primary and secondary types or use standalone for standalone recordings
video true to only show video tracks

Recording search terms with no fields search the recording field only

Xml

<metadata xmlns="http://musicbrainz.org/ns/mmd-2.0#" xmlns:ext="http://musicbrainz.org/ns/ext#-2.0">
    <recording-list offset="0" count="1">
        <recording id="0b382a13-32f0-4743-9248-ba5536a6115e" ext:score="100">
            <title>King Fred</title>
            <length>160000</length>
            <artist-credit>
                <name-credit>
                    <artist id="f52f7a92-d495-4d32-89e7-8b1e5b8541c8">
                        <name>Too Much Joy</name>
                        <sort-name>Too Much Joy</sort-name>
                    </artist>
                </name-credit>
             </artist-credit>
             <release-list>
                <release id="8442e42b-c40a-4817-89a0-dbe663c94d2d">
                    <title>Green Eggs and Crack</title>
                    <release-group type="album"/>
                    <medium-list>
                        <medium>
                            <position>1</position>
                            <track-list offset="13" count="19">
                                <track>
                                    <title>King Fred</title>
                                </track>
                            </track-list>
                        </medium>
                    </medium-list>
                </release>
            </release-list>
            <puid-list>
                <puid id="1d9e8ed6-3893-4d3b-aa7d-72e79609e386"/>
            </puid-list>
        </recording>
    </recording-list>
</metadata>

If the recording belongs to a release that is a Various Artist compilation then the release will show the artist credit to allow differenitation between this and a single artist compilation.

<release id="d9127de1-ec22-4dd2-859b-c326e146fbe5">
    <title>Rock Hits</title>
    <status>Official</status>
    <artist-credit>
        <name-credit>
            <artist id="89ad4ac3-39f7-470e-963a-56509c546377">
                <name>Various Artists</name>
            </artist>
        </name-credit>
    </artist-credit>
    <release-group type="Compilation"/>
    <medium-list>
       <track-count>10</track-count>
       <medium>
           <position>1</position>
           <track-list offset="0" count="10">
              <track>
                  <title>Jurk</title>
              </track>
           </track-list>
        </medium>
    </medium-list>
</release> 

Release Group

Example

http://musicbrainz.org/ws/2/release-group/?query=release:Tenance

Search Fields

The release group index contains the following fields you can search:

Field Description
arid MBID of the release group’s artist
artist release group artist as it appears on the cover (Artist Credit)
artistname “real name” of any artist that is included in the release group’s artist credit
comment release group comment to differentiate similar release groups
creditname name of any artist in multi-artist credits, as it appears on the cover.
primarytype primary type of the release group (album, single, ep, other)
rgid MBID of the release group
releasegroup name of the release group
releasegroupaccent name of the releasegroup with any accent characters retained
releases number of releases in this release group
release name of a release that appears in the release group
reid MBID of a release that appears in the release group
secondarytype secondary type of the release group (audiobook, compilation, interview, live, remix soundtrack, spokenword)
status status of a release that appears within the release group
tag a tag that appears on the release group
type type of the release group, old type mapping for when we did not have separate primary and secondary types

Release group search terms with no fields search the releasegroup field only.

Xml

<metadata xmlns="http://musicbrainz.org/ns/mmd-2.0#" xmlns:ext="http://musicbrainz.org/ns/ext#-2.0">
      <release-group-list offset="0" count="1">
          <release-group ext:score="100" type="Single" id="70664047-2545-4e46-b75f-4556f2a7b83e">
              <title>Main Tenance</title>
              <artist-credit>
                  <name-credit> 
                      <artist id="a8fa58d8-f60b-4b83-be7c-aea1af11596b">
                          <name>Fred Giannelli</name>
                          <sort-name>Giannelli, Fred</sort-name>
                          <disambiguation>US electronic artist</disambiguation>
                      </artist>
                  </name-credit>
              </artist-credit>
              <release-list count="1">
                  <release id="9168f4cc-a852-4ba5-bf85-602996625651">
                      <title>Main Tenance</title>
                  </release>
              </release-list>
          </release-group>
    </release-group-list>
</metadata>

Release

Example

http://musicbrainz.org/ws/2/release/?query=release:Schneider

Search Fields

The release index contains these fields you can search:

fieldDescription
arid artist id
artist complete artist name(s) as it appears on the release
artistname an artist on the release, each artist added as a separate field
asin the Amazon ASIN for this release
barcode The barcode of this release
catno The catalog number for this release, can have multiples when major using an imprint
comment Disambiguation comment
country The two letter country code for the release country
creditname name credit on the release, each artist added as a separate field
date The release date (format: YYYY-MM-DD)
discids total number of cd ids over all mediums for the release
discidsmedium number of cd ids for the release on a medium in the release
format release format
laid The label id for this release, a release can have multiples when major using an imprint
label The name of the label for this release, can have multiples when major using an imprint
lang The language for this release. Use the three character ISO 639 codes to search for a specific language. (e.g. lang:eng)
mediums number of mediums in the release
primarytype primary type of the release group (album, single, ep, other)
puid The release contains recordings with these puids
quality The quality of the release (low, normal, high)
reid release id
release release name
releaseaccent name of the release with any accent characters retained
rgid release group id
script The 4 character script code (e.g. latn) used for this release
secondarytype secondary type of the release group (audiobook, compilation, interview, live, remix, soundtrack, spokenword)
status release status (e.g official)
tag a tag that appears on the release
tracks total number of tracks over all mediums on the release
tracksmedium number of tracks on a medium in the release
type type of the release group, old type mapping for when we did not have separate primary and secondary types

Release search terms with no fields search the release field only.

Xml

<metadata xmlns="http://musicbrainz.org/ns/mmd-2.0#" xmlns:ext="http://musicbrainz.org/ns/ext#-2.0">
    <release-list offset="0" count="1">
        <release id="9ab1b03e-6722-4ab8-bc7f-a8722f0d34c1" ext:score="100">
            <title>Fred Schneider & The Shake Society</title>
            <status>official</status>
            <text-representation>
                <language>eng</language>
                <script>latn</script>
            </text-representation>
            <artist-credit>
                <name-credit>
                    <artist id="43bcca8b-9edc-4997-8343-122350e790bf">
                       <name>Fred Schneider</name>
                       <sort-name>Schneider, Fred</sort-name>
                    </artist>
                </name-credit>
            </artist-credit>
            <release-group type="Album"/>
            <date>1991-04-30</date>
            <country>us</country>
            <barcode>075992659222</barcode>
            <asin>075992659222</asin>
            <label-info-list>
                <label-info>
                    <catalog-number>9 26592-2</catalog-number>
                    <label>
                        <name>Reprise Records</name>
                    </label>
                </label-info>
            </label-info-list>
            <medium-list>
                <medium><format>cd</format>
                    <disc-list count="2"/>
                    <track-list count="9"/>
                 </medium>
            </medium-list>
        </release>
    </release-list>
</metadata>

Tag

Example

http://musicbrainz.org/ws/2/tag/?query=shoegaze

Search Fields

The Tag index contains these fields you can search:

fieldDescription
tag tag

Xml

<metadata xmlns="http://musicbrainz.org/ns/mmd-2.0#" xmlns:ext="http://musicbrainz.org/ns/ext#-2.0">
    <tag-list count="5" offset="0">
        <tag ext:score="100">
            <name>shoegaze</name>
        </tag>
        <tag ext:score="62">
            <name>rock shoegaze</name>
        </tag>
        <tag ext:score="62">
            <name>indie shoegaze</name>
        </tag>
        <tag ext:score="50">
            <name>doom metal ethereal shoegaze</name>
        </tag>
        <tag ext:score="31">
            <name>ambient folk classical electronic shoegaze alternative rock indie</name>
        </tag>
    </tag-list>
</metadata>

{

   "created": "2013-02-05T08:20:52.180Z",

Json

 
   "tag-list": {
        "count": 5,
        "offset": 0,
        "tag": [
            {
                "score": "100",
                "name": "shoegaze"
            },
            {
                "score": "62",
                "name": "rock shoegaze"
            },
            {
                "score": "62",
                "name": "indie shoegaze"
            },
            {
                "score": "50",
                "name": "doom metal ethereal shoegaze"
            },
            {
                "score": "31",
                "name": "ambient folk classical electronic shoegaze alternative rock indie"
            }
        ]
    }

Work

Example

http://musicbrainz.org/ws/2/work/?query=Devils

Search Fields

The work index contains these fields you can search:

fieldDescription
alias the aliases/misspellings for this work
arid artist id
artist artist name, an artist in the context of a work is an artist-work relation such as composer or lyricist
comment disambiguation comment
iswc ISWC of work
lang Lyrics language of work
tag folksonomy tag
type work type
wid work id
work name of work
workaccent name of the work with any accent characters retained

Work search terms with no fields specified search the work and alias fields.

Xml

<metadata xmlns="http://musicbrainz.org/ns/mmd-2.0#" xmlns:ext="http://musicbrainz.org/ns/ext#-2.0">
    <work-list offset="0" count="1">
        <work ext:score="100" id="10c1a66a-8166-32ec-a00f-540f111ce7a3">
            <title>Frozen Fred</title>
            <relation-list>
                <relation type="composer">
                    <artist id="4c006444-ccbf-425e-b3e7-03a98bab5997">
                        <name>Michiel Peters</name>             
                        <sort-name>Peters, Michiel</sort-name>
                    </artist>
                </relation>
            </relation-list>
         </work>
    </work-list>
</metadata>