Paying high monthly fees for SEO rank tracking tools can be frustrating, especially when you feel like you’re renting your own data. What if you could build your own automated, reliable keyword rank tracker that saves data to a Google Sheet that you own and control?
With n8n, you can. This guide will walk you through every step of building a workflow that automatically checks your Google rankings for a list of keywords and logs the performance over time.
Choosing Your SERP API: Speed and Affordability
To get Google search results programmatically, you need a SERP (Search Engine Results Page) API. While there are many options, we need one that is fast, reliable, and affordable (or free) to get started.
- Serper.dev: This will be our tool of choice for this tutorial. It’s incredibly fast and offers a generous free plan of 2,500 queries per month. This is enough to track over 80 keywords daily, making it the perfect foundation for our project.
- ScrapingBee: Another excellent option with a solid free tier and robust features for more complex scraping tasks.
- DataForSEO: A great pay-per-use option for when you need to track keywords at a massive scale.
We’re focusing on Serper.dev because its combination of speed and a straightforward free plan is unbeatable for this use case.
The Workflow Blueprint: From Keywords to a Chart
Here’s the plan for the n8n workflow we will build:
- Google Sheet (Input): The workflow will start by reading a list of keywords and your target domain from a Google Sheet.
- Loop: It will then process this list one keyword at a time.
- HTTP Request: For each keyword, it will call the Serper.dev API to get the current Google search results.
- Data Parsing: A custom function will parse the results to find the ranking position of your domain. If your domain isn’t in the top 100, it will be marked as 101 to indicate it’s not ranking.
- Timestamp: The current date will be added to each result.
- Google Sheet (Output): Finally, the workflow will append a new row to a separate sheet with the Date, Keyword, and its Rank for that day.
Step-by-Step Implementation Guide
Part A: Set Up Your Google Sheet
First, create a new Google Sheet. Name it something like “n8n Rank Tracker.”
-
Create an ‘Input’ Sheet:
- In the first sheet (rename it “Input”), create two columns:
KeywordandDomain. - Populate it with the keywords you want to track and the domain you’re tracking them for.
- In the first sheet (rename it “Input”), create two columns:
-
Create an ‘Output’ Sheet:
- Create a second sheet and rename it “Output”.
- Create three columns:
Date,Keyword, andRank. This is where n8n will log the results.
Part B: Get Your Serper.dev API Key
- Go to Serper.dev and sign up for a free account.
- Once logged in, navigate to your dashboard to find your API key. Copy it.
Part C: Build the Workflow in n8n
(This section in the final article will include detailed screenshots for clarity.)
-
Google Sheets Node (Read):
- Start with a Google Sheets node.
- Authenticate your Google account.
- Set the Operation to Read.
- Select your “n8n Rank Tracker” spreadsheet and the “Input” sheet.
-
Split in Batches Node:
- Add a “Split in Batches” node.
- Leave the Batch Size set to
1. This will ensure the workflow processes one keyword at a time.
-
HTTP Request Node (Call Serper.dev):
- URL:
https://google.serper.dev/search - Method:
POST - Send Headers: Add a header named
X-API-KEYwith your Serper.dev API key as the value. Add another headerContent-Typewith the valueapplication/json. - JSON Body:
{ "q": "{{ $json.Keyword }}" }
- URL:
-
Function Node (Parse Rank):
- This is where the magic happens. This code finds your domain in the API results.
const results = $input.item.json.organic; const domainToFind = $('Split in Batches').item.json.Domain; let rank = 101; // Default if not found for (let i = 0; i < results.length; i++) { if (results[i].link.includes(domainToFind)) { rank = results[i].position; break; } } return { keyword: $('Split in Batches').item.json.Keyword, rank: rank, date: new Date().toISOString().split('T')[0] // Format as YYYY-MM-DD }; -
Google Sheets Node (Append):
- Add a final Google Sheets node.
- Set the Operation to Append.
- Select the same spreadsheet, but this time choose the “Output” sheet.
- Map the fields from the “Parse Rank” node to the columns:
Date->date,Keyword->keyword,Rank->rank.
Part D: Visualize Your Data
The best part of logging to Google Sheets is the ability to create simple, powerful visualizations.
- In your “Output” sheet, select all the data.
- Go to Insert > Pivot Table.
- Set it up with:
- Rows:
Date - Columns:
Keyword - Values:
Rank
- Rows:
- Now, select the pivot table data and go to Insert > Chart to create a line chart. This chart will dynamically update each day as n8n adds new data, giving you a clear visual history of your SEO performance.
Conclusion: Own Your SEO Data
You’ve just built a powerful, automated keyword rank tracker that saves you money and gives you complete ownership of your historical SEO data. This is the power of combining n8n with best-in-class APIs.
You can now easily expand this workflow to:
- Track keywords for multiple domains.
- Add your competitors’ domains to see how you stack up.
- Set up alerts in Slack to notify you if a high-priority keyword drops more than 5 positions.
If you want to explore more advanced SEO automations, contact us at Marden SEO. We specialize in creating custom workflows that give you a competitive edge.
Related reading
Want this built for you?
We design and ship production n8n automation for agencies, and train your team to own it.
Book a build →