6

I'm trying to understand how Apple Music API works, and stuck on how to search a song and get its ID. I did some research on Google, and most people suggest using iTunes Search API. However, Apple Music API also provides its own search API. I tried these two, and both can return the correct but very different results. Besides, not all results from iTunes Search API are playable. So I'm guessing that using iTunes search is an old way to get track ID. After iOS 11 we should use Apple Music search API. Anyone sure about this?

(For iTunes search results that are not playable, I had appended s=[countryID] in URL, and I can see the correct country from returned results, and isStreamable = 1)

Also, I notice that to use Apple Music API, we need append the storefront country code to the URL, and the country code is only available in MusicKit after iOS 11. Prior to iOS 11, we can only get country ID from MusicKit, so is there any way to translate country ID to country code?

P. Tsin
  • 435
  • 4
  • 14

0 Answers0