1

I am using MusicBrainz to get a track's meta data. I want to get the track's album's mbid. I am doing the following lookup using ISRC code.

https://musicbrainz.org/ws/2/isrc/USRC11600201?fmt=json

But in response I don't get any metadata related to the album of the track. I get the following response:

{ "isrc": "USRC11600201", "recordings": [ { "disambiguation": "single remix", "title": "Cheap Thrills", "id": "92e27a47-3546-4bc2-a9f7-b19e43d7a531", "length": 223000, "video": false }, { "length": 218540, "video": false, "title": "Cheap Thrills", "disambiguation": "", "id": "5845e975-33b4-4b0d-8e74-8f57d128b3d1" } ] }

I have tried various combinations of the "inc" sub query parameter as well but nothing works. Please help me out. I am really stuck at this.

nick.tdr
  • 4,627
  • 4
  • 28
  • 41

2 Answers2

1

Using inc=releases in the URL parameters should be enough to get you the information that you want. However, it seems like there's a bug with MusicBrainz's JSON web service (which is still officially in beta), as you can see in the difference between the XML and JSON end points' output: https://musicbrainz.org/ws/2/isrc/USRC11600201?inc=releases&fmt=json (JSON) vs. https://musicbrainz.org/ws/2/isrc/USRC11600201?inc=releases (XML).

One obvious solution/work-around here would be to switch to using the more mature XML endpoint. If that is not an option, you can use the Recording MBIDs given in the JSON output to look up releases associated with those Recordings, e.g., https://musicbrainz.org/ws/2/recording/5845e975-33b4-4b0d-8e74-8f57d128b3d1?inc=releases&fmt=json (note that inc=releases is also needed here to get the information about the releases, and it actually works when looking up recordings).

Freso
  • 149
  • 1
  • 7
  • Thank you for replying @Freso. I posted the same question on the musicbrainz community as well and they too told me that the json response is api is down. They will fix it soon. Also the request (https://musicbrainz.org/ws/2/recording/5845e975-33b4-4b0d-8e74-8f57d128b3d1?inc=releases&fmt=json) doesn't return the same response as in xml. So I think (https://musicbrainz.org/ws/2/isrc/USRC11600201?inc=releases) still returns the best result for me as I am interested in the album art link. – nick.tdr May 06 '18 at 07:26
  • So I will probably convert xml to json using some library for android. – nick.tdr May 06 '18 at 07:37
0

So to get the details of the album of a track when I have the ISRC of the track, we need to do the following get request:

https://musicbrainz.org/ws/2/isrc/GBUM71604605?inc=releases

It will give a response in xml. The xml api is more stable click for more details on this

As I need the response in json, we can use a library like xml to json and vice-versa library

As much as I have seen the xml response from the MusicBrainz api is more accurate and gives a lot of information.

nick.tdr
  • 4,627
  • 4
  • 28
  • 41