Query (release) - MusicBrainzID via a DiscogsID/URL?

Hello hai,
I was wondering, since many MusicBrainz Release pages have the link to a/the corresponding release on discogs (and with it the Discogs release ID), like:


pointing to

Since I have a discogs based tag system and most files already have a discogs ID - is it possible to use the discogs ID (or the URL) script-/program-atically to find the correct releaseID for MusicBrainz ? Either via the API or Picard ?

1 Like

Discogs Importer userscript (https://github.com/murdos/musicbrainz-userscripts#discogs_importer) is actually looking for MB releases/release groups/artists by discogs URLs. Give it a try.

1 Like

As @Zas eludes to: yes, this is possible.

You have to lookup an URL, in your case a Discogs URL. In the case of https://www.discogs.com/release/13383835 it would look something like https://musicbrainz.org/ws/2/url?resource=https://www.discogs.com/release/13383835. You will want to read over https://musicbrainz.org/doc/Development/XML_Web_Service/Version_2 for details of how the API/web service works and what parameters you need to give it to provide something more useful. (It can also return data in JSON if you prefer that to XML.)

There are also wrapper libraries for several languages. The Discogs script @Zas linked is open source, so you can review its code for how it does these lookups. I also have a Python script that uses this same technique for Spotify IDs using the musicbrainzngs library; here’s how it looks up artist IDs:

2 Likes

Thanks for the input & suggestions (i.e. breadcrumbs down the rabbit hole…) !

1 Like

How do you install this script?

I copied the code from Github into the Options->Scripting->Tagger Scripts.

I get an error at bottom that won’t let me save.
“22:8: Unexpected character”

Welcome CaptainKen :slight_smile:

The user script is meant to be used in a web browser to enhance a webpage. It is not compatible with Picard.

A bit more info about user scripts @ Wikipedia.

4 Likes