Is there any appstore with an API? [closed]
-
28-05-2021 - |
質問
I want to read app names and reviews from an appstore. Can be any appstore: Apple appstore, Google market/play, Amazon... Anyone aware of any appstore that exposes a public API for this?
解決
Yes, it's possible to fetch Data from the Apple AppStore. The page returns all information about the app in JSON, so you simply have to decode the output:
$context = stream_context_create(array('http' => array('header'=>'Connection: close')));
$inh = file_get_contents("http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStoreServices.woa/wa/wsLookup?id=$appid&country=us");
$inh = json_decode($inh);
$rs = $inh->results["0"];
$ituneslink = $rs->trackViewUrl;
$price = $rs->price;
$appname = $rs->trackName;
$screens = $rs->screenshotUrls;
...
Be sure to insert the App-ID.
所属していません StackOverflow