Search code examples
iosiphoneipaditunes

Programmatically construct iTunes URL for all territories given iTunes ID?


We have an email newsletter for iOS apps, but the iTunes links don't work in all territories even if we remove the country reference.

For instance, this is the USA link for one app https://itunes.apple.com/us/app/spoof-charades-free-fun-party/id777551771?mt=8

We remove the country code, thinking it would work in other countries (since removing the country code also works inside the US): https://itunes.apple.com/app/id777551771

However, this fails in other countries like China.

Given an app's iTunes ID, how can you programmatically construct an iTunes URL that works in all territories?


Solution

  • In most cases if you just use us, Apple will resolve the country code for you.