How to return only official release groups from webservice

webservice
Tags: #<Tag:0x00007f11c78dff10>

#1

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.


#2

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


#3

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.


#4

↓↓↓

Please, help me.


#5

sorry for my English


#6

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.


#7

Unfortunately, this is impossible for a mobile application.


#8
  • 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.


#9

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


#10

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


#11

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