Track Google keyword rankings with Apify, OpenAI, Google Sheets and Gmail

Go to Workflow
14 views
Built by Dr. Firas Dr. Firas
Created on July 28, 2026

Description

Quick overview
This workflow runs daily to scrape Google SERPs for a list of keywords using Apify, logs ranking results to Google Sheets, generates an HTML SEO summary with OpenAI, and emails the report via Gmail.

How it works
Runs every day at 8 AM on a schedule.
Reads the configured keywords, target domain, locale settings, and report recipient, then splits the comma-separated keywords into individual items.
For each keyword, calls the Apify Google Search Scraper API to fetch the top organic Google results for the chosen country and language.
Extracts each result into ranking rows (date, keyword, position, title, URL, domain, description) and flags whether the result matches the target domain.
Appends the ranking rows to a Google Sheets spreadsheet to build a daily ranking history.
Aggregates all collected rankings and sends them to OpenAI to generate a concise HTML SEO report with your positions, top competitors, and prioritized opportunities.
Sends the HTML report to the configured recipient using Gmail.

Setup
Add an Apify API token (HTTP header auth) and select it in the Apify request step.
Add a Google Sheets OAuth connection, select the target spreadsheet and sheet tab, and ensure the sheet has columns for checked_at, keyword, rank, title, url, domain, description, and is_target_domain.
Add an OpenAI API key and select it for the OpenAI Chat Model used to generate the report.
Add a Gmail OAuth connection to send email, then set your keywords, target domain, country/language codes, results per keyword, OpenAI model, and recipient email in the Configuration step.

Additional info
Track keyword rankings on Google with Apify and send AI SEO reports by email
📥 Open full documentation on Notion

Need help customizing?
Contact me for consulting and support : Linkedin

MY NEW YOUTUBE CHANNEL
👉 Subscribe to my new YouTube channel. Here I'll share videos and Shorts with practical tutorials and FREE templates for n8n.

Nodes Used (6)

Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm
Code
n8n-nodes-base.code
Gmail
n8n-nodes-base.gmail
Google Sheets
n8n-nodes-base.googleSheets
HTTP Request
n8n-nodes-base.httpRequest
OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi