httprequestitunes-storeapple-music

iTunes Lookup API response is different for different clients


Right now it looks like a mystery. Please help me in solving it.

I use iTunes public API to fetch an album: "Metallica" by Metallica (see it in browser: US region, MV region). I construct the following URLs to fetch it via API:

  1. US region https://itunes.apple.com/lookup?id=579372950&country=US&entity=album - works
  2. MV region https://itunes.apple.com/lookup?id=579372950&country=MV&entity=album - doesn't work

Here's the actual behaviour I observe:

I tried it multiple times and the results seem to be consistent. I compared the requests and they seem to be identical.

Why does iTunes respond differently to different clients? I can't understand. What important detail am I missing?


Similar questions:

  1. Spring RestTemplate getForObject URL not working for Apple iTunes - there's another problem (double encoding of the whitespace character).

This problem happens to the following regions (it's a complete list):


Solution

  • I spotted a difference:

    if I don't use quotes around URL, the request is interpreted as GET https://itunes.apple.com/lookup?id=579372950. the default country is US and therefore I see 1 US album in response.