Query original release (album) based on artist and track names

musicbrainz
webservice
album
query
Tags: #<Tag:0x00007fcb506b0d28> #<Tag:0x00007fcb506b0b48> #<Tag:0x00007fcb506b0850> #<Tag:0x00007fcb506b0620>

#1

Hey there!

I’m trying to find the original album i.e. first release that contains a track that’s been specified by title and artist.

What I’ve come up with so far is:

https://musicbrainz.org/ws/2/recording?query=born+to+die%20AND%20artist:lana+del+rey&fmt=json

Unfortunately this gives me gives me a lot of results including compilations and singles.
How do I narrow this down so that it only shows albums? And on top of that how do I sort these results to get the oldest release as first result?


#2

Just a small remark, in some era, some markets, the original release is on single not on album. So you want to include both.
Also, some recordings are first and only released on compilations. :sweat_smile: