1

This is a pretty straight forwards question.

I get a json object that contains all the albums of a particular artist, for example Michael Jackson

https://itunes.apple.com/search?term=michael+jackson&entity=album

And then I parse the object for an image url matching my album title.

The problem is that these json objects don't always contain all the albums of a particular artist.

Is there a way around this?

the_prole
  • 8,275
  • 16
  • 78
  • 163
  • The results may not contain all the albums from an artist because they simply aren't on iTunes. – OneCricketeer Dec 16 '15 at 05:38
  • itunes has the albums I'm looking for, just not inside these json objects. – the_prole Dec 16 '15 at 05:41
  • you could also increase the limit to 200 to be more sure. – hypd09 Dec 16 '15 at 05:42
  • @hypd09 How do I do that if I may ask? You might be right. I just realized I never get more than 50 results! – the_prole Dec 16 '15 at 05:43
  • Add `&limit=200` to the end of the url. There may be a JSON field the gets the next "page" of results also. – OneCricketeer Dec 16 '15 at 05:44
  • believe it or not, it is `limit=200` :P Also check [itunes search api page](https://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html) for more parameters you can use. – hypd09 Dec 16 '15 at 05:45
  • @cricket_007 Thanks! Can I make the limit as high as a I want? – the_prole Dec 16 '15 at 05:45
  • No it caps at 200 it seems. – hypd09 Dec 16 '15 at 05:45
  • @cricket_007 What do you mean by next "page" field? Do you have an example? As far as I can see, I can't get more than 200 results on one page. – the_prole Dec 16 '15 at 06:15
  • 1
    I looked and this api doesn't have it. But for example, your first call gets results with index `0..limit`, then there is a term called pagination in some APIs where they provide a url to get the results with indices `limit+1..2*limit`, and so on – OneCricketeer Dec 16 '15 at 06:19
  • @cricket_007 Okay, thanks. So what is the best api for album art in your opinion? – the_prole Dec 16 '15 at 06:25
  • Dunno, maybe last.fm? What is wrong with the artworkUrl fields provided? – OneCricketeer Dec 16 '15 at 12:09
  • @cricket_007 iTunes and Spotify do not offer complete collections of album artworks, not unless you have a special ID number to look them up. So what I did was I used an app on my phone to sniff out the net work calls being made by some of the other apps on my phone that were successfully able to get all the art works, and I noticed they were making calls to the amazon web service... so my next implementation will be an Amazon web service utility. – the_prole Dec 16 '15 at 19:22
  • Yeah, I figured you'd have to make 2 hops to get the album information from the ID. I found a similar [last.fm API endpoint](http://www.last.fm/api/show/album.getInfo) – OneCricketeer Dec 16 '15 at 19:32
  • @cricket_007 That's exactly it. I don't think iTunes or Spotify gives you a way to get a hold of the ID first. Amazon [does](http://stackoverflow.com/questions/2730948/download-album-art-from-internet-in-an-android-application) apparently. Thanks, I'll check out Last FM. – the_prole Dec 16 '15 at 21:09
  • Welcome. You could dig around [this Last.fm Android app](https://github.com/lastfm/lastfm-android/tree/master/app) also – OneCricketeer Dec 16 '15 at 21:21

0 Answers0