Automating a weekly SEO report with n8n and the Google Search Console API
Published 24 July 2026 · 5 min read
Checking Search Console by hand every Monday — opening the interface, comparing clicks against the previous week, spotting the pages that dropped — takes ten minutes per site. Multiply that across several clients or projects, and it quickly becomes exactly the kind of repetitive task automation is supposed to eliminate first. The Google Search Console API exposes the same data as the interface, and n8n can query it, compare week over week, distill a readable summary, and deliver it straight to Slack or email — no browser required.
Why move on from manual SEO reporting
A manual SEO report suffers from three concrete limits: it only gets produced when someone remembers to do it, it rarely compares more than two periods at once, and it triggers no alert between two checks — a page that drops out of the top 3 on a Tuesday can lose most of its traffic before anyone notices the following Monday. An automated workflow fixes all three at once: guaranteed execution on a weekly cron, systematic variation calculations, and the option to add alert thresholds independent of the summary report.
Connecting n8n to the Google Search Console API
The Search Console API has no dedicated node in n8n: it's driven with the HTTP Request node, authenticated via a Google OAuth2 API credential (the same credential type used for Sheets or Drive). Setup takes three steps:
- In Google Cloud Console, enable the "Search Console API" on the project, then create OAuth 2.0 credentials (Web Application type), using the redirect URL n8n provides on the credential setup screen.
- In n8n, create a Google OAuth2 API credential, paste in the Client ID and Client Secret, and add the scope
https://www.googleapis.com/auth/webmasters.readonly(read-only — sufficient for a report). - Run the OAuth authorization once: n8n stores the refresh token and automatically renews the access token on every subsequent cron run.
Once set up, this credential is reusable by every HTTP Request node calling the API — including a possible companion workflow tracking indexing status alongside the click report.
Querying searchanalytics.query for two periods
The heart of the workflow is a POST call to https://www.googleapis.com/webmasters/v3/sites/{encoded siteUrl}/searchAnalytics/query, with a JSON body specifying the desired dimensions:
{
"startDate": "2026-07-13",
"endDate": "2026-07-19",
"dimensions": ["query", "page"],
"rowLimit": 500
}
To compute a variation, the workflow calls this endpoint twice: once for the last 7 days, once for the 7 days before that (same dimensions, dates shifted a week back). A Set node upstream, fed by $now.minus({days: 7}) and similar expressions, generates the four date boundaries dynamically on every cron run instead of hardcoding them — so the workflow keeps working indefinitely without maintenance.
Search Console enforces a 50,000-row-per-request cap and a rolling 10-minute quota window: comfortably enough for a weekly report on one site, even with the page dimension enabled alongside query.
Computing variations with a Code node
The two result sets (current week, previous week) arrive as rows of { keys: [query, page], clicks, impressions, ctr, position }. A Code node merges them on the query + page key, then computes the click and position variation for each row:
- Sort by the biggest absolute click drop — these are the pages worth checking (a competitor's content moved up, a shift in search intent, a technical issue).
- Isolate the keywords that gained or lost the top 3 spots: that's where most clicks are captured. A landmark eye-tracking study, Granka, Joachims and Gay (2004), shows that users' visual attention on a results page concentrates very heavily on the very first links — which is why dropping from position 2 to position 5 costs far more traffic than dropping from position 15 to 20, at comparable impression volume.
- Keep only the top 10 gains and top 10 drops in the final report, rather than 500 raw rows — an unreadable report is never read.
Summarizing trends in plain language with AI
An AI node (Anthropic or OpenAI) then turns that table of numbers into two or three paragraphs of summary: pages trending up, pages to watch, a plausible hypothesis when a pattern shows up (several pages from the same category dropping the same day, for instance). The prompt stays deliberately constrained — explicitly asking it to comment only on the supplied figures, without extrapolating unverifiable external causes — to avoid false certainty in a report that will be read as-is. This step follows the same principle as the AI-generated audit summary report in the Compliance & Audit Pack: structured data in, constrained summary out, never the reverse.
Distributing and archiving the report
The report then goes out through whichever channel fits the team: a formatted Slack message (the same pattern as the daily email digest in the Inbox AI Pack, here on a weekly rather than daily cron) or an HTML email for an external client. Either way, it's worth archiving every report — AI summary included — into a Supabase table before sending: that lets you reconstruct a trend history across several months and pinpoint exactly when a drop actually started, following the same logging pattern described in our audit trail with Supabase article.
Going further: alerts independent of the weekly report
The variation calculation can also feed a second, more reactive trigger: if a page flagged as strategic (a watch-list stored in Supabase or Google Sheets) drops out of the top 3 between two daily checks, an immediate Slack message goes out without waiting for Monday's report. It's the same threshold logic as error monitoring — see our guide on error handling and the Error Workflow — applied here to a business metric instead of a technical failure.
Common pitfalls
- Confusing the Search Console property with the domain shown in the browser: a URL-prefix property (
https://www.example.com/) and a domain property (sc-domain:example.com) don't return exactly the same data; check which one is configured before interpreting a discrepancy. - Forgetting the data freshness lag: Search Console reports data with a 2-3 day delay. Setting
endDateto the day before rather than the current day avoids pulling truncated or empty rows for the most recent days. - Too many dimensions at once: adding
countryordeviceon top ofqueryandpagequickly multiplies the row count and complicates the variation calculation; start with two dimensions and refine only when a specific need arises. - An unreadable report for lack of sorting: sending 500 raw rows instead of a sorted top 10 turns an actionable report into a file that gets opened and closed without being read.
Going further
The underlying principle — structured data in, variation calculation in a Code node, AI-constrained summary, archiving, and alerting — is exactly what powers the reporting workflows in the Compliance & Audit Pack (€149), built to turn raw data into a readable report without a dedicated human review team. If your reports need to cross multiple sources (Search Console, ticketing, CRM), our guide on connecting Claude or GPT to n8n covers the AI credential setup that feeds the summary step described here.
FAQ
Frequently asked questions
Do I need to be a verified owner of the Search Console property to use the API?
Yes, or at minimum have Full or Restricted access delegated by the owner in Search Console. The API doesn't open any additional access: it exposes exactly the same data and permissions as the web interface, through the Google account authenticated in the OAuth2 credential.
What's the real limit on the searchanalytics.query API?
The API caps out at 50,000 rows per request, with a 10-minute rolling quota window. For a weekly report on a single site, those limits are very generous — they only start to matter if you're querying dozens of properties in the same workflow, or requesting the page dimension on a site with hundreds of thousands of URLs.
Can I track multiple sites in the same n8n workflow?
Yes: the queried property is just a parameter in the API URL (an encoded siteUrl). A Loop Over Items node iterating over a list of domains, each using the same OAuth2 credential (if they belong to the same Google account), lets you build a consolidated multi-site report without duplicating the workflow.
Does the OAuth2 token expire mid-execution?
No, if you use n8n's native Google OAuth2 API credential: the refresh token is stored once during the initial authorization, and n8n automatically renews the access token before every call. No manual intervention is needed unless access is revoked on the Google account side.
Bundle FlowKit Complet
€269