iosapp-storeitunes

Get iOS iTunes App Store ID via BundleID?


Could an iOS app get the iTunes link of itself? Before publishing the app, the appstore id is unknown. Is there an API for this?


Solution

  • Here is the answer.

    1. The app requests http://itunes.apple.com/lookup?bundleId=com.clickgamer.AngryBirds
    2. Find the "version": "2.1.0" and "trackId": 343200656 in the JSON response.

    Warning: This API is undocumented, Apple could change it without notice.

    References:

    [1] https://github.com/nicklockwood/iVersion/blob/master/iVersion/iVersion.m#L705
    [2] https://stackoverflow.com/a/8841636/41948
    [3] http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStoreServices.woa/wa/wsLookup?id=343200656&mt=8
    [4] http://itunes.apple.com/WebObjects/MZStoreServices.woa/ws/wsSearch?term=+Angry+Birds&country=US&media=software&entity=softwareDeveloper&limit=6&genreId=&version=2&output=json&callback=jsonp1343116626493