0
votes

Using the apple itunes search api it is possible to get information on songs such as artist, title and apple store track_id: enter image description here

Using an MPMusicPlayerController (i tried both system and application) one should be able to play songs using:

player = MPMusicPlayerController.systemMusicPlayer()
player.setQueueWithStoreIDs(["574050602"])
player.play()

As noted here some IDs seem to not work. (e.g. "574050602" is supposed to play a certain song by Rick Astley)

I have read that you need a country specific store id.

How can I determine whether a specific song will be playable or not without actually trying to play it?

The isStreamable property does not indicate whether I can actually stream it.

2

2 Answers

1
votes

To only get track IDs that are playable in your country you need to specify your country on search using the country parameter (source)

I have not found out what kind of problems the author at 1 had with this parameter, but there also seems to be an undocumented parameter s which might help.

0
votes

The trackIDs are not shareable between countries. Therefore you will need to let the user get their own countries' trackID code by performing an API request with the user's countrycode.