Skip to content

Instantly share code, notes, and snippets.

@e2po
Last active September 12, 2023 11:07
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save e2po/78e9a407adcd18e136e62429c0bad9e2 to your computer and use it in GitHub Desktop.
Save e2po/78e9a407adcd18e136e62429c0bad9e2 to your computer and use it in GitHub Desktop.
Python script to fetch min iOS version of an app directly from App Store
import requests
import csv
import sys
import pandas
def min_os_ver(app_id):
print('fetching min os version for app id: ' + str(app_id))
with requests.get("https://itunes.apple.com/lookup?id=" + str(app_id)) as r:
for result in r.json()["results"]:
return result["minimumOsVersion"]
csv_input_file = sys.argv[1]
csv_output_file = sys.argv[2]
csv_input = pandas.read_csv(csv_input_file)
csv_input['minimum_os_version'] = csv_input['app_identifier'].apply(min_os_ver)
csv_input.to_csv(csv_output_file)
@e2po
Copy link
Author

e2po commented Jun 11, 2020

Install

brew install python3
pip3 install pandas
pip3 install requests

Usage

python3 app-min-ios-version-fetcher.py input.csv output.csv

Note: Script requires a CSV input with the application_identifier column.

Sample Input

application_identifier
123
321

Sample Output

application_identifier minimum_os_version
123 13.0
321 11.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment