Check if cover art is available via MusicBrainz API

Is there are way to check if cover art is available for a release MusicBrainz API search like

https://musicbrainz.org/ws/2/release/?fmt=json&limit=50&query=release%3A"All+Melody"+AND+artist%3A"Nils+Frahm""

As far as I can see, I’d need to use the /release/{mbid}/ endpoint of the Cover Art Archive API to determine the existence of cover art for each of the results.


When looking at the search results on the MusicBrainz website, I’m seeing the small cover art icon, suggesting the information might already be available more directly:

MusicBrainz web search result

I think, you can find the answer here:

1 Like

I think OP is trying to avoid making separate requests to the Cover Art Archive API for each release in the results. If CAA has the same 1-request-per-second bulk limit as the MB API, it could take almost a minute to query 50 releases.

1 Like

Yes, that’s my intention. It’s no problem to query the CAA for each of the releases, there is also no rate-limit in place at the moment. I wanted to reduce traffic to the necessary minimum (and prevent 404s) and was just curious if there is a way to omit unnecessary calls to the Cover Art Archive API.

I’ve since checked with the MB server implementation and found the cover_art_presence flag, indicating that this information is available internally. It’s also provided if a request for an actual release is made but not for the query search result.

There is also a related ticket:


As background information, I want to display a cover art thumbnail on searches, so that choosing the correct search result becomes a little bit easier:

Cover Preview

2 Likes

The MB web service indicates on a release query if there is cover art available or not when requesting individual releases (not on search queries). The response for a single release will contain something like this:

{
  "cover-art-archive": {
    "artwork": true,
    "count": 11,
    "back":true,
    "front":true,
    "darkened":false
  }
}

artwork indicates whether there is cover art or not. Compare these two requests with and without cover art:

https://musicbrainz.org/ws/2/release/22e4c1d6-ded1-40a9-8027-4dfe4935ce4b?fmt=json
https://musicbrainz.org/ws/2/release/4805ebce-9726-3dfe-9edc-76e2bb27465e?fmt=json

I think darkened indicates that the cover art had to be disabled on the CAA due to copyright complaints, and hence effectively is not available. But I’m not sure about the details.

CAA doesn’t have this rate limit.

2 Likes

Thank you for the answer. I’m aware of the details provided when querying a single release, my question was regarding a list of releases (as indicated in the OT).

I guess the answer to my question is NO then, and given the linked ticket had not gained any traction over the years, it’s probably also not a widely requested feature.

1 Like