Build a SERP rank tracker with n8n featured image
|

How to Build a SERP Rank Tracker With n8n: Scheduled Positions, Sheets History, and Alerts

Rank tracking is the one SEO cost that scales badly. You start with a handful of keywords on a free plan, then the terms multiply, and suddenly you are paying a monthly subscription that is 90% features you never touch. If you have a focused set of keywords and you are already running n8n for other SEO jobs, you can build a rank tracker that costs only what the SERP API charges per lookup — and, more importantly, that hands you a clean historical dataset you actually own.

This is a build guide, not a pitch. A self-hosted n8n rank tracker is the right tool if you are tracking dozens to a few hundred keywords, want the raw position history in your own Google Sheet, and can live with checking rankings daily rather than hourly. It is the wrong tool if you need thousands of keywords across many locations and devices, with SERP-feature and share-of-voice tracking — at that scale a managed platform wins on both reliability and, counterintuitively, cost. The section below makes that trade-off explicit before you build anything.

When a DIY n8n rank tracker actually makes sense

The decision comes down to volume, granularity, and how much operational babysitting you are willing to do. Here is the honest comparison I use before recommending anyone build this instead of buying it.

Dimension DIY n8n + SERP API Managed rank tracker
Best keyword volume ~20–300 keywords, checked daily Thousands, checked daily or hourly
Cost model Pay per SERP lookup (often $0.001–$0.003 each) Flat monthly tiers, priced per keyword bucket
Location & device granularity Whatever the API param supports; you wire it yourself Point-and-click city/device targeting
SERP features (PAA, packs, AI overviews) Only if you parse them out yourself Tracked and visualized out of the box
Data ownership & history Full: rows in your own Sheet or database Locked in the vendor; export on their terms
Maintenance burden You own retries, throttling, and parser drift Vendor absorbs it

If most of that table lands on the left column for your situation, keep reading. If it lands on the right, save yourself the maintenance and buy the tool — and if you are weighing which SERP data source to feed either approach, the breakdown in our guide to cheaper SEMrush API alternatives for automated rank tracking is the place to start.

What you need before you build

Three pieces: an n8n instance (self-hosted or cloud), a SERP API that returns organic results as JSON, and a Google Sheet with two tabs — one holding your keyword list, one that will accumulate daily positions. Keep the keyword sheet dead simple: a column for the query, a column for the target URL or domain you expect to rank, and optional columns for country and device. The tracker reads that list every run, so adding or pausing a keyword is a spreadsheet edit, not a workflow change.

Building the workflow step by step

The whole thing is six nodes. It reads keywords, asks the SERP API where each one ranks, finds your URL in the results, and writes a dated row per keyword. Here is what each node does and the decisions that matter.

1. Schedule Trigger — pick a stable time, not midnight

Use the Schedule Trigger node with a cron expression that fires once a day at a quiet, consistent hour in a fixed timezone. Consistency matters more than the exact time: rankings drift through the day, so comparing a 6 a.m. reading to yesterday’s 6 a.m. reading is apples to apples, while a run that slides around the clock adds noise you will mistake for movement. Avoid the top of the hour and midnight, where shared schedulers and your other jobs pile up. If you run several n8n SEO jobs, the patterns in our guide to scheduling n8n SEO workflows without overlapping runs keep them from colliding.

2. Read the keyword list from Google Sheets

A Google Sheets node in “Read Rows” mode pulls the keyword tab into the workflow, one item per keyword. Because the list lives in the sheet, you never redeploy the workflow to change what you track — a client can add keywords themselves. Return the query, expected URL, country, and device columns so the next node has everything it needs.

3. Query the SERP API

An HTTP Request node runs once per keyword, passing the query plus your location and device parameters. Set it to continue on failure so a single bad response does not abort the entire run, and add a small “Wait” node or batch the requests if your API enforces a rate limit. Ask for enough results to cover where you realistically rank — if you are tracking a term sitting on page two, requesting only the top ten guarantees a “not found” every day.

4. Find your position with a Code node

The API returns an ordered array of organic results. A short Function/Code node loops that array, matches the result whose URL contains your domain (normalize by stripping protocol and www), and records the 1-based index as the position. If no match appears in the returned set, write a sentinel like >100 or blank rather than zero — zero will wreck any average you chart later. This node is also where you can capture the ranking URL, which is how you catch the classic problem of the wrong page ranking for your target term.

5. Append a dated row per keyword

A second Google Sheets node in “Append” mode writes one row per keyword per run: date, query, position, ranking URL, country, device. Appending — rather than overwriting — is the whole point. Over weeks you accumulate a time series you can pivot, chart, or feed into a decay check. This is the data ownership the managed tools charge you to rent back.

6. Alert only on moves that matter

Wire an IF node before a Slack or email node so you are pinged only when something meaningful happens: a keyword drops more than, say, five positions versus the previous reading, falls off page one, or newly enters the top three. A tracker that messages you every morning with a full table gets muted within a week. A tracker that stays silent until a money keyword slips is one you will actually trust. Compute the delta by reading the previous run’s value or by keeping a “latest position” column you update in place.

The cost math, worked out

Say you track 150 keywords once a day. That is 150 SERP lookups × 30 days = 4,500 lookups a month. At a representative $0.002 per lookup, that is about $9 a month — and much of that volume often fits inside an API free tier. A comparable managed plan tracking 150 keywords daily typically runs $20–$50 a month once you need daily updates and history. The DIY route wins clearly at this scale. Now flip it: 3,000 keywords daily is 90,000 lookups a month. Even at $0.002 that is $180, before you have built any of the SERP-feature tracking a managed tool includes — and this is exactly where buying beats building. The crossover is not a fixed number, but for most focused sites it sits somewhere in the low hundreds of keywords.

Pitfalls that quietly corrupt rank data

Localization drift. Rankings depend on location and language. If you do not pin the country and language parameters, the API may default to a data center that has nothing to do with your audience, and your positions will wobble for no real reason. Set them explicitly and keep them constant.

Personalization and device. There is no single “the ranking.” Mobile and desktop differ; logged-in personalization differs again. Pick mobile or desktop deliberately, track them as separate rows, and never mix them in one average.

Pagination blind spots. Requesting only the top ten hides everything on page two, so a keyword climbing from position 19 to 12 looks like a flat “not found” both days. Pull at least the top 30–50 for terms that are not yet on page one.

Throttling and partial runs. Hammer the API and you will get rate-limited mid-run, leaving a day with half the keywords blank. Batch the requests, add a wait, and set the HTTP node to continue on failure so one error does not void the whole day. If you want reporting on top of this raw history, the Search Console to weekly digest pipeline pairs cleanly with the sheet this workflow produces.

Frequently asked questions

Do I need to know how to code to build this?

Almost none. Five of the six nodes are configured through n8n’s UI. Only the position-finding step uses a short Code node, and it is a simple loop over the results array — a few lines you can adapt from the API’s own response example.

Can I use Google Search Console instead of a SERP API?

Not for true rank tracking. Search Console reports your average position for queries you already receive impressions on, which is useful but lags and only covers terms Google already shows you for. A SERP API checks the live results page for any keyword you choose, including ones you do not yet rank for. They answer different questions; many teams run both.

How often should the workflow run?

Once a day is right for almost everyone. Intraday rankings fluctuate enough that hourly checks mostly add noise and cost. Daily at a fixed hour gives you a clean, comparable trend line.

Will this get my API key blocked?

Not if you use a legitimate SERP API with your own key and stay inside its rate limits. The block risk comes from scraping Google directly, which this design deliberately avoids by going through an API built to return SERP data.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *