DEV Community

Himanshu Agrawal
Himanshu Agrawal

Posted on

How to Track Your App's Keyword Rank on the App Store and Google Play with Python

Disclosure: I built the App Store and Google Play API used in this guide and earn from its paid plans on RapidAPI.

Where does your app rank when someone searches "habit tracker"? It is the first question of app store optimization (ASO), and neither store tells you. Apple's App Store Connect API and the Google Play Developer API manage your own listings; they don't report search rankings or anything about other developers' apps. ASO tools do, but most are monthly subscriptions built for teams, which is a lot if you just want to watch a few keywords.

This guide does it from Python with an App Store and Google Play API on RapidAPI, which searches both stores in one call. The example is real: the "habit tracker" keyword in the US, where one indie app (HabitKit) ranks, which apps in that list actually make money, and what the biggest earner looks like. Three requests, all on the free plan.

Setup

Subscribe to the Basic plan on the API page (free, 50 requests a month) and copy your x-rapidapi-key. Keep it out of your code:

export RAPIDAPI_KEY="your-key"
Enter fullscreen mode Exit fullscreen mode

On Windows, use set RAPIDAPI_KEY=your-key. One helper covers all three endpoints:

import os
import requests

HOST = "app-store-and-google-play-api5.p.rapidapi.com"
HEADERS = {"x-rapidapi-host": HOST, "x-rapidapi-key": os.environ["RAPIDAPI_KEY"]}
STORES = {"googlePlay": "Google Play", "appStore": "App Store"}


def get(path, **params):
    resp = requests.get(f"https://{HOST}{path}", params=params, headers=HEADERS, timeout=90)
    resp.raise_for_status()
    return resp.json()["data"]
Enter fullscreen mode Exit fullscreen mode

Step 1: Who ranks for the keyword, on both stores

apps = get("/apps/v1/search", q="habit tracker", store="both", country="us", limit=50)

for store, name in STORES.items():
    ranked = [a for a in apps if a["store"] == store]
    print(f"{name}: {len(ranked)} results")
    for a in ranked[:5]:
        print(f"  #{a['rank']:<3}{a['title']}")
Enter fullscreen mode Exit fullscreen mode

Output (run on 11 November 2026):

Google Play: 30 results
  #1  Loop Habit Tracker
  #2  HabitNow Daily Routine Planner
  #3  Habitica: Gamify Your Tasks
  #4  Disciplined - Habit Tracker
  #5  Habit Tracker - HabitKit
App Store: 36 results
  #1  Habit Tracker
  #2  Finch: Self-Care Pet
  #3  Habit Tracker - HabitKit
  #4  Onrise: Habit Tracker & Focus
  #5  Routine Planner, Habit Tracker
Enter fullscreen mode Exit fullscreen mode

rank is the position in that store's search results for the country you pass. Both stores returned fewer than the 50 apps the code asked for, which is normal: the store decides how many results a keyword gets. Only one app is in the top 5 on both stores, and it is an indie app, HabitKit.

Step 2: Track your own app's rank every day

import csv
from datetime import date

MY_APP = {"googlePlay": "com.roehl.habitkit", "appStore": "com.roehl.habitkit"}  # package name, bundle ID

ranks = {a["store"]: a["rank"] for a in apps if a["appId"] == MY_APP.get(a["store"])}
for store, name in STORES.items():
    print(f"HabitKit on {name}: {'#' + str(ranks[store]) if store in ranks else 'not in the results'}")

with open("ranks.csv", "a", newline="", encoding="utf-8") as f:
    csv.writer(f).writerow([date.today().isoformat(), "habit tracker", ranks.get("googlePlay"), ranks.get("appStore")])
Enter fullscreen mode Exit fullscreen mode
HabitKit on Google Play: #5
HabitKit on App Store: #3
Enter fullscreen mode Exit fullscreen mode

And ranks.csv gets one line per run:

2026-11-11,habit tracker,5,3
Enter fullscreen mode Exit fullscreen mode

Run it once a day from cron or a scheduled GitHub Action and the CSV becomes a rank history you can chart. One keyword a day is about 30 requests a month, inside the free plan, because one call covers both stores. The package name on Google Play and the bundle ID on the App Store happen to match for HabitKit, but often they don't, which is why MY_APP keeps one per store.

Step 3: Which of these apps actually make money?

Search rank is vanity unless it pays. The top-grossing chart shows who earns the most in a category, so cross it with the keyword results:

chart = get("/apps/v1/charts", chart="top-grossing", store="both", category="HEALTH_AND_FITNESS", country="us", limit=50)
for store, name in STORES.items():
    top = [a["title"] for a in chart if a["store"] == store]
    print(f"{name}, top grossing Health & Fitness ({len(top)} apps): {' | '.join(top[:3])}")

keyword_rank = {}
for a in apps:
    keyword_rank.setdefault(a["appId"], {})[a["store"]] = a["rank"]
for a in chart:
    if a["appId"] in keyword_rank:
        found = ", ".join(f"{STORES[s]} #{r}" for s, r in keyword_rank[a["appId"]].items())
        print(f"{a['title']}: #{a['rank']} top grossing on {STORES[a['store']]}, ranks for 'habit tracker' on {found}")
Enter fullscreen mode Exit fullscreen mode
Google Play, top grossing Health & Fitness (50 apps): Google Health (Fitbit) | MyFitnessPal: Calorie Counter | Strava: Run, Bike, Walk
App Store, top grossing Health & Fitness (16 apps): MyFitnessPal: Calorie Counter | LADDER Strength Training Plans | Flo Cycle & Period Tracker
Finch: Self-Care Pet: #5 top grossing on Google Play, ranks for 'habit tracker' on App Store #2
Finch: Self-Care Pet: #14 top grossing on App Store, ranks for 'habit tracker' on App Store #2
Enter fullscreen mode Exit fullscreen mode

Of the 66 search results for "habit tracker", only one app is in either top-grossing chart: Finch, a self-care pet app, at #5 on Google Play and #14 on the App Store. On Google Play it isn't even in the top 30 for the keyword, so it earns without winning that search. The code matches on appId, which works here because Finch uses the same ID on both stores. Most habit apps on the App Store are listed under Productivity (27 of the 36 here), so run the same check with category="PRODUCTIVITY" as well.

Step 4: Size up the competitor

finch = get("/apps/v1/details", app="com.finch.finch", country="us")
five_star = finch["ratingHistogram"]["5"] / finch["ratings"]
print(f"{finch['title']} by {finch['developer']}")
print(f"  {finch['score']} stars from {finch['ratings']:,} ratings, {five_star:.0%} of them 5 stars")
print(f"  {finch['installs']} installs (Google Play's own count: {finch['realInstalls']:,})")
print(f"  in-app purchases {finch['inAppPriceRange']}, released {finch['released']}, updated {finch['updated'][:10]}")
Enter fullscreen mode Exit fullscreen mode

app takes a Google Play package name, an App Store ID such as 1528595748, or a link from either store.

Finch: Self-Care Pet by Finch Care Public Benefit Corporation
  4.88 stars from 640,144 ratings, 93% of them 5 stars
  10,000,000+ installs (Google Play's own count: 16,717,657)
  in-app purchases $1.99 - $399.99 per item, released May 11, 2021, updated 2026-11-10
Enter fullscreen mode Exit fullscreen mode

That is the bar in this niche: 93% five-star ratings, more than 16 million installs, in-app purchases up to $399.99 and an update in the same week. realInstalls is Google Play's own count behind the public "10,000,000+" range. The details also include the description, recent changes, version, minimum OS, content rating and screenshot links.

What it costs

Each call is one request, so this tutorial used 3 of the 50 free monthly requests on the Basic plan, and tracking one keyword daily uses about 30. If you need more: Pro is $9.99 a month for 1,000 requests, Ultra $29.99 for 5,000 and Mega $99 for 15,000.

Limits worth knowing

  • Search returns up to 50 apps per store and charts up to 100 per store, so store="both" can give twice that. Stores often return fewer, as you saw above.
  • Google Play search results are light: no rating count or installs. Use /apps/v1/details for one app, or details=true on search to add full details to every result (slower).
  • Category codes: HEALTH_AND_FITNESS and PRODUCTIVITY work on both stores; games are GAME on Google Play and GAMES on the App Store.
  • Search and charts are cached for 6 hours and details for 12 hours, so checking a rank more often than every 6 hours just returns the cached answer.
  • country (us, in, gb, de and so on) picks the store, and language the language of titles and descriptions.
  • Rankings are what an anonymous visitor in that country sees. A signed-in phone can show a slightly different order.

Note: this tutorial was written with AI assistance. The outputs are from real API calls, and the code was tested against those responses.

Top comments (0)