π Track Google keyword rankings with Apify, OpenAI, Google Sheets and Gmail
β‘ 1,830 views Β· π Market Research & Insights
π‘ Pro Tip β HTTP Request scraping tends to break when sites update their markup. If youβre scraping a major platform, check if ScraperNode covers it β it has maintained scrapers for LinkedIn, Instagram, TikTok, YouTube, and 20+ other platforms that return structured data.
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
Google Sheets, HTTP Request, Gmail, Schedule Trigger, Basic LLM Chain, OpenAI Chat Model
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File
