How to get an image of an album using musicbrainz

I don’t know if I can ask such a question here or not. My question is the following.

I make a music player myself, and I want to upload album images for those songs that don't have an album image. Just like N7Music Player does. I did the search myself, and I found out that with MusicBrainz we can upload images.

I was looking for an API, but I do not understand it. I have the following doubts.

  • How to get an API key?
  • It's free?
  • How to make an API call if the name of the artist and the name of the song are known to get an album image for this song?

I look forward to your valuable feedback.

Thank you in advance.

+4
source share
4 answers

If you know the name of the album and the name of the artist, then the link below will be useful. She will provide you images.

http://www.radiodj.ro/community/index.php?topic=1895.0

0
source

The first thing you need to do is to find out the release identifier (MBID release) for the album from which you want to receive images, you can do this using the search API, for example:

http://www.musicbrainz.org/ws/2/recording/?query=artist:nikes+recording:ftg2 

Since this is a search, you will get many results, some of them will be erroneous. In this case, the first result is correct and corresponds to only one release, it has the following MBID: "c04730ea-87cb-478b-a256-08c0561d20e6".

Now that you have the identifier, you can do a search in coverartarchive:

 http://coverartarchive.org/release/c04730ea-87cb-478b-a256-08c0561d20e6/ 

Which will give you a json answer with a list of available images (or 404 if this version does not have a cover in Coverartarchive).

Coverartarchive is fairly new, but may not always have a cover. MusicBrainz sometimes has a link to an art cover that you can search for, including β€œurl-rels” in the webservice request, for example, for the MBID of the release β€œfdfdb3c0-8820-4c22-94e6-6aa136e36c31” you can run this request:

 http://musicbrainz.org/ws/2/release/fdfdb3c0-8820-4c22-94e6-6aa136e36c31?inc=url-rels 

And in the output, you will see the image URL:

 <relation type="cover art link"> <target>http://liveweb.archive.org/http://www.8bitpeoples.com/images/albums/large/8BP049.gif</target> </relation> 
+13
source

Depending on which language interests you, this may be done for you. There is a C / C ++ library here:

http://musicbrainz.org/doc/libcoverart

Andy

+2
source

I wrote an answer to a similar question .

Now available libraries that can be useful on Android:

Last.fm CoverArtArchiveClient is the binding of Java data to the cover web service and musicbrainzws2-java is the binding of Java to the current MusicBrainz web service (WS / 2 = "NGS").

+1
source

Source: https://habr.com/ru/post/1446935/


All Articles