Automated SEO Competitor Analysis and Google Sheets Logging - n8n Workflow

Automate SEO competitor research using an n8n workflow. Capture domain input, query RapidAPI, and log detailed organic keywords and competitor data directly to Google Sheets.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

SEO Specialists who need automated data logging for competitive analysis.
Marketing Analysts looking for reliable n8n templates to monitor organic search performance.
Businesses requiring a structured logging solution for high-volume API data extraction.
n8n users interested in conditional logic and API integration using the http request n8n node.

Overview

This powerful automation solution simplifies the tedious process of gathering competitor SEO data. The user initiates the process via a simple web form, providing the target domain. The n8n workflow then securely communicates with a specialized competitor analysis API via RapidAPI. A crucial feature of this n8n workflow is its robust error handling: it uses conditional logic to verify that all necessary data points (like organic competitors and keywords) are actually returned by the API. If the data is complete, it is logged immediately to a designated Google Sheet. If data is missing, the n8n workflow intelligently logs an error entry, ensuring your data sheet remains a complete record of all attempts, including successes and failures. This specific n8n template helps maintain data integrity and workflow pacing by including a wait n8n node in the failure path.

How it Works

The process is initiated by the On form submission n8n trigger:


  1. Form Submission: A user submits a domain via the internal formTrigger n8n node.

  2. Domain Storage: The Global Storage n8n node captures the domain input and saves it for subsequent API calls.

  3. API Request: The Competitor Analysis Request n8n node sends a POST request to the RapidAPI endpoint, querying for broad SEO metrics related to the provided domain.

  4. Conditional Check: The If n8n node evaluates the API response. It specifically checks if the JSON output fields for organic competitors, organic pages, and search keywords are populated.

  5. Success Path (True): If all key data fields are present, the data proceeds directly to the first Google Sheets n8n node, where the detailed competitor metrics are appended to the spreadsheet.

  6. Failure Path (False): If the conditional check fails (data missing), the execution moves to the Wait n8n node, introducing a 5-second delay. Following the delay, the second Google Sheets1 n8n node runs, logging the original domain and inserting "Not data found." into all metric columns, ensuring comprehensive logging coverage in your n8n workflow.

Installation Guide

To install and run this n8n template, follow these steps:


  1. Import Workflow: Copy the provided JSON code and paste it into your n8n instance using the "New" -> "Import from JSON" option.

  2. RapidAPI Configuration: Locate the Competitor Analysis Request n8n node. Update the header parameters with your actual RapidAPI Host and RapidAPI Key.

  3. Google Sheets Credentials: The n8n workflow uses two Google Sheets nodes. You must set up a Service Account credential for Google Sheets API access.

* Credential Setup: Ensure your Service Account credential (referenced as 'Google Sheets account 3' in the provided n8n workflow) has access to the target Google Sheet.

  1. Google Sheet Setup: In both Google Sheets n8n nodes, replace the placeholder Document ID with the ID of your target spreadsheet where the competitor analysis data will be logged.

  2. Activate Trigger: Activate the n8n workflow by ensuring the On form submission n8n trigger is enabled. Share the webhook URL/form link with relevant users.

Node Details

On form submission (Form Trigger): Functions as the starting n8n trigger, collecting the essential Website domain input from a user-friendly form interface.
Global Storage (Set n8n node): Stores the user-provided Website domain value securely for dynamic use across subsequent n8n nodes, specifically mapping it as website.
Competitor Analysis Request (HTTP Request n8n node): Executes a POST request to a RapidAPI endpoint for competitor data. Key Configuration includes setting the URL (competitor.php) and injecting required x-rapidapi-key and website payload parameters.
If (n8n node): Implements crucial conditional logic. It checks four conditions to ensure the API response contains valid, non-empty arrays for organicCompetitors, organicPages, and domainOrganicSearchKeywords before proceeding to data logging.
Google Sheets (Append Operation): (Connected to True output). Logs successful, structured SEO data (Organic Pages, Competitors, Keywords) pulled directly from the API response body into the designated spreadsheet. This is a critical step in the n8n template.
Wait (n8n node): Used in the failure path (False output) to introduce a 5-second delay. This controls the flow and helps prevent hitting rate limits immediately upon successive failures.


  • Google Sheets1 (Append Operation): (Connected after Wait). Logs error records when data is missing, inserting the original Domain but providing "Not data found." for the metric columns, maintaining consistency in the n8n workflow records.

Related n8n Workflows

Free

Nodes: 7 Nodes
Updated: December 26 2025
View all
Created by
Evoort Solutions
Evoort Solutions

Featured*