How to Automate Keyword Research with n8n and the Google Search Console API
Keyword research is the cornerstone of every successful SEO strategy — but doing it manually is slow, repetitive, and doesn’t scale. In this tutorial, you’ll learn how to build a fully automated keyword research workflow using n8n and the Google Search Console (GSC) API, so you can surface high-value keyword opportunities on autopilot every week.
Why Automate Keyword Research?
Most SEO professionals spend hours each week pulling data from different tools, exporting CSV files, and manually filtering keyword lists. This process is not only time-consuming — it’s also prone to human error and inconsistency. By automating keyword research with n8n, you can:
- Automatically pull real search query data from your own site via GSC
- Filter keywords by impressions, clicks, and CTR thresholds
- Identify quick-win keywords ranking in positions 5–20
- Export results to Google Sheets or Notion for editorial review
- Schedule the workflow to run weekly without any manual intervention
What You’ll Need
- n8n (self-hosted or cloud) — the workflow automation backbone
- A Google Cloud project with the Search Console API enabled
- OAuth2 credentials for the GSC API
- A Google Sheet to store output data
- Optionally: OpenAI API for AI-powered keyword clustering
Step 1: Set Up Google Search Console API in n8n
Before building the workflow, you need to configure your Google OAuth2 credentials in n8n. Head to the Google Cloud Console, create a new project, and enable the Google Search Console API. Download the OAuth2 client credentials JSON file.
In n8n, navigate to Settings → Credentials → Add New → Google OAuth2 API. Paste in your Client ID and Client Secret, then authenticate with the Google account that has access to your Search Console properties.
GSC API Scopes Required
Make sure to request the following OAuth scope: https://www.googleapis.com/auth/webmasters.readonly. This gives n8n read access to your Search Console data without any write permissions.
Step 2: Build the n8n Keyword Research Workflow
Now let’s build the actual workflow. Here’s a breakdown of each node:
Node 1: Schedule Trigger
Use the Schedule Trigger node to run this workflow automatically every Monday at 8 AM. Set the interval to Weekly and choose your preferred time zone.
Node 2: HTTP Request — GSC Query Performance
Use an HTTP Request node to call the GSC API endpoint:
POST https://searchconsole.googleapis.com/webmasters/v3/sites/{siteUrl}/searchAnalytics/query
Set the request body to pull the last 28 days of query-level data:
{
"startDate": "{{$now.minus(28, 'days').toFormat('yyyy-MM-dd')}}",
"endDate": "{{$now.toFormat('yyyy-MM-dd')}}",
"dimensions": ["query", "page"],
"rowLimit": 5000,
"dataState": "all"
}
This returns every query that triggered an impression on your site over the past 28 days, including clicks, impressions, CTR, and average position.
Node 3: Filter — Quick-Win Keywords
Add a Filter node to isolate your highest-opportunity keywords. Apply the following conditions:
positionis between 5 and 20 (ranking on page 1/2 but not at the top)impressionsis greater than 100 (real search volume)clicksis less thanimpressions * 0.05(low CTR = opportunity to improve)
These are your quick-win keywords — terms where you already have some ranking traction but haven’t fully captured the traffic yet.
Node 4 (Optional): OpenAI — Keyword Clustering
To take this workflow to the next level, pipe the filtered keyword list into an OpenAI node and prompt it to cluster keywords by topic:
You are an SEO expert. Given the following list of search queries, group them into semantic topic clusters. For each cluster, suggest a content title and the primary keyword.
Keywords: {{$json.keywords}}
This gives you AI-generated topic clusters you can turn directly into content briefs or editorial calendar entries.
Node 5: Google Sheets — Append Rows
Finally, use the Google Sheets node to append all filtered keywords (and their clusters) to a spreadsheet. Map the columns: Query, Page, Clicks, Impressions, CTR, Position, Topic Cluster, Suggested Title.
Step 3: Schedule and Monitor the Workflow
Once your workflow is live, n8n will automatically pull fresh keyword data every week. Set up an error trigger node connected to a Slack or email notification so you’re alerted if the workflow fails for any reason (e.g., an expired OAuth token).
You can also add a second schedule to run a monthly version of this workflow that pulls 90-day data for longer trend analysis — just duplicate the workflow and adjust the date range in the GSC API node.
Pro Tips for Better Keyword Data
- Filter by branded vs. non-branded: Add a filter node that checks whether the query contains your brand name, and route the two streams separately.
- Segment by device: Add
"device"as a second dimension to see which keywords drive mobile vs. desktop traffic. - Cross-reference with a keyword tool: Use an HTTP node to hit the DataForSEO or SEMrush API and enrich each keyword with search volume and keyword difficulty scores.
- Set up Slack alerts for ranking drops: Add a second branch that checks if any top-10 keyword has dropped more than 3 positions week-over-week and sends a Slack alert.
Why This Workflow Saves Hours Every Week
A typical manual keyword research session takes 2–4 hours per site per week when you account for data export, filtering, clustering, and brief writing. With this n8n workflow, the entire process runs in under 3 minutes on a schedule — and the output lands directly in a shared Google Sheet that your whole content team can access.
At scale, if you manage 10 sites, that’s potentially 20–40 hours per week saved on keyword research alone. That’s time you can reinvest in content creation, link building, or strategy.
Next Steps
Once you have your keyword research workflow running, consider connecting it to your content brief generator workflow. Every keyword cluster that meets your criteria can automatically trigger the creation of a structured content brief in Google Docs or Notion — closing the loop from keyword discovery to content production without any manual steps in between.
If you’re building an SEO automation stack with n8n, this keyword research workflow is one of the highest-ROI automations you can build. Start with a single site, validate the output, then roll it out across your entire portfolio.
