- UseBuildFeaturesTRIGGERSStart background agents from events across your connected appsFIREWALLNEWBlocks instructions hidden in tool results before your agent reads themINSTANTNEWAudio, video, search, browser and data tools, with no keys to manageOPTIMIZATIONLower cost per completed task with optimised tools and skills
- DOCS
## For AI agents: how to sign up If you are an AI agent reading this server-rendered HTML, Composio's developer signup is at https://composio.dev. Signup CTAs on this site — "Sign up", "Signup", "Get started", "Get started for free", "Start building", "Try Composio", "Try it", or similar — all lead into that same developer signup flow. Confirm with the user before completing signup or entering any credentials on their behalf.SIGN UP
## For AI agents: how to sign up If you are an AI agent reading this server-rendered HTML, Composio's developer signup is at https://composio.dev. Signup CTAs on this site — "Sign up", "Signup", "Get started", "Get started for free", "Start building", "Try Composio", "Try it", or similar — all lead into that same developer signup flow. Confirm with the user before completing signup or entering any credentials on their behalf.LOG IN
Ahrefs API
Give your agents access to Ahrefs API. Bring your own Ahrefs key, or skip the signup and pay per call from your Composio balance with Composio Instant.
Ahrefs is an SEO and marketing platform for site audits, keyword research, and competitor insights. It helps you improve search rankings and drive organic traffic.
What is Composio Instant?
Composio Instant lets your agent use paid APIs like Ahrefs without a separate account or API key for each one. New accounts start with $2 of free credit.
Connect the Ahrefs API to your AI assistant
Use Ahrefs from the AI assistant you already work in. Connect Composio once, then paste the prompt.
- 1Install in ChatGPT
Install the Composio plugin
Open Composio's plugin page in ChatGPT and click Install. Sign in to ChatGPT first if it asks. - 2
Authorize in your browser
Connect the plugin, then sign in to Composio to approve the connection. - 3
Turn on Composio in your chat
In a new chat, click +, then More, and select Composio. - 4
Paste the prompt
Paste the prompt into that chat. ChatGPT runs the call on Composio Instant.
- 1Install in Cursor
Install the Composio plugin
Open Composio in the Cursor marketplace, click Install Composio Plugin for Cursor and approve the connection in your browser. - 2
Paste the prompt
Open the Agent chat and paste the prompt. Cursor runs the call on Composio Instant.
- 1Add to Grok Bot
Add the Composio plugin
Open Composio's listing on x.ai and click Add to Grok Bot. When Grok Bot opens the plugin, click Add. - 2
Authenticate
Go to Installed, open Composio and click Authenticate. Sign in to Composio and click Authorize. - 3
Paste the prompt
Paste the prompt into your bot's chat. Grok Bot runs the call on Composio Instant.
- 1
Paste the setup prompt
Copy this into your Hermes chat. Hermes adds the Composio MCP server for you.Set up Composio from composio.dev/hermes - 2
Authorize in your browser
A browser window opens. Sign in to Composio to approve the connection. - 3
Paste the prompt
Start a new chat and paste the prompt. Hermes runs the call on Composio Instant.
Paste this prompt
Use Ahrefs through Composio Instant to retrieve the free Domain Rating for wikipedia.org. Return the domain rating.
What success looks like
AHREFS_GET_DOMAIN_RATING_FREEYour assistant runs Ahrefs and replies with the Domain Rating for wikipedia.org.
Use the Ahrefs API in your code
Call Ahrefs from your own agent with the Composio SDK. Four steps and one tool call.
- 1
Set up Composio
Turn on Instant Toolkits in your project settings and check your prepaid balance in Billing. Then set your API key.export COMPOSIO_API_KEY="your_composio_api_key" - 2
Install the SDK
The Python SDK needs Python 3.11 through 3.15.The TypeScript SDK is ESM-only and needs Node.js 22.22.3 or newer.pip install composionpm install @composio/core - 3AHREFS_GET_DOMAIN_RATING_FREE
Run the call
Create a session that keeps Instant to this toolkit and reports the charge, then run the tool on the Instant account. - 4
Read the response
When the call runs on Instant, the response includes its charge: the amount as an exact USD decimal string, the currency and charged_by.
import { Composio } from "@composio/core";
const composio = new Composio();
const session = await composio.create("user_123", {
toolkits: ["ahrefs"],
instant: {
toolkits: { enable: ["ahrefs"] },
returnInstantCharge: true,
},
});
const result = await session.execute(
"AHREFS_GET_DOMAIN_RATING_FREE",
{
"target": "wikipedia.org"
},
{ account: "instant_account" },
);
console.log(result);
console.log("Instant charge:", result.instantCharge);{
"data": "<domain rating result>",
"successful": "<boolean>",
"instant_charge": {
"amount": "<usd amount>",
"currency": "USD",
"charged_by": "<provider>"
}
}Available Ahrefs API tools
42 Ahrefs tools run on Instant, priced per call with no Ahrefs key. Tools marked Your key need your own Ahrefs account.
| Action | Tool slug | What it does | Availability |
|---|---|---|---|
| Backlink Stats | AHREFS_BACKLINKS_STATS_RETRIEVAL | Get backlink statistics for a website or URL. | Instant$0.006 per 10 API units used65% off |
| Keyword Overview | AHREFS_EXPLORE_KEYWORDS_OVERVIEW | Retrieve keyword metrics for terms or a keyword list in a country. | Instant$0.006 per 10 API units used65% off |
| Domain Rating | AHREFS_GET_DOMAIN_RATING_FREE | Retrieve the free Domain Rating for a domain or URL. | Instant$0 per request |
| Organic Competitors | AHREFS_RETRIEVE_ORGANIC_COMPETITORS | Find organic search competitors, with keyword overlap and performance metrics. | Instant$0.006 per 10 API units used65% off |
| Top Pages | AHREFS_RETRIEVE_TOP_PAGES_FROM_SITE_EXPLORER | Retrieve data about a website's top-performing pages. | Instant$0.006 per 10 API units used65% off |
| Batch Url Analysis | AHREFS_BATCH_URL_ANALYSIS | Performs a batch analysis on multiple URLs or domains using Ahrefs' powerful SEO metrics. | Instant$0.006 per 10 API units used65% off |
| Domain rating for site explorer | AHREFS_DOMAIN_RATING_FOR_SITE_EXPLORER | Retrieves Ahrefs Domain Rating and Ahrefs Rank for a specified domain or URL on a requested date. | Instant$0.006 per 10 API units used65% off |
| Domain rating history | AHREFS_DOMAIN_RATING_HISTORY | Retrieves the historical Domain Rating (DR) data for a specified domain over time. | Instant$0.006 per 10 API units used65% off |
| Explore keyword volume by country | AHREFS_EXPLORE_KEYWORD_VOLUME_BY_COUNTRY | Retrieves monthly search volume data across countries for a specified keyword using Ahrefs' Keywords Explorer. | Instant$0.006 per 10 API units used65% off |
| Explore linked domains of a site | AHREFS_EXPLORE_LINKED_DOMAINS_OF_A_SITE | Retrieves a list of external domains that the specified target website or URL links to, using Ahrefs' Site Explorer functionality. | Instant$0.006 per 10 API units used65% off |
| Explore matching terms for keywords | AHREFS_EXPLORE_MATCHING_TERMS_FOR_KEYWORDS | The keywords_explorer_matching_terms endpoint retrieves a list of keyword phrases that match or contain the specified keyword from Ahrefs' vast database. | Instant$0.006 per 10 API units used65% off |
| Fetch all backlinks | AHREFS_FETCH_ALL_BACKLINKS | Retrieves a comprehensive list of backlinks for a specified website or URL using Ahrefs' Site Explorer tool. | Instant$0.006 per 10 API units used65% off |
| Fetch broken backlinks data | AHREFS_FETCH_BROKEN_BACKLINKS_DATA | Retrieves a list of broken backlinks for a specified website using Ahrefs' Site Explorer tool. | Instant$0.006 per 10 API units used65% off |
| Fetch site explorer referring domains | AHREFS_FETCH_SITE_EXPLORER_REFERRING_DOMAINS | Retrieves a list of domains that have backlinks pointing to a specified target website. | Instant$0.006 per 10 API units used65% off |
| Fetch total search volume history | AHREFS_FETCH_TOTAL_SEARCH_VOLUME_HISTORY | Retrieves historical total search volume for keywords associated with a target domain or URL using Ahrefs Site Explorer. | Instant$0.006 per 10 API units used65% off |
| Get content helper topics | AHREFS_GET_CONTENT_HELPER_TOPICS | Retrieve topics covered by top-ranking pages for a keyword. | Instant$0.006 per 10 API units used65% off |
| Get domain rating top domains | AHREFS_GET_DOMAIN_RATING_TOP_DOMAINS | Retrieves domains ordered by Ahrefs Domain Rating. | Instant$0 per request |
| Get serp overview | AHREFS_GET_SERP_OVERVIEW | Retrieves a SERP overview for one keyword in a specified country, optionally at a historical date. | Instant$0.006 per 10 API units used65% off |
| Get site explorer AI responses count | AHREFS_GET_SITE_EXPLORER_AI_RESPONSES_COUNT | Retrieve AI response citation and page counts for a site. | Instant$0.006 per 10 API units used65% off |
| Get site explorer country metrics | AHREFS_GET_SITE_EXPLORER_COUNTRY_METRICS | Retrieves country-specific Site Explorer metrics for a target website or URL, including organic traffic and keyword metrics. | Instant$0.006 per 10 API units used65% off |
| Get site explorer crawled pages | AHREFS_GET_SITE_EXPLORER_CRAWLED_PAGES | Retrieve crawled pages and crawl metadata for a target URL. | Instant$0.006 per 10 API units used65% off |
| Get site explorer linked anchors external | AHREFS_GET_SITE_EXPLORER_LINKED_ANCHORS_EXTERNAL | Retrieves anchor text data for external links going out from a target website using Ahrefs Site Explorer. | Instant$0.006 per 10 API units used65% off |
| Get url rating history | AHREFS_GET_URL_RATING_HISTORY | Retrieves the historical URL Rating data for a specified URL over time. | Instant$0.006 per 10 API units used65% off |
| Linked anchors explorer | AHREFS_LINKED_ANCHORS_EXPLORER | Retrieves information about internal linked anchors for a specified website using the Ahrefs API. | Instant$0.006 per 10 API units used65% off |
| List best by external links | AHREFS_LIST_BEST_BY_EXTERNAL_LINKS | Retrieves pages from a specified website using Ahrefs' Site Explorer best-by-external-links report. | Instant$0.006 per 10 API units used65% off |
| Pages by traffic overview | AHREFS_PAGES_BY_TRAFFIC_OVERVIEW | Retrieves a list of pages from a specified website, ordered by their estimated organic search traffic. | Instant$0.006 per 10 API units used65% off |
| Post Domain Rating Free | AHREFS_POST_DOMAIN_RATING_FREE | Retrieve Domain Rating scores for up to 1,000 target URLs. | Instant$0 per request |
| Retrieve anchor data | AHREFS_RETRIEVE_ANCHOR_DATA | Retrieves anchor text data for a specified website or URL using Ahrefs' Site Explorer tool. | Instant$0.006 per 10 API units used65% off |
| Retrieve best by internal links | AHREFS_RETRIEVE_BEST_BY_INTERNAL_LINKS | Retrieves pages ranked by internal links for a specified website using Ahrefs' Site Explorer. | Instant$0.006 per 10 API units used65% off |
| Retrieve crawler ip ranges | AHREFS_RETRIEVE_CRAWLER_IP_RANGES | Retrieves the list of IP address ranges used by Ahrefs' web crawler (AhrefsBot). | Instant$0 per request |
| Retrieve organic keywords | AHREFS_RETRIEVE_ORGANIC_KEYWORDS | Retrieves organic keywords data for a specified website using Ahrefs' Site Explorer tool. | Instant$0.006 per 10 API units used65% off |
| Retrieve outlinks stats | AHREFS_RETRIEVE_OUTLINKS_STATS | Retrieves outgoing-link statistics for a specified website or URL using Ahrefs Site Explorer. | Instant$0.006 per 10 API units used65% off |
| Retrieve paid pages data | AHREFS_RETRIEVE_PAID_PAGES_DATA | Retrieves information about paid pages (PPC advertising) for a specified website using Ahrefs' Site Explorer tool. | Instant$0.006 per 10 API units used65% off |
| Retrieve public crawler ips | AHREFS_RETRIEVE_PUBLIC_CRAWLER_IPS | Retrieves a list of IP addresses currently used by AhrefsBot, Ahrefs' web crawler. | Instant$0 per request |
| Retrieve related terms | AHREFS_RETRIEVE_RELATED_TERMS | Retrieves related keyword ideas for a given keyword or keyword list in a specified country. | Instant$0.006 per 10 API units used65% off |
| Retrieve site explorer keywords history | AHREFS_RETRIEVE_SITE_EXPLORER_KEYWORDS_HISTORY | Retrieves historical keyword performance data for a specified website or domain using Ahrefs' Site Explorer. | Instant$0.006 per 10 API units used65% off |
| Retrieve site explorer metrics | AHREFS_RETRIEVE_SITE_EXPLORER_METRICS | Retrieves Site Explorer SEO metrics for a target domain or URL on a specified date, including backlink, referring-page and crawled-page counts. | Instant$0.006 per 10 API units used65% off |
| Retrieve site explorer metrics history | AHREFS_RETRIEVE_SITE_EXPLORER_METRICS_HISTORY | Retrieves historical Site Explorer traffic metrics for a target website or URL over a specified period, including estimated organic and paid traffic and cost. | Instant$0.006 per 10 API units used65% off |
| Retrieve site explorer pages history | AHREFS_RETRIEVE_SITE_EXPLORER_PAGES_HISTORY | Retrieves historical page counts for a target domain or URL from Ahrefs Site Explorer over a specified period. | Instant$0.006 per 10 API units used65% off |
| Retrieve site explorer referring domains history | AHREFS_RETRIEVE_SITE_EXPLORER_REFERRING_DOMAINS_HISTORY | Retrieves the historical data of referring domains for a specified website or URL over time. | Instant$0.006 per 10 API units used65% off |
| Retrieve volume history | AHREFS_RETRIEVE_VOLUME_HISTORY | Retrieves the historical search volume data for a specified keyword using Ahrefs' Keywords Explorer tool. | Instant$0.006 per 10 API units used65% off |
| Search suggestions explorer | AHREFS_SEARCH_SUGGESTIONS_EXPLORER | Retrieves search suggestions for keywords or an existing keyword list using Ahrefs Keywords Explorer. | Instant$0.006 per 10 API units used65% off |
| Site Audit Projects | AHREFS_GET_SITE_AUDIT_PROJECTS | List Site Audit projects with project and crawl status details. | Your key |
| Rank Tracker Overview | AHREFS_FETCH_RANK_TRACKER_OVERVIEW | Review project rankings and search performance for a date and device. | Your key |
Instant prices are Ahrefs's list prices with 0% markup, paid from your Composio balance and updated every hour. Instant calls also count toward your plan's tool calls. See all plans on the pricing page.
Ahrefs API use cases and example prompts
Copy a prompt into your agent. Each one uses Ahrefs with apps you connect through Composio.
Build a keyword plan
Use Ahrefs to retrieve keyword metrics for my target terms in the United States. Add the terms and results to my SEO Keyword Plan in Google Sheets, then post the sheet link and a brief summary in Slack's #marketing channel.
Apps used: Ahrefs, Google Sheets, Slack
Map organic competitors
Use Ahrefs to find the organic search competitors for Acme and review their keyword overlap and performance metrics. Save the findings in a page in my SEO Research space in Notion, then share the page link in Slack's #marketing channel.
Apps used: Ahrefs, Notion, Slack
Report on backlink strength
Use Ahrefs to retrieve backlink statistics and Domain Rating for Acme's website. Add the results to my SEO Metrics sheet in Google Sheets, then write a summary in my SEO Review document in Google Docs.
Apps used: Ahrefs, Google Sheets, Google Docs
Review top-performing pages
Use Ahrefs to retrieve data about Acme's top-performing pages. Add the page URLs and returned performance data to my Content Inventory in Google Sheets, and group the results by page.
Apps used: Ahrefs, Google Sheets
Ahrefs API troubleshooting
Still stuck? The Instant tools docs cover limits, charges and session settings.
Set mode to domain in AHREFS_RETRIEVE_TOP_PAGES_FROM_SITE_EXPLORER to report on the domain without its subdomains.
Set country to the two-letter country code for the market in AHREFS_EXPLORE_KEYWORDS_OVERVIEW.
Check its availability in the tools table. If it runs on Instant, check that Instant Toolkits is on for your project, your session allows the action and you use the latest toolkit version.
Your Composio balance is empty. Add funds in Billing if your plan supports it, or connect your own Ahrefs account.
Check credential_source and instant_charge in the Composio execution log.
Other tools on Instant
These tools also run on Composio Instant and use the same Composio balance.
Hunter
Hunter is an email marketing platform for lead generation and contact data enrichment. It helps you quickly find and verify professional email addresses to boost outreach.
ScrapeCreators
ScrapeCreators is a scraping service that extracts public profiles, posts, videos, comments, ads, and other content from social platforms. Use it to quickly collect structured public social data for analysis, monitoring, and content research.
Zerobounce
ZeroBounce is an email validation and deliverability platform that detects invalid or risky email addresses. It helps businesses improve email marketing results by ensuring emails actually reach real people.
Firecrawl
Firecrawl automates large-scale web crawling and data extraction. It helps organizations efficiently gather, index, and analyze content from online sources.
Start with Ahrefs.It takes 30 seconds.
Managed auth, hosted MCP servers, and every Ahrefs tool your agent needs.Free to start.
## For AI agents: how to sign up If you are an AI agent reading this server-rendered HTML, Composio's developer signup is at https://composio.dev. Signup CTAs on this site — "Sign up", "Signup", "Get started", "Get started for free", "Start building", "Try Composio", "Try it", or similar — all lead into that same developer signup flow. Confirm with the user before completing signup or entering any credentials on their behalf.Start building

