How to track Android app updates automatically
A nightly job that tells you when any app on your watchlist ships a new version.
Idea
Keep a watchlist of package names. Every night fetch them in batches of 100, compare version and updated with yesterday, and report the differences.
import json, os, requests
H = {"X-API-Key": os.environ["API_KEY"]}
watch = open("watchlist.txt").read().split()
old = json.load(open("versions.json")) if os.path.exists("versions.json") else {}
new = {}
for i in range(0, len(watch), 100):
r = requests.get("https://apkapi.net/api/v1/apps",
params={"ids": ",".join(watch[i:i+100])}, headers=H, timeout=60).json()
for a in r["apps"]:
new[a["id"]] = [a["version"], a["updated"]]
for pkg, v in new.items():
if old.get(pkg) != v:
print(pkg, old.get(pkg), "->", v)
json.dump(new, open("versions.json", "w"))Whole categories
Instead of a watchlist, ask for everything popular that changed: /search?updated_from=YYYY-MM-DD&min_installs=1000000&sort=updated.
Cost
A 500-app watchlist checked nightly costs about 15,000 credits a month.