Skip to content

Instantly share code, notes, and snippets.

@e2po
Created September 3, 2021 14:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save e2po/9b7f8d847f3df08edd632abfc447aced to your computer and use it in GitHub Desktop.
Save e2po/9b7f8d847f3df08edd632abfc447aced to your computer and use it in GitHub Desktop.
Python script to fetch min Android version of an app directly from Google Play Store
import requests
import csv
import sys
import pandas
from google_play_scraper import app
def min_os_ver(app_id):
print('fetching min os version for app id: ' + str(app_id))
try:
return app(app_id, lang = 'en', country = 'us')['androidVersion']
except:
return '-'
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 Sep 3, 2021

Install

brew install python3
pip3 install pandas
pip3 install requests
pip3 install google-play-scraper

Usage

python3 app-min-android-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