How can I retrieve the list of external links, annotation and wikipedia text via API?

I am struggling to understand how to get external links, annotation and wikipedia text and didn’t have any luck with the docs.

I am currently fetching the artist’s catalog with https://musicbrainz.org/ws/2/release-group?query=arid:${musicbrainzId}%20AND%20status:official&limit=${limit}&offset=${offset}&fmt=json but I’d like to also get these particular fields to populate my page.

Any help would be really appreciated!

For annotation and URL relationships use the inc parameter inc=url-rels+annotation. See also MusicBrainz API - MusicBrainz for additional inc parameters to use.

The Wikipedia text is not returned by MB. To get this you’d need to use the Wikipedia and Wikimedia APIs. Usually the MB entries have a Wikimedia link. The Wikimedia API can be used to get matching Wikipedia entries in the language you are interested in. But you’d need 5o look into the respective API documentation for details, I’m not too familiar with these.

5 Likes

I tried it with the query I had: https://musicbrainz.org/ws/2/release-group?query=arid:d87e52c5-bb8d-4da8-b941-9f4928627dc8%20AND%20status:official&limit=100&offset=100&inc=url-rels+annotation+genres&fmt=json

But I can’t seem to find the fields:

What am I doing wrong? Thanks a lot!

1 Like

You are using a search query, that doesn’t support the inc parameter. You either need to do a lookup (single item) or browse request.

I think in your case a browse for release groups by artist ID works best:

https://musicbrainz.org/ws/2/release-group?artist=d87e52c5-bb8d-4da8-b941-9f4928627dc8&limit=100&offset=100&inc=url-rels+annotation+genres&fmt=json

You’ll need to do the filtering by status client side then. The alternative would be to do your search and then do a lookup of a specific RG by ID in a separate request.

4 Likes

I’m sorry if I’m being annoying but I’m trying to understand :slight_smile:

With your query, I seem to lose information about the artist (my query has an artist-credits), and that’s exactly the annotation and social media links I want to have:

What I seem to get is the annotations about each album, not about the artist. Is that possible to achieve with only one request?