Perform SEO keyword research insights with Ahrefs API and Gemi
This n8n workflow automates SEO keyword research by querying the Ahrefs API for keyword data and related keyword insights. The enriched data is then processe...
🔌 Nodes & Integrations Used (5)
📖 Implementation & Setup Guide
This n8n workflow automates **SEO keyword research** by querying the **Ahrefs API** for keyword data and related keyword insights. The enriched data is then processed by an AI agent to format a response and provide valuable SEO recommendations.
Perfect for **SEO specialists, content marketers, digital agencies**, and anyone looking to gain valuable insights into keyword opportunities to boost their rankings.
---
⚙️ How This Workflow Works
This workflow guides you through the entire SEO keyword research process, from entering the initial keyword to receiving detailed insights and related keyword suggestions.
1. 🗣️ User Input (Keyword Query) - The user enters a **keyword** they want to research. - This input is captured by the **Chat Input Node**, ready for analysis.
2. 🤖 AI Agent (Input Verification) - The AI Agent reviews the keyword input for any **grammatical errors** or extra commentary. - If necessary, it cleans the input to ensure a seamless query to the API.
3. 🔑 Ahrefs API (Keyword Data Retrieval) - The cleaned **keyword** is sent to the **Ahrefs Keyword Tool API**. - This retrieves a detailed report including metrics like **search volume**, **keyword difficulty**, and **CPC**.
4. 💡 Related Keywords Extraction (Using JavaScript Function) - The workflow uses a **JavaScript function** to extract main keyword data and **10 related keywords data** from the Ahrefs response. - You can tweak the script to adjust the number of related keywords or the level of detail you want.
5. 🧠 AI Agent (Text Formatting) - The aggregated data, including both the main keyword and related keywords, is sent to an **AI agent**. - The AI agent formats the data into a concise, readable format that can be shared with the user.
6. 📨 Final Response - The formatted text is delivered to the user with keyword insights, recommendations, and related keyword suggestions.
---
✅ Smart Retry & Error Handling
Each subworkflow includes a **fail-safe mechanism** to ensure:
- ✅ Proper error handling for any issues with the API request.
- 🕒 Failed API requests are retried after a **customizable period** (e.g., 2 hours or 1 day).
- 💬 **User input validation** prevents any incorrect or malformed queries from being processed.
---
📋 Ahrefs API Setup
To use this workflow, you’ll need to set up your Ahrefs API credentials:
🔑 Ahrefs API - Sign up for an Ahrefs account and get your key here: [Ahrefs Keyword Tool API](https://rapidapi.com/environmentn1t21r5/api/ahrefs-keyword-tool) - Once signed up, you'll receive an API key, which you’ll use in the `x-rapidapi-key` header in n8n. - Ensure you check the **Ahrefs Keyword Tool API documentation** for more details on available parameters.
---
📥 How to Import This Workflow
- Copy the json code.
- Open your n8n instance.
- Open a new workflow.
- Paste anywhere inside the workflow.
- Voila.
---
🛠️ Customization Options
- Adjust the **number of related keywords** extracted (default is 10).
- Customize the **AI agent response** formatting or add specific recommendations for users.
- Modify the JavaScript function to **extract different metrics** from the Ahrefs API.
---
🧪 Use Case Example
Trying to optimize your blog post around a specific keyword?
- Query a broad keyword, like **“SEO tips”**.
- Get related keyword data and **search volume insights**.
- Use the AI agent to provide **keyword recommendations** and additional topics to target.
- 💥 Boost your content strategy with fresh keywords and relevant search data!
⚡ How to import this workflow into n8n:
- Click the Direct Download JSON button above to save
Perform_SEO_keyword_research_insights_with_Ahrefs_API_and_Gemi.json. - Log in to your n8n Cloud or self-hosted n8n instance.
- In your workflow canvas, click the menu in top-right and select Import from File (or paste the JSON directly).
- Configure your credentials (e.g. API keys, database URLs) in the corresponding node settings.
- Click Execute Workflow to test and switch to Active!
Related AI Agents Workflows
View All in AI Agents →5 ways to process images PDFs with Gemini AI in n8n
How it works Many users have asked in the support forum about different methods to analyze images and PDF documents with Google Gemini AI in n8n. This workfl...
7 AI Sales Assistant
Production-ready n8n automation template for 7 AI Sales Assistant built by AhiXLight. Seamlessly connects Airtop Tool, Slack, Airtop with 24 configured nodes.
AAVE portfolio professional AI agent Telegram Email GPT 4o
A next-generation AI-powered DeFi health monitor that tracks wallet positions across Aave V3 using GPT-4o and LangChain. It delivers human-readable reports v...
Access control for AI agents RBAC using Airtable and Telegram
Purpose This workflow allows granular control over the access to tools connected to AI Agents (including Multi-Agent setups) using Role Based Access Control....