← Back to blog

Published · Updated

Building an SEO Rank Tracker with a SERP API

Rank tracking, meaning checking where your pages (or a client's) land in Google search results for a list of target keywords, is one of the most common reasons teams reach for a SERP API instead of building their own Google scraper. Here's how the pieces fit together if you're building one yourself.

For endpoint examples, targeting, and collection costs, start with the rank tracking API integration. PrismCrawl's SERP API overview covers the live Google and Bing endpoints, targeting controls, pagination, request history, and pricing used by this workflow. The Google Search API guide focuses on retrieving those results programmatically.

Core architecture

  1. Keyword list. The queries you care about, usually tagged by page, client, or campaign.
  2. Scheduled search execution. Running each keyword through search on a recurring basis (commonly daily or weekly).
  3. Position extraction. Finding your target domain in the organic results and recording its rank, along with metadata like the URL that ranked, the page title shown, and whether it appeared in any SERP features (featured snippet, "People also ask," local pack, etc.).
  4. Historical storage. Keeping every check over time, not just the latest one, so you can chart movement and correlate ranking changes with content or backlink work.
  5. Reporting/alerting. Surfacing significant rank drops or gains, usually to a dashboard or a notification channel.

Why raw scraping struggles here specifically

Rank tracking has a property that makes it harder than typical scraping: you need a consistent search context, including location and device type, since rankings vary by geography and by mobile vs. desktop. A basic scraper making requests from one IP location, with generic headers, doesn't reliably reproduce this. Volume makes it worse, because a rank tracker running hundreds or thousands of keyword checks daily looks exactly like the kind of automated traffic Google's systems are built to detect and block.

# Position extraction from a successful PrismCrawl JSON response.
from urllib.parse import urlparse

target_domain = "example.com"
for result in payload["data"]["content"].get("results", []):
    host = (urlparse(result["url"]).hostname or "").lower()
    if result["type"] == "organic" and (
        host == target_domain or host.endswith("." + target_domain)
    ):
        print(f'Ranked #{result["rank"]}: {result["title"]}')
        break
else:
    print("Not found on the checked page")

Location and device accuracy

Because rankings vary by location, a rank tracker ideally requests results as if searching from each location you're tracking (a specific city, state, or country), not just from wherever your server happens to run. This is one of the trickier parts to get right with raw scraping, and geographically distributed proxies alone don't solve it. The exit IP is only one of several signals Google weighs, and it's the weakest of them. Our guide to Google search localization covers which parameters actually control result geography and why a proxy in a given city doesn't reliably return that city's results.

Using a SERP API for this

Running a query and getting ranked results back as data instead of HTML is the textbook use case for a SERP API. PrismCrawl returns structured, ranked JSON for a given query, so the position-extraction step above is just reading a field rather than parsing HTML. Geo-sensitive tracking is handled through explicit parameters (country and interface language, plus city-level location or coordinates targeting), so each tracked location is a value in the request rather than a property of your infrastructure.

  • Structured output. Organic results, positions, and SERP features come back as JSON, matching the schema in the API reference.
  • No subscription required. Rank tracking is a recurring, scheduled job, and with PrismCrawl's one-time credit pricing your cost follows the number of checks you actually run instead of a monthly plan sized for peak usage.
  • Free tier to prototype with. The 100 free credits are enough to build and test your extraction logic against real data before committing to a plan.

For a complete, runnable version that also records whether Google's AI Overview, Google AI Mode, and Bing's AI answer cite your site, see how to build a rank and AI Overview citation tracker in TypeScript.

Frequently asked questions

How often should I check keyword rankings?

Daily is common for actively-managed campaigns; weekly is often sufficient for stable, lower-priority keywords. Balance freshness against the cost of checks — see our SERP API pricing comparison for how per-check costs add up at different frequencies.

Do rankings really vary that much by location?

Yes, especially for anything with local intent (services, restaurants, "near me" searches) — the same keyword can show completely different top results in different cities.

Can I build a rank tracker without maintaining my own scraper?

Yes — a SERP API handles the search execution and parsing, so your rank tracker only needs to handle scheduling, storage, and reporting. Sign up for PrismCrawl to get started with 100 free credits.