# Ahrefs data APIs for AI agents > morigraph has 5 Ahrefs data APIs that Claude, ChatGPT, Cursor, Codex or your own code can call, including backlinks, domain overview, keyword difficulty and keyword ideas. You need no Ahrefs developer account or API key, only one morigraph connection. Calls cost from 0.109 credits, about $10.9 for 1,000 calls, paid from one balance. ## How to call it Every data API is run by one tool, `data_api`, with the API's id and its arguments. The example is Ahrefs Backlinks. In your assistant (MCP). Connect once, then ask in plain words: ```sh claude mcp add --transport http --scope user morigraph https://morigraph.com/mcp Use morigraph's Ahrefs Backlinks data API with {"mode":"exact","url":"ahrefs.com"} and summarise what comes back. ``` From a terminal or script (CLI): ```sh npx @morigraph/cli@latest login morigraph call data_api --json-args '{"api":"ahrefs.backlinks","input":{"mode":"exact","url":"ahrefs.com"}}' ``` From your own code (HTTP API): ```sh curl https://api.morigraph.com/v1/tools/data_api \ -H "Authorization: Bearer $MORIGRAPH_API_KEY" \ -H "Content-Type: application/json" \ -d '{"api":"ahrefs.backlinks","input":{"mode":"exact","url":"ahrefs.com"}}' ``` ## Ahrefs Backlinks `ahrefs.backlinks` · 0.109 credits a call (about $10.9 for 1,000) Get the referring pages linking to a domain or URL, each with the source page, anchor text, linking domain rating, and page title. | Argument | Type | Required | What it is | |---|---|---|---| | `mode` | exact \| subdomains | no | Match scope: "exact" for the given URL only, or "subdomains" to include the domain and its subdomains. | | `url` | string | yes | The domain or page URL to find backlinks for (e.g. "ahrefs.com"). | Returns: `anchor`, `contextAfter`, `contextBefore`, `domainRating`, `title`, `urlFrom`, `urlTo` ``` data_api({"api":"ahrefs.backlinks","input":{"mode":"exact","url":"ahrefs.com"}}) ``` ## Ahrefs Domain Overview `ahrefs.overview` · 0.109 credits a call (about $10.9 for 1,000) Get an SEO authority overview for any domain or URL: Domain Rating, total backlinks, and referring domains - as normalized JSON. For the keywords a domain ranks for, use seo.ranked_keywords. | Argument | Type | Required | What it is | |---|---|---|---| | `mode` | exact \| subdomains | no | Analysis scope: subdomains covers the whole domain, exact matches only the given URL. | | `url` | string | yes | The domain or page URL to analyze (e.g. ahrefs.com). | Returns: `backlinks`, `dofollowBacklinksPct`, `dofollowReferringDomainsPct`, `domain`, `domainRating`, `mode`, `referringDomains` ``` data_api({"api":"ahrefs.overview","input":{"mode":"subdomains","url":"ahrefs.com"}}) ``` ## Ahrefs Keyword Difficulty `ahrefs.keywords` · 0.109 credits a call (about $10.9 for 1,000) Get the Ahrefs keyword-difficulty metrics for any search term: the difficulty score (0-100) and the number of referring domains a page needs to rank in the top 10 - as normalized JSON. | Argument | Type | Required | What it is | |---|---|---|---| | `country` | string | no | Two-letter country code that scopes volume and difficulty (e.g. us, gb, de). | | `keyword` | string | yes | The search term to analyze (e.g. "seo tools"). | Returns: `country`, `cpcUsd`, `difficulty`, `keyword`, `referringDomainsToRank`, `searchVolume`, `updatedUtc` ``` data_api({"api":"ahrefs.keywords","input":{"country":"us","keyword":"seo tools"}}) ``` ## Ahrefs Keyword Ideas `ahrefs.keyword_ideas` · 0.109 credits a call (about $10.9 for 1,000) Get related keyword suggestions for any seed term, each with an Ahrefs difficulty and search-volume bucket. | Argument | Type | Required | What it is | |---|---|---|---| | `country` | string | no | Two-letter country code that scopes the suggestions (e.g. us, gb, de). | | `keyword` | string | yes | The seed keyword to expand into related suggestions (e.g. "coffee"). | Returns: `country`, `ideas`, `questions`, `searchEngine`, `sourceKeyword` ``` data_api({"api":"ahrefs.keyword_ideas","input":{"country":"us","keyword":"coffee"}}) ``` ## Ahrefs Traffic Overview `ahrefs.traffic` · 0.115 credits a call (about $11.5 for 1,000), at most 0.122 Get the Ahrefs organic traffic overview for a website Ahrefs publishes traffic for (its Top Websites list, mostly larger sites): monthly organic traffic estimate and value, the top 5 keywords it ranks for with position and traffic, traffic by country, and a monthly traffic history - as normalized JSON. Other websites return not found. Top pages are not available. For a domain's full ranked-keyword | Argument | Type | Required | What it is | |---|---|---|---| | `mode` | exact \| subdomains \| prefix \| domain | no | Analysis scope. Only subdomains, the whole website with its subdomains, is served now; a request for domain, prefix or exact is refused. A page URL is analyzed as its whole website. | | `url` | string | yes | The website to analyze (e.g. ahrefs.com). A page URL is analyzed as its whole website. | Returns: `domain`, `mode`, `monthlyTraffic`, `monthlyTrafficValueUsd`, `topCountries`, `topKeywords`, `trafficHistory` ``` data_api({"api":"ahrefs.traffic","input":{"mode":"subdomains","url":"ahrefs.com"}}) ``` ## Do I need an Ahrefs API key or developer account? No. morigraph supplies the access. You connect morigraph once to your assistant, or use one morigraph API key from your own code, and call any of the 5 APIs on this page. ## What does Ahrefs data cost through morigraph? Between 0.109 and 0.115 credits a call depending on the API, where a credit is about 10 cents. That is from about $10.9 for 1,000 calls. You pay per call from one balance, with no separate subscription. ## Can Claude, ChatGPT or Cursor get Ahrefs data? Yes. Add morigraph as an MCP server, sign in once, then ask in plain words. Your assistant finds the right API with one search and runs it with one call. ## Which Ahrefs data APIs are available? Ahrefs Backlinks, Ahrefs Domain Overview, Ahrefs Keyword Difficulty, Ahrefs Keyword Ideas and Ahrefs Traffic Overview. --- Canonical page: https://morigraph.com/tools/data/ahrefs/ Prices read from the catalogue on 2026-11-27. These APIs return public data; how you may use it depends on the platform's terms and applicable law. All data APIs: https://morigraph.com/tools/data.md · Connect: https://morigraph.com/connect.md · Site overview: https://morigraph.com/llms.txt