how to get album image using musicbrainz

白昼怎懂夜的黑 提交于 2019-12-02 21:28:37

The first thing you need to do is figure out a release identifier (release MBID) for the album you want to get images from, you can do that using the search API, for example:

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

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

Now that you have an identifier, you can do a lookup at the coverartarchive:

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

Which will give you a json response with a list of available images (or a 404 if that release doesn't have cover art in the coverartarchive).

The coverartarchive is fairly new however, and may not always have cover art. MusicBrainz sometimes has a link to cover art, which you can look for by including "url-rels" in a webservice request, for example for the release MBID "fdfdb3c0-8820-4c22-94e6-6aa136e36c31" you can do this request:

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

And in the output you will see an url to an image:

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

Depending on what language you're interested in, this may have been done for you. There is a C / C++ library here:

http://musicbrainz.org/doc/libcoverart

Andy

JonnyJD

I wrote an answer to a similar question.

There are libraries available now that can be of use on Android:

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

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

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!