How to get/search cover image of track?

Tags: #<Tag:0x00007f2a11116218> #<Tag:0x00007f2a111160d8> #<Tag:0x00007f2a11115f98> #<Tag:0x00007f2a11115d68>



I want to get the cover image of track. How can i do that? Can anybody give an example?



Can you give us the MusicBrainz-URL for your track, like


Let me describe what i want to achieve…

-> user can search track cover image by name and it should return list of images from which user can select correct track image .

I did’t get what do you mean by ‘MusicBrainz-URL’?


First thing to note is that MusicBrainz does not store images per track, but per release. Is that what you want?

Also it is not clear what exactly you are doing. Are you developing some software, and in that software the user can search for a track name and get the corresponding album artwork?

If that’s the use case you can use the MusicBrainz API and Cover Art Archive API for this.

The basic idea would be that you search for a recording with the entered name and include all releases with the result, like this for “Paint it Black”:"Paint%20It%20Black"%20AND%20status:official%20AND%20primarytype:album&inc=releases

There might be more than one recording, so you will have to look at several for the best match for your use case. A recording will also be often on multiple releases, so you have to filter the releases as well. Maybe you want to focus on primarytype “album” and secondarytype not set at all. If there is not primarytype “album”, fall back to “single” or “ep”. Maybe sort by release date, so you get the earliest available one. You can also display the user multiple results.

Once you have a release ID you can query the Cover Art Service:

Not every release will have cover art of course.