n8n

How to Automate Gemini Ahrefs Keyword Reports?

Turn chat messages into clean keyword reports in seconds. Great for marketing and SEO teams that need fast keyword checks without leaving their chat window. It delivers a short, clear summary you can use for content planning right away.

A chat event starts the flow. An AI agent using Google Gemini reads the message, fixes spelling, and keeps only one keyword. The workflow sends that keyword to the Ahrefs Keyword Tool through RapidAPI to get search data. A code step pulls the main metrics and the top ten related terms, then an aggregate step organizes everything. A second AI agent formats the results into a readable brief. A simple memory keeps recent context so follow up questions feel natural. You can adjust the request node to hit other Ahrefs endpoints when you want different views.

You will need API access for Google Gemini and an active RapidAPI key for the Ahrefs Keyword Tool. Add your keys in n8n, review the system messages in the AI nodes, and confirm the query parameter uses the cleaned keyword. Expect manual research time to drop from half an hour to a few minutes. Useful for quick content briefs, campaign ideas, and on demand keyword validation during team chats.

What are the key features?

  • Chat based trigger that responds when a message arrives
  • AI agent with Google Gemini that extracts a single keyword and fixes typos
  • HTTP request to the Ahrefs keyword endpoint through RapidAPI
  • Code step that pulls the main metrics and the top ten related terms
  • Aggregate step that combines results into one clean payload
  • AI formatter that returns a readable summary ready to share
  • Short memory that keeps recent context for follow up questions

What are the benefits?

  • Reduce manual research from 30 minutes to 2 minutes
  • Automate 80% of keyword lookup and formatting
  • Improve input accuracy by forcing one clean keyword
  • Connect AI and keyword data without copy paste
  • Handle ten related keywords in one run

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n, click the three dots menu, select 'Import from File', then choose the downloaded JSON file
  2. You will need accounts with Google Gemini, RapidAPI and Ahrefs Keyword Tool. See the Tools Required section above for links to create accounts with these services.
  3. Open the Google Gemini model nodes and create credentials: double click the node, in the Credential to connect with menu choose Create new credential, then follow the on screen steps to add your Google API key. Name the credential clearly so your team can recognize it.
  4. Open the HTTP Request node for Ahrefs. In the headers section, paste your RapidAPI host and your RapidAPI key in the two header fields provided. Replace the placeholder values from the template with your live values.
  5. Confirm the request URL points to the Ahrefs global volume endpoint and the query parameter uses the cleaned keyword from the extractor output. The keyword field should map to the output of the extraction agent.
  6. Open the Keyword Query Extraction and Cleaning Agent. Review the system message so it always returns one keyword and corrects spelling. Adjust the instructions if your team wants a different style.
  7. Open the code step named Extract Main Keyword and 10 related Keyword data. Check the property names used to read the API response. If the API response structure is different in your plan, update the paths to match.
  8. Open the Keyword Data Response Formatter. Edit the system message to control tone, fields shown, and summary length. Keep the prompt simple for fast responses.
  9. Start a test chat from the chat trigger panel. Send a messy keyword and make sure the extraction agent returns one clean keyword. If it returns more than one term, tighten the system message.
  10. Run the workflow once and check the execution. Look for a successful status code on the request step and a data object with main and related terms in the code step output.
  11. If you see authentication errors, confirm your RapidAPI subscription is active and the key matches your account. If rate limits appear, add a small wait between requests or reduce test frequency.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Ahrefs Keyword Tool

Sign up

Free tier: $0 / mo, limited requests (per RapidAPI plan page)

Google Gemini

Sign up

Free tier: $0 via Gemini API; e.g., Gemini 2.5 Flash-Lite free limits 1,000 requests/day (15 RPM, 250k TPM). Paid from $0.10/1M input tokens and $0.40/1M output tokens.

RapidAPI

Sign up

Free APIs: $0 (platform supports free plans; typical cap 1,000 requests/hour and 500,000 requests / mo; quotas vary by API)

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.