I’m new and kinda noobs on using MB. I’m trying (for fun and personal interest) to write a small webpage to listen to a webradio and have covert art. I can only have the name of the artist and the name of the song and I’d like to have a picture.
Let’s say I have “Deep Purple” and “Child In Time” tags and I want the front cover art of “In rock”.
I understand that I need to make a first resquest like /ws/2/artist?query=artist:“deep purple” in order to get the arid of Deep Purple (first answer probably) and then a second request to get the albums : one like /ws/2/recording?query=something and if I find something interesting, take the album_id and make a final request to coverartarchive.org. Am I correct ?
Is using the arid the best choice or would it be better to put the artist name in the recording request ?
As far as I understand things with my interactive tests on the website, if I use the latter, I get albums by all artists that played a song of Deep Purple and then much more answers.
It seems to me that I would have greater chance to get the best answer in the first place if I would filter with status(:Official) and type(only Album and no other type like Compilation, EP, Live, Single, etc. ) .
How would you write those requests to make them the most efficient ?
Thanks for reading me and thanks for your help,
Best regards,
I guess using the artist name would avoid one query. You have more risks of selecting an homonym but artist+title will probably be unique. Not sure why you get cover results with other artists than Deep Purple.
Thank you very much !
I guess my mistakes were that I forgot method=advanced and I mistyped secondarytype with a ‘-’ which led to these filters to be ignored.
I’m going to try this tonight, thanks again !