# \[WS\] MusicBrainz XML Webservice

**URL:** https://community.mp3tag.de/t/ws-musicbrainz-xml-webservice/3591
**Category:** Web Sources Scripts
**Created:** [July 24, 2006, 3:01pm UTC](https://community.mp3tag.de/t/ws-musicbrainz-xml-webservice/3591 "2006-07-24T15:01:50Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [July 24, 2006, 3:01pm UTC](https://community.mp3tag.de/t/ws-musicbrainz-xml-webservice/3591/1 "2006-07-24T15:01:50Z")

</div>

**Mp3tag 2.40 or higher required**

[How do I install the script?](https://community.mp3tag.de/t/2748/1) / [Wie installiere ich das Script?](https://community.mp3tag.de/t/2749/1)

**MusicBrainz Web Service**

- **MusicBrainz Web Service#Search by Artist** _Search by:_ **Artist** _Imports:_ Artist, Album, Titles, Year, ASIN, Cover
- **MusicBrainz Web Service#Search by Artist + Title** _Search by:_ **Artist + Title** _Imports:_ Album, Year
- **MusicBrainz Web Service#Search by Artist + Title (Orig Tags)**_Search by:_ **Artist + Title** _Imports:_ Origalbum, Origyear

**MusicBrainz Web Service ID** (+ ID Tags)  
_Imports:_ Artist, Album, Titles, Year, ASIN, Cover + several MusicBrainz ID Tags

- _Search by:_ **Album**
- _Search by:_ **Album + Artist**
- _Search by:_ **Album + Total Tracks**
- _Search by:_ **Artist**

**MusicBrainz Artist Info**  
_Imports:_ Artist, Artistsort, Artist Country, Artist Id, www

- _Search by:_ **Artist**

[MusicBrainz\_v2\_04.zip](https://community.mp3tag.de/uploads/default/original/2X/4/48b1e240050920b02dfeb07e52b4e79d685281d2.zip) (5.27 KB)

[MusicBrainz\_v2\_direct\_id\_.zip](https://community.mp3tag.de/uploads/default/original/2X/9/924e4baebb5ac3fdbf49b247063d73c058af8b69.zip) (2.18 KB)

---

<div class="post-metadata">

### Author: ![hanshans](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/h/47e85d/32.png) [@hanshans](https://community.mp3tag.de/u/hanshans)
#### Post date: [August 18, 2006, 12:57pm UTC](https://community.mp3tag.de/t/ws-musicbrainz-xml-webservice/3591/2 "2006-08-18T12:57:55Z")

</div>

hi dano

your MusicBrainzXML-script is working fine. I only had some issues if it finds albums which doesn't contian the "type" of the release, so i modified it a little bit. 🙂

```
38 # Type
39 if "\" type=\""
40 findinline "type=\""
41 sayuntil "\""
42 else
43 say "unknown"
44 endif
45 say "|"

```

Best regards  
Tommy

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [August 18, 2006, 1:29pm UTC](https://community.mp3tag.de/t/ws-musicbrainz-xml-webservice/3591/3 "2006-08-18T13:29:58Z")

</div>

I've fixed that some time ago but forgot to update here..

---

<div class="post-metadata">

### Author: ![hanshans](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/h/47e85d/32.png) [@hanshans](https://community.mp3tag.de/u/hanshans)
#### Post date: [August 18, 2006, 2:47pm UTC](https://community.mp3tag.de/t/ws-musicbrainz-xml-webservice/3591/4 "2006-08-18T14:47:32Z")

</div>

hi again dano

thanx for your update 😉

i am trying to write a web source for MusicBrainz XML lookup based on your album lookup, but i don't get it to work.  
i get an error that there is no connection to the url [musicbrainz.org](http://musicbrainz.org).  
don't know how i have to skip the search part and only run the album part of the script

i hope you can help me

regards  
tommy

BTW: i modified your MB-non-XML web source to lookup with the id which works fine.

[MusicBrainz\_XML\_id.zip](https://community.mp3tag.de/uploads/default/original/2X/1/18fb4759d0747894d786631e39cfcdd0ba9fc052.zip) (947 Bytes)

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [August 18, 2006, 4:23pm UTC](https://community.mp3tag.de/t/ws-musicbrainz-xml-webservice/3591/5 "2006-08-18T16:23:06Z")

</div>

You must have the complete url in [IndexUrl]

```
 [IndexUrl]=http://musicbrainz.org/ws/1/release/%s?type=xml&inc=tracks+artist+release-events
[AlbumUrl]=
[WordSeperator]=
[IndexFormat]=%_url%|%Album%|%Artist%|%Year%
[SearchBy]=%comment%
[Encoding]=utf-8

[ParserScriptIndex]=...
# ###################################################################
# I N D E X
# ###################################################################
#debug "on" "c:\\\\debug_MusicBrainz-XML_A.html" "5"

sayoutput "CurrentUrl"
say "|"
say "|"
say "|"
saynewline
```

---

<div class="post-metadata">

### Author: ![hanshans](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/h/47e85d/32.png) [@hanshans](https://community.mp3tag.de/u/hanshans)
#### Post date: [August 20, 2006, 11:22am UTC](https://community.mp3tag.de/t/ws-musicbrainz-xml-webservice/3591/6 "2006-08-20T11:22:34Z")

</div>

Thanks dano

it works fine 😉  
But there yet another problem to lookup the following disc with the xml script:

- Paul McCartney - Wingspan: Hits  
[http://musicbrainz.org/release/8cec0b4d-ae...7ac076934d.html](http://musicbrainz.org/release/8cec0b4d-ae97-4afa-90a9-1e7ac076934d.html)

only 15 tracks are read and there is an error for the artist column.

regards  
Tommy

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [August 20, 2006, 12:14pm UTC](https://community.mp3tag.de/t/ws-musicbrainz-xml-webservice/3591/7 "2006-08-20T12:14:06Z")

</div>

The xml file does not have an artist for every track.  
It leaves out the artist when the track artist is the same as the main artist (here it is Paul McCartney)  
I can only make it skip the empty artists (update in first post)

I also made a new topic...

---

<div class="post-metadata">

### Author: ![willmcelwain](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/w/3e96dc/32.png) [@willmcelwain](https://community.mp3tag.de/u/willmcelwain)
#### Post date: [October 4, 2006, 12:12am UTC](https://community.mp3tag.de/t/ws-musicbrainz-xml-webservice/3591/8 "2006-10-04T00:12:58Z")

</div>

Thanks dano for this alternate websource. I knew that would be the better way to access musicbrainz, but never got around to writing a parser. For those of you who still use the old musicbrainz websource (that grabs the album art), here's an updated version that fixes a small bug where it wouldn't find tracks that were flagged for revision. Let me know if there are any more bugs.

-will

Added.

---

<div class="post-metadata">

### Author: ![mll](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/6a8cbe/32.png) [@mll](https://community.mp3tag.de/u/mll)
#### Post date: [January 9, 2007, 12:50pm UTC](https://community.mp3tag.de/t/ws-musicbrainz-xml-webservice/3591/9 "2007-01-09T12:50:08Z")

</div>

Very cool script. Thanks dano. 🙂

---

<div class="post-metadata">

### Author: ![PhenX](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/e9c0ed/32.png) [@PhenX](https://community.mp3tag.de/u/PhenX)
#### Post date: [April 6, 2007, 8:53pm UTC](https://community.mp3tag.de/t/ws-musicbrainz-xml-webservice/3591/10 "2007-04-06T20:53:29Z")

</div>

Is it just me or is this script not working anymore?

For example, the Album "Neon Bible" (Arcade Fire) can't be found even though [musicbrainz.org](http://musicbrainz.org) lists it ([http://musicbrainz.org/release/b326d239-245a-49b5-b5e1-2adb94df7740.html](http://musicbrainz.org/release/b326d239-245a-49b5-b5e1-2adb94df7740.html)). Same thing with many other albums. Can't find a working one just now..

Regards  
PhenX

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [April 6, 2007, 9:21pm UTC](https://community.mp3tag.de/t/ws-musicbrainz-xml-webservice/3591/11 "2007-04-06T21:21:28Z")

</div>

One char ![:rolleyes:](https://community.mp3tag.de/uploads/default/original/1X/3a79e8b0b7d169b30216785521d7c6f4f895c421.gif ":rolleyes:") .. get update.

---

<div class="post-metadata">

### Author: ![DaReal](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/9fc29f/32.png) [@DaReal](https://community.mp3tag.de/u/DaReal)
#### Post date: [April 8, 2007, 1:35pm UTC](https://community.mp3tag.de/t/ws-musicbrainz-xml-webservice/3591/12 "2007-04-08T13:35:13Z")

</div>

Thank you very much 😃

---

<div class="post-metadata">

### Author: ![Lipton](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c67d28/32.png) [@Lipton](https://community.mp3tag.de/u/Lipton)
#### Post date: [May 12, 2007, 8:03am UTC](https://community.mp3tag.de/t/ws-musicbrainz-xml-webservice/3591/13 "2007-05-12T08:03:40Z")

</div>

Any idea why the character encoding sometimes doesn't work as it should when fetching data with this script? It seems to be totally random if the encoding works or if the special characters are messed up. So far I've been able to get correct data by trying a few times, but I wonder if the problem is in the script or at MB's end.

But thanks for the excellent script, made me a devoted MusicBrainz user.

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [May 13, 2007, 1:00pm UTC](https://community.mp3tag.de/t/ws-musicbrainz-xml-webservice/3591/14 "2007-05-13T13:00:05Z")

</div>

This problem has occured before but nobody could find the reason.  
The script cannot influence this, it could be Musicbraniz server or Mp3tag. It happens not very often, it's hard to find the problem.  
Maybe you can give a few search terms that caused the problem.

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [February 12, 2008, 3:35pm UTC](https://community.mp3tag.de/t/ws-musicbrainz-xml-webservice/3591/15 "2008-02-12T15:35:10Z")

</div>

Added length display and ASIN Tag and a script that also adds MusicBrainz ID Tags!

---

<div class="post-metadata">

### Author: ![willmcelwain](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/w/3e96dc/32.png) [@willmcelwain](https://community.mp3tag.de/u/willmcelwain)
#### Post date: [February 23, 2008, 9:00pm UTC](https://community.mp3tag.de/t/ws-musicbrainz-xml-webservice/3591/16 "2008-02-23T21:00:56Z")

</div>

For those of you who want to search by more than album title (for those releases that have very common names, like "Greatest Hits"), here are two more MusicBrainz Web Service web sources. In one, you can search by artist (lists all albums by that artist), and the other, you can search by the unique MB Disc ID that's usually at the bottom of that album's page. You need to find the album on MusicBrainz's site first, then copy that Disc ID string (which looks something like "0iGW9Brqglc3pz77ugFj5a6YW6I-"), and paste it into the Mp3tag web sources search dialog.

If you want to modify this script to search for other parameters, go to [http://musicbrainz.org/doc/XMLWebService](http://musicbrainz.org/doc/XMLWebService) and scroll down to the "release resources" section. Copy which parameter you want to use, then open up the .src file you want to modify, and the only part you need to change is the "[IndexUrl]" line, at the end, immediately before the "=%s" part. Change that to whatever you want to search for. For example, when searching by album name, the line used to be:  
[IndexUrl]=http://musicbrainz.org/ws/1/release/?type=xml&limit=20&title=%s

To search by Disc ID, I changed it (including increasing the # of matches returned to 100) to:  
[IndexUrl]=http://musicbrainz.org/ws/1/release/?type=xml&limit=100&discid=%s

I didn't include the extra IDs that dano extracts with the "+ID Tags" script. This just grabs the same basic info as the Web Service Search by Album script.

Thanks again to dano and Florian for such an excellent program. v2.40 is a fantastic improvement, especially for the web sources UI. Great work!

-Will

[MusicBrainz\_Search\_by\_Artist\_or\_Disc\_ID.zip](https://community.mp3tag.de/uploads/default/original/2X/7/78cbe29fb5dcbd2a85b88fa79b8dcaa185b06fbc.zip) (2.67 KB)

---

<div class="post-metadata">

### Author: ![Grumb13](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/bb73d2/32.png) [@Grumb13](https://community.mp3tag.de/u/Grumb13)
#### Post date: [February 25, 2008, 2:40am UTC](https://community.mp3tag.de/t/ws-musicbrainz-xml-webservice/3591/17 "2008-02-25T02:40:50Z")

</div>

umm odd question, but is there any way to get the MB websource to show times in minutes and seconds? It looks like it is doing it in seconds, but it is hard to cross reference the track to the db when they are in different units of measure.

I really don't know how to do this myself, that's why I am asking.

Regards,  
G

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [February 25, 2008, 9:42am UTC](https://community.mp3tag.de/t/ws-musicbrainz-xml-webservice/3591/18 "2008-02-25T09:42:02Z")

</div>

You must have the latest Mp3tag version then it shows minutes and seconds.

---

<div class="post-metadata">

### Author: ![Grumb13](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/bb73d2/32.png) [@Grumb13](https://community.mp3tag.de/u/Grumb13)
#### Post date: [February 27, 2008, 11:50am UTC](https://community.mp3tag.de/t/ws-musicbrainz-xml-webservice/3591/19 "2008-02-27T11:50:31Z")

</div>

Thanks Dano,

I am running 2.39

I'll update.

You rock brother,  
G

---

<div class="post-metadata">

### Author: ![locutus](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/90ced4/32.png) [@locutus](https://community.mp3tag.de/u/locutus)
#### Post date: [March 6, 2008, 8:41pm UTC](https://community.mp3tag.de/t/ws-musicbrainz-xml-webservice/3591/20 "2008-03-06T20:41:36Z")

</div>

I´m not a programmer, so i have some problems to change the scripts. What i want to do is have a search by artist and title, which shows only official albums with ( or sorted by ) year.

In many cases i have a tag with Greatest hits or something else and want to change it to the origin album.

Can someone help me please?

Thanks in advance!

[Next page](https://community.mp3tag.de/t/ws-musicbrainz-xml-webservice/3591.md?page=2)
