# Google Rank Tracker: Keyword Positions with History (`lasting_bonnethead/google-rank-tracker`) Actor

Check where your domains and competitors rank in Google organic results for a keyword list, with stored per-project history (change vs last run, best and worst position) and early stop so you pay only for result pages fetched.

- **URL**: https://apify.com/lasting_bonnethead/google-rank-tracker.md
- **Developed by:** [Fatih S.](https://apify.com/lasting_bonnethead) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.50 / 1,000 keyword checkeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Google Rank Tracker: Keyword Positions with History

### What it does

This Actor checks where your domains (and up to 10 competitor domains) rank in Google's organic results for a list of keywords. Each run stores the results in a named key-value store, so the next run can report the change since the last check plus each domain's best and worst position over time. It is meant to run on an Apify schedule, daily or weekly.

Searches go through Apify's GOOGLE_SERP proxy. You don't need a Google account or a third-party SERP API key.

### How it works

1. For every keyword, the Actor fetches Google results 10 at a time, up to **Max depth** (default 100, so at most 10 pages).
2. **Early stop:** paging stops as soon as all your domains and competitors have been found. If they are all in the top 10, only one page is fetched. You pay only for pages actually fetched.
3. Organic results are parsed in order, skipping ads, People Also Ask, local pack, video/image carousels, top stories, knowledge panel and AI overview links. Position is the 1-based organic rank across pages.
4. Each tracked domain gets one dataset row per keyword with its position, the position from the last run, the change, and best/worst position.
5. History is written only for successful checks. A blocked or failed query never overwrites good data.

### How history works

History lives in the named key-value store `rank-tracker-history` (in your account, kept between runs), under a key derived from **Project name** (non-allowed characters become `-`, max 63 characters). An entry exists per keyword + country + language + device + location + domain, and holds:

- `lastPosition`, `lastUrl`, `lastCheckedAt`, `firstCheckedAt`
- `bestPosition` + `bestPositionDate`, `worstPosition` + `worstPositionDate` (worst only counts positions where the domain actually ranked)
- `checks` (number of successful checks)
- `history`: the last 90 `{date, position}` points (`position: null` = not in the top maxDepth)

If a project's history grows past about 8 MB, it is split across keys `<project>-0`, `<project>-1`, ... by keyword hash. You can download the store from the Apify Console (Storage > Key-value stores > rank-tracker-history). Set **Reset history** to start a project over. Changing country, language, device or location starts new entries; it does not mix them with existing ones.

Do not run two runs with the same project name at the same time: the one that finishes last overwrites the other's history.

The same keyword and domain, before and after:

Run 1 (first check, nothing to compare to):

```json
{ "keyword": "running shoes", "domain": "nike.com", "position": 8, "previousPosition": null, "change": null,
  "movement": "new", "bestPosition": 8, "worstPosition": 8, "checks": 1 }
```

Run 2 (next day, moved from 8 to 5):

```json
{ "keyword": "running shoes", "domain": "nike.com", "position": 5, "previousPosition": 8, "change": 3,
  "movement": "up", "bestPosition": 5, "worstPosition": 8, "checks": 2 }
```

`change` is positive when the domain moved up (8 to 5 = +3) and `null` when either side is not ranked. `movement` is one of:

| movement | meaning |
|---|---|
| `up` / `down` / `same` | ranked in both runs |
| `new` | ranked now, not ranked (or never checked) before |
| `lost` | ranked last run, not in the top maxDepth now |
| `not_ranked` | not in the top maxDepth in either run |
| `null` | the check failed (`status: "failed"`); history unchanged |

### Input example

If you leave both Keywords and Your domains empty, the Actor runs a quick demo instead: "running shoes" for nike.com vs adidas.com, top 10 only, saved under the project "demo".

```json
{
    "keywords": ["running shoes", "trail running shoes", "nike air max"],
    "targetDomains": ["nike.com"],
    "competitorDomains": ["adidas.com", "hoka.com"],
    "countryCode": "us",
    "languageCode": "en",
    "googleDomain": "google.com",
    "device": "desktop",
    "location": "Austin,Texas,United States",
    "maxDepth": 100,
    "projectName": "nike-us",
    "includeSerpFeatures": true
}
```

- **Domains** are normalized: `https://www.nike.com/w/` becomes `nike.com`. With **Match subdomains** on (default), `store.nike.com` counts as `nike.com`.
- **Location** takes a Google canonical name ("City,Region,Country") and is converted to Google's `uule` parameter. You can also pass a raw `uule`.
- Invalid input (bad domain, more than 1000 keywords, depth outside 10-100, unknown device) fails the run immediately, before anything is fetched or charged.

### Output example

One row per keyword x tracked domain:

```json
{
    "keyword": "running shoes",
    "domain": "nike.com",
    "isCompetitor": false,
    "position": 5,
    "previousPosition": 8,
    "change": 3,
    "status": "ranked",
    "movement": "up",
    "bestPosition": 5,
    "bestPositionDate": "2026-10-08T06:00:12.511Z",
    "worstPosition": 8,
    "worstPositionDate": "2026-10-07T06:00:10.203Z",
    "checks": 2,
    "url": "https://www.nike.com/w/running-shoes-37v7jzy7ok",
    "displayedUrl": "https://www.nike.com › running-shoes-37v7jzy7ok",
    "title": "Running Shoes. Nike.com",
    "countryCode": "us",
    "languageCode": "en",
    "device": "desktop",
    "location": null,
    "depthChecked": 10,
    "pagesFetched": 1,
    "serpFeatures": ["ads_top", "ai_overview", "people_also_ask", "local_pack", "shopping", "related_searches"],
    "totalResultsText": null,
    "topResults": [
        { "position": 1, "url": "https://www.nike.com/w/running-shoes-37v7jzy7ok", "domain": "nike.com", "title": "Running Shoes. Nike.com", "displayedUrl": "https://www.nike.com › running-shoes-37v7jzy7ok" },
        { "position": 2, "url": null, "domain": "runnersworld.com", "title": "The 15 Best Running Shoes of 2026", "displayedUrl": "https://www.runnersworld.com › ... › Running Shoes" },
        { "position": 3, "url": null, "domain": "roadrunnersports.com", "title": "Shop Men's Running Shoes", "displayedUrl": "https://www.roadrunnersports.com › Men's › Shoes" }
    ],
    "projectName": "nike-us",
    "checkedAt": "2026-10-08T06:00:12.511Z",
    "error": null
}
```

`status` is `ranked`, `not_ranked` (not in the top `depthChecked`), or `failed` (with `error` set).

About `url`: Google now often links results through opaque redirect links (`/goto?url=<token>`) that don't contain the target address. The domain is always taken from the displayed URL (`displayedUrl`, for example `https://www.nike.com › running-shoes-37v7jzy7ok`), so matching and positions are not affected. `url` is filled in only when the exact address can be recovered from the page. Otherwise it is `null` rather than a guess. `totalResultsText` is `null` when Google doesn't show a result count, which is the usual case now. `serpFeatures` lists what appeared on page 1: `ads_top`, `ads_bottom`, `featured_snippet`, `ai_overview`, `people_also_ask`, `local_pack`, `knowledge_panel`, `top_stories`, `videos`, `images`, `shopping`, `sitelinks`, `related_searches`.

The run's default key-value store also has:

- `SUMMARY`: counts of keywords, rows, ranked, improved, declined, new, lost and failed, plus pages fetched, pages saved by early stop, and events charged.
- `REPORT`: a plain-text table of movers (up, down, new, lost) and failed checks.

### Pricing

Pay per event. Dataset rows are free; you pay per Google result page parsed:

| Event | Price (FREE tier) | When |
|---|---|---|
| `keyword-checked` | $0.005 | Once per keyword whose first result page (top 10) was fetched and parsed. Not per domain: tracking 1 or 20 domains costs the same. |
| `extra-serp-page` | $0.004 | Once per additional page (results 11-20, 21-30, ...) that was fetched and parsed. |

Higher Apify Store tiers pay lower prices. Failed or blocked queries cost nothing, and neither do retries or pages that come back empty.

How early stop affects cost:

- **50 keywords daily, top 10 only (maxDepth 10):** 50 x $0.005 = **$0.25 per day**, about $7.50 per month.
- **maxDepth 100, and your domains are found on page 2:** $0.005 + $0.004 = **$0.009 per keyword**. Pages 3-10 are never fetched.
- **maxDepth 100, and a domain does not rank at all:** all 10 pages are fetched, $0.005 + 9 x $0.004 = **$0.041 per keyword**. If that happens often, lower maxDepth (for example to 30) to cap the cost. With 100 such keywords, maxDepth 30 costs $1.30 per run instead of $4.10.

Competitors count toward early stop: paging continues until every tracked domain is found or maxDepth is reached. A competitor that rarely ranks makes every keyword go to full depth.

If you set a maximum charge per run, the Actor checks the remaining budget before every keyword and page. When the budget runs out it stops cleanly, logs it, and lists the skipped keywords in `SUMMARY`. Skipped keywords are not charged.

### Scheduling it daily on Apify

1. Run the Actor once with your input and a project name (for example `acme-us-desktop`).
2. In the Apify Console, open **Schedules > Create new**, set a cron expression such as `0 6 * * *` (daily at 06:00 UTC), and add this Actor with the same input.
3. Each scheduled run compares against the previous one for that project. To get changes by email or Slack, add an integration or webhook on the Actor that reads `REPORT` or the dataset.

Keep the input the same between runs. Changing country, language, device or location creates new history entries; changing keywords or domains just adds or drops entries.

### Limitations

- **Google markup changes.** The parser uses several selector strategies and is tested against saved pages, but Google changes its HTML often. If a page can't be parsed, the row is marked `failed`, nothing is charged, and the first such page's HTML is saved to the run's key-value store as `DEBUG_FAILED_PARSE_HTML`.
- **Personalization and datacenter variance.** Requests are sent without cookies and with `pws=0`. Results can still differ between Google datacenters and from what you see in your own browser. Expect occasional 1-3 position swings that are not real changes.
- **Location accuracy.** `uule` locations are an approximation of a searcher in that city. Local results can differ from what a real user there would see.
- **Organic positions only.** Ads, People Also Ask, local pack, carousels, top stories and AI overview citations are not counted. A featured snippet counts as an organic result (usually position 1). `topResults` shows what was ranked, so you can check.
- **Depth.** Google often returns 8 or 9 organic results on a page instead of 10, so `depthChecked` (pages x 10) is a nominal value. Deeper pages (2 and beyond) are also less stable between requests than page 1.
- **Ranking URL.** See the note on `url` above: the exact landing page is sometimes unknown, but the domain and position are.

### FAQ

**Why is position null?** The domain was not in the top `depthChecked` results (`status: "not_ranked"`), or the check failed (`status: "failed"`, see `error`).

**Does tracking more domains cost more?** No. The keyword event is charged once per keyword. More domains can mean more pages, because early stop waits until all of them are found.

**What happens on a failed check?** The Actor retries up to 5 times with a new proxy session and backoff. If it still fails, the row has `status: "failed"` with the reason, nothing is charged, and the stored history for that keyword stays as it was.

**Can I track several sites?** Yes. Use a different project name per site or client. Each project has its own history.

**Where can I see the full history?** In the `rank-tracker-history` key-value store, under the project's key.

**Is `num=100` used?** No. Google ignores it (a test returned 8 organic results), so results are fetched 10 per page. Fetching page by page is also what makes early stop possible.

**Why is `url` null when `position` is set?** Google hid the target address behind a redirect token. The domain shown in `displayedUrl` was still matched, so the position is correct.

### Disclaimer

Independent tool. Not affiliated with, endorsed by, or sponsored by Google.

# Actor input Schema

## `keywords` (type: `array`):

Search queries to check, one per line. Up to 1000 per run. Whitespace is trimmed and duplicates (case-insensitive) are removed. If both Keywords and Your domains are empty, a quick demo check runs ("running shoes" for nike.com vs adidas.com, top 10).

## `targetDomains` (type: `array`):

Domains whose positions you want to track (1-10), e.g. example.com. Protocol, www. and paths are stripped. A result matches if its hostname equals the domain or is a subdomain of it (see "Match subdomains").

## `competitorDomains` (type: `array`):

Optional, up to 10. Tracked and output exactly like your domains, with isCompetitor: true. Paging stops once all your domains and competitors are found.

## `matchSubdomains` (type: `boolean`):

If on, store.example.com counts as example.com. If off, only example.com and www.example.com match.

## `countryCode` (type: `string`):

Two-letter country code passed to Google as gl, e.g. us, gb, de, in.

## `languageCode` (type: `string`):

Interface language passed to Google as hl, e.g. en, de, pt-BR.

## `googleDomain` (type: `string`):

Which Google domain to query, e.g. google.com, google.co.uk, google.de.

## `device` (type: `string`):

Desktop or mobile results. Mobile sends a mobile browser User-Agent.

## `location` (type: `string`):

City-level location as a Google canonical name, e.g. "Austin,Texas,United States". Converted to Google's uule parameter. Leave empty for country-level results.

## `uule` (type: `string`):

Advanced: a raw uule value starting with w+ (overrides Location).

## `maxDepth` (type: `integer`):

How deep to look, 10 to 100 in steps of 10. Results are fetched 10 per page and paging stops as soon as every tracked domain is found, so you only pay for pages actually fetched.

## `projectName` (type: `string`):

History is stored per project in the named key-value store "rank-tracker-history". Use one project per site or client. Runs with the same project name compare against each other.

## `resetHistory` (type: `boolean`):

Delete the stored history for this project and start over. Previous positions, best/worst and check counts are lost.

## `includeSerpFeatures` (type: `boolean`):

Add the list of SERP features seen on page 1 (ads, featured snippet, AI overview, People Also Ask, local pack, etc.) and the total results text to each row.

## `maxConcurrency` (type: `integer`):

How many keywords are checked in parallel.

## `debugSaveHtml` (type: `boolean`):

Save the HTML of every fetched result page to the run's default key-value store. For troubleshooting only.

## Actor input object example

```json
{
  "keywords": [
    "running shoes"
  ],
  "targetDomains": [
    "nike.com"
  ],
  "competitorDomains": [
    "adidas.com"
  ],
  "matchSubdomains": true,
  "countryCode": "us",
  "languageCode": "en",
  "googleDomain": "google.com",
  "device": "desktop",
  "maxDepth": 10,
  "projectName": "default",
  "resetHistory": false,
  "includeSerpFeatures": true,
  "maxConcurrency": 5,
  "debugSaveHtml": false
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `summary` (type: `string`):

No description

## `report` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "keywords": [
        "running shoes"
    ],
    "targetDomains": [
        "nike.com"
    ],
    "competitorDomains": [
        "adidas.com"
    ],
    "maxDepth": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("lasting_bonnethead/google-rank-tracker").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "keywords": ["running shoes"],
    "targetDomains": ["nike.com"],
    "competitorDomains": ["adidas.com"],
    "maxDepth": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("lasting_bonnethead/google-rank-tracker").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "keywords": [
    "running shoes"
  ],
  "targetDomains": [
    "nike.com"
  ],
  "competitorDomains": [
    "adidas.com"
  ],
  "maxDepth": 10
}' |
apify call lasting_bonnethead/google-rank-tracker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,lasting_bonnethead/google-rank-tracker"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/4uVNa098mjJnQJjYG/builds/Uose9GCz9fWbWzkeM/openapi.json
