Getting MBIDs en masse

Is there a way to give MusicBrainz a list of artists names and simply get back the corresponding MBIDs, i.e as a list or table? I mean, without writing a whole new piece of software to do it.

The problem is that artist names are ambiguous. Enter an artist name like “Mozart” into an Artist search, and you get back 289 results for “Mozart”, with the famous Austrian classical music composer artist/b972f5 Wolfgang Amadeus Mozart only coming in 7th. What would you want MusicBrainz to give you in your list or table?

4 Likes

Theoretically yes:
http://musicbrainz.org/ws/2/artist/?query=artist:fred
returns all artists with the name “fred”, including MBID.
(MBID = <artist id> in this search result)

As @Jim_DeLaHunt already told you: There is not only one single “fred” in the MB database. Therefore you have to give as much informations as possible, like
http://musicbrainz.org/ws/2/artist/?query=artist:fred%20AND%20type:group%20AND%20country:US

(Example from https://wiki.musicbrainz.org/Development/XML_Web_Service/Version_2/Search)

But even with all this informations you can’t be sure, that the returned MBID will be 100% matching to your artist. The above search returns still 12 US-fred’s.

2 Likes

Yes, I’m aware that ambiguity could be an issue. That’s actually why i want the MBIDs in the first place.

Let me explain the situation: I have a spreadsheet of over 30,000 singles. I’m trying to turn that into a database, which would be much easier to maintain and navigate, and it would be helpful to use MBIDs, both for reference and because I know they would be a unique identifier. There are about 4000 artists, so anything I can do to speed up the process will be helpful. (And if I ever try to get MBIDs for the recordings, oh boy…) Even just a table of artists and MBIDs would be better than trying to look each one up individually online.

1 Like

You can download an actual MusicBrainz data mbdump, extract it and use the parts you need. You can import it into a SQLite or any other database where you can run some SELECT…FROM…WHERE statements.

Unfortunately, the problem with the ambiguity remains.

3 Likes

Thanks, I’ll see what I can do with that.

Since most of my own files are tagged with Picard, and I’ve got MBIDs for Artist, Album, etc configured as custom tags in MusicBee, I’ve been able to get a start on it by copying that info into a table. But there are many artists in the spreadsheet that I don’t have in my library, and vice versa. So it’s not a complete solution by a long shot.

I’m still getting used to queries, but I seem to have had success with matching artists names against artists in my database. I’m sure it’s missed a few that I’ll have to re-find, and I’ve got some duplicates to sort out, but it’s cut things down to a list of <10,000 artists, which I can work with.

Does anybody know where I can find out what different fields are are represented in the artists file? Most are self-explanatory, but a few seem to use numeric codes, and there’s no column header info. (For instance, one column has exclusively 1s and 2s, another I figured out is area ID codes, there’s a true/false column, and one that only has 0s)

Are you maybe looking for https://github.com/metabrainz/musicbrainz-server/blob/master/admin/sql/CreateTables.sql#L208 ?

1 Like

Yeah, that looks like it should do the trick. Thanks!