How to return only official release groups from webservice

How to return only official release groups from webservice? From docs: Release-groups can be filtered on type, and releases can be filtered on type and/or status. But I need filter release-groups on status (oficial). Help me.

Status is for release, not release-group. Thus, you have to query for releases, filter on status (with status=official), and include release-group information (with inc=release-groups):

https://musicbrainz.org/ws/2/release?artist=0383dadf-2a4e-4d10-a46a-e9e041da8eb3&status=official&inc=release-groups

2 Likes

But this is a bad decision. I need to get all the official albums (release groups) and sort them by date. To do this, I have to return all the releases (make dozens of requests) then filter them and sort them by date. I will have to remove the sorting for better performance, and the application will suffer because of this. Would you like to see albums on your site in random order? This is very bad.

↓↓↓

Please, help me.

sorry for my English

1 Like

You may want to consider running a local copy of the database if the only other option is to “make dozens of requests”. That way you can make SQL queries against it and get exactly the data you want, no more and no less.

3 Likes

Unfortunately, this is impossible for a mobile application.

  • all […] for a given artist, right?
  • album is a specific type of release group in MusicBrainz. Add type=album parameter if you want albums only rather than release groups of any type.

For a given artist, you only need to make one request (given in my first reply), then filter release groups and sort them by first-release-date.

2 Likes

Erratum: This is not exact. For Queen, there are 552 album releases, you have to make 6 requests with limit=100 at different offset.

2 Likes

I found better decision: http://musicbrainz.org/ws/2/release-group/?query=arid:0383dadf-2a4e-4d10-a46a-e9e041da8eb3%20AND%20primarytype:album%20AND%20secondarytype:(-*)%20AND%20status:official&fmt=json return 14 official albums of Queen

2 Likes

Oh ok, these are studio-recorded official albums only.