-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extract application version from web app store #468
Comments
The existing API call used to get the current version of an app is:
This currently returns a small JSON object that includes the app's current version, but it doesn't limit the results to the Mac platform (either it's retrieving the results for the platform with the highest version, or it's always preferentially retrieving results for some platform other than the Mac). The endpoint will, however, accept an additional query string parameter: The only values that I have found to work are: We can either try to find the |
@rgoldberg Problem is that the data in the iTunes database isn't reliable. As an example, I suggest you search for the ID=1365531024 which corresponds to the Mac App Store app called 1Blocker. The results from iTunes show that the latest version is 5.2.5. This is also reported by the mas client which reports that there's an update available from 4.1.7 to 5.2.5. Yet updating doesn't change the version which remains at 4.1.7. If you visit the Mac App Store and search for 1Blocker, you'll also see that the latest version available is 4.1.7. Therefore, it appears that the information from https://apps.apple.com/app/broadcasts/id1365531024 is more reliable. |
@odebroqueville Unless I've missed something, the JSON returned for that ID should be for the iPhone version of the app, not the macOS version of the app. I'm trying to find the correct value for the |
@rgoldberg If you use the query https://itunes.apple.com/search?term=id1365531024&country=ch&entity=macSoftware it will result in a json containing:
and "version":"5.2.5" as well as: "trackViewUrl":"https://apps.apple.com/ch/app/1blocker/id1365531024?uo=4" which is the website for all 3 versions of the app (Mac, iPad and iOS). In the json file, I don't see any version 4.1.7. P.S. I used the following documentation: https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/iTuneSearchAPI/Searching.html#//apple_ref/doc/uid/TP40017632-CH5-SW1 |
@odebroqueville Your URL didn't include the |
@rgoldberg where did you get the platform parameter from? |
@odebroqueville I think I might have just tried it. Maybe I saw it on some web page, but I don't think so. It is an accepted param, and the values listed in my comment above are accepted. Random param names are rejected, as are random values for |
Probably superceded by #496. |
In case that PR isn't merged/an alternative one is it might make sense to keep this open and have it be closed by the PR being merged. |
Updated snippet to get version by platform: |
The iTunes search API does not provide application version per platform, and makes mas-cli report a newer version which in fact is for another platform.
The applicaiton metadata are embedded as json in the html page from the web version of the App Store, in a <script type="fastboot/shoebox" id="shoebox-media-api-cache-apps"> tag.
This information provides the application version history per platform.
Example for application Broadcasts https://apps.apple.com/app/broadcasts/id1469995354 :
curl "https://apps.apple.com/app/broadcasts/id1469995354" | tr -d '\n' | sed -e's:.*<script type="fastboot/shoebox" id="shoebox-media-api-cache-apps">::' -e's:</script>.*::' | jq ' to_entries | .[0].value | fromjson | .d[0].attributes.platformAttributes | to_entries[] | { platform: .key , version : .value.versionHistory[0].versionDisplay } '
produces
{ "platform": "appletvos", "version": "2.3" } { "platform": "osx", "version": "2.2.7" } { "platform": "ios", "version": "2.3.3" }
which are correct regarding the different platforms.
I checked this extraction on several cases of erroneous versions reported and so far have not encountered a problem.
The text was updated successfully, but these errors were encountered: