Get Annotations from the API

Tags: #<Tag:0x00007fd2d990a020>

I’m using [https://github.com/schnatterer/musicbrainzws2-java] (https://github.com/schnatterer/musicbrainzws2-java)java bindings for MB API.
As described in this Github Issue there seems to be a programming error when it tries to find annotations for the recordings. As the maintainer can’t put more effort into this, i try to understand and maybe fix this.

The library request this URL https://search.musicbrainz.org/ws/2/annotation/?limit=100&offset=0&query=entity%3A15c99a4b-4a30-49be-a129-9c5b472240da which results in a error.
Reading the main documentation page of the api, i don’t know how to get Annotations via the XML Api nor can i find any mention of search.musicbrainz.org domain.

Can anybody help with whats wrong in the java binding or point me into a direction where to look in the API documentation?

thanks in advance!

Annotation is a property of some entities - there is no MBID, and therefore no lookup.

https://musicbrainz.org/doc/MusicBrainz_API#Lookups

2 Likes

To get the Annotations of a specific entity, i should then append ?inc=annotation at a lookup request?

This will return only the current Annotation right?

1 Like

Yes, a recording lookup only returns a single recording. The example you used doesn’t have an annotation, but here is an example with annotation returned in the lookup result:

https://musicbrainz.org/ws/2/recording/05f54b65-23ee-4ead-a090-4a1902a671a5?inc=annotation

2 Likes

And whats with search.musicbrainc.org URL, is this some removed Part of API left in the Java Bindings?
Furthermore at the moment in the java bindings the model for Annotation has Values for Type and Name, similar like defined in the Relax NG Schema

I’m still a newby for this kind of development, maybe someone has time to help with that.

You can actually use the kind of search you wanted - taking the example that does have an annotation @outsidecontext shared, you can do https://musicbrainz.org/ws/2/annotation/?limit=100&offset=0&query=entity:05f54b65-23ee-4ead-a090-4a1902a671a5 and it will give you the annotation :slight_smile: But often it will be easier to just ask for the annotation when querying for the entity, as that post showed, if you just want it for one recording or artist or whatnot; the annotation endpoint is more useful for things like https://musicbrainz.org/ws/2/annotation/?limit=100&offset=0&query=text:error

search.musicbrainz.org is not meant to be used directly, so that library is probably old from a time when we were using that to test our new search service or something?

Edit: thought I’d also leave a link to the documentation for the annotation endpoint for future reference.

5 Likes