Retrieve Cover Art via MSXML2 call

Hi all,
I’m using MSXML2 with the json format to retrieve information from MusicBrainz.
That woks fine.
Now I would like to retrieve album cover art.
I understood that this has to be fetched via using the MBID, but I didn’t understand how this exactly works.
Can somebody post any example URL for me?

I tried (for example) this:

The result is an html page and I don’t know how to retrieve the jpg.

Can anybody help?

The cover art archive has its own API, see Cover Art Archive / API - MusicBrainz

You can get information about the cover art for a release with e.g.

1 Like

That’s what I was looking for!
Thank you.

Hi outsidecontext,
sorry but I have to ask again.
I get some unexpected error messages.
Calling your URL leads to an redirected URL:
instead of

Entering the redirected path in a firefox browser, I retrieve the JSON Information I want to get.
Retrieving the exact same URL via MSXML2 leads to an “access denied” error - and the MSXML2 Code itself works fine…
Any clue why this might happen or what the reason for the redirection is?

I don’t know MSXML2. A quick Google search shows it is some XML processing library. Not quite sure why you need this, maybe use some dedicated HTTP request library instead.

But does MSXML2 follow the redirect properly? Can you share the full HTTP response you get? That might contain some details on why your request is failing.

Also set a proper “User-Agent” header with a meaningful user agent. The library by default will most likely set a generic User-Agent instead, maybe that gets blocked.

You could also check with curl if fetching the URL and doing the redirects works in general:

curl -iL ""

Maybe also one of the existing libraries to access the CAA web service can help: Cover Art Archive / API - MusicBrainz

1 Like

ok, I found out how to send a User-Agent string an implemented it.
Unfortunately this was not the reason for my problem, but I’m getting closer.

Please adivce me again, if possible.

I made a wrong assumption.
An Example.
is redirected to
Using (A) in my code doesn’t work, (B) works fine!
So I replaced the MBID Part of (B) to retrieve a different artwork.

That doesn’t work, because (for example)
is redirected to

The first Part of the URL is allways different when redirected!
So, do you have any idea how to change the URL (A or C) you’ve given me in a way that I can retrieve JSON readable information from it?

– Ulrich

Yes, you can’t use the second URL and replace the IDs. The only proper API request is using{RELEASE_MBID}

What you describe is indicating that the HTTP library is not following the redirect automatically. You either need to check whether the library supports automatic redirect following (not all do) and set it up accordingly, or you need to implement redirect handling yourself by checking the HTTP status code and Location header of the intial response. Basically the first response returns one of the 3xx redirect status code (302 probably, but you need 5o check) and a Location header with the new URL. Redo a request against this URL.

You might also check whether a different HTTP library works better for you. I haven’t used .Net for years, though, and can’t really give recommendations.


here we go…
I had to change the Objecttype from “MSXML2.XMLHTTP” to “WinHttp.WinHttpRequest.5.1”.
Then the redirection works.

Thank you for your help!