morigraph Start free

Data APIs ยท Ahrefs

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.

APIs
5
Price
0.109 to 0.115 credits a call
Call it from
MCP, command line and HTTP API
Needs
One morigraph connection. No Ahrefs account or API key

Three ways 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

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)

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)

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"}}'

5 Ahrefs data APIs

APIIdPrice
Ahrefs Backlinksahrefs.backlinks0.109 credits a call
Ahrefs Domain Overviewahrefs.overview0.109 credits a call
Ahrefs Keyword Difficultyahrefs.keywords0.109 credits a call
Ahrefs Keyword Ideasahrefs.keyword_ideas0.109 credits a call
Ahrefs Traffic Overviewahrefs.traffic0.115 credits a call

Ahrefs Domain Overview

ahrefs.overview0.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.

ArgumentTypeRequiredWhat it is
modeexact | subdomainsnoAnalysis scope: subdomains covers the whole domain, exact matches only the given URL. Default "subdomains".
urlstringyesThe domain or page URL to analyze (e.g. ahrefs.com).

Returns backlinks dofollowBacklinksPct dofollowReferringDomainsPct domain domainRating mode referringDomains

The call

data_api({"api":"ahrefs.overview","input":{"mode":"subdomains","url":"ahrefs.com"}})

Ahrefs Keyword Difficulty

ahrefs.keywords0.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.

ArgumentTypeRequiredWhat it is
countrystringnoTwo-letter country code that scopes volume and difficulty (e.g. us, gb, de). Default "us".
keywordstringyesThe search term to analyze (e.g. "seo tools").

Returns country cpcUsd difficulty keyword referringDomainsToRank searchVolume updatedUtc

The call

data_api({"api":"ahrefs.keywords","input":{"country":"us","keyword":"seo tools"}})

Ahrefs Keyword Ideas

ahrefs.keyword_ideas0.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.

ArgumentTypeRequiredWhat it is
countrystringnoTwo-letter country code that scopes the suggestions (e.g. us, gb, de). Default "us".
keywordstringyesThe seed keyword to expand into related suggestions (e.g. "coffee").

Returns country ideas questions searchEngine sourceKeyword

The call

data_api({"api":"ahrefs.keyword_ideas","input":{"country":"us","keyword":"coffee"}})

Ahrefs Traffic Overview

ahrefs.traffic0.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

ArgumentTypeRequiredWhat it is
modeexact | subdomains | prefix | domainnoAnalysis 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. Default "subdomains".
urlstringyesThe website to analyze (e.g. ahrefs.com). A page URL is analyzed as its whole website.

Returns domain mode monthlyTraffic monthlyTrafficValueUsd topCountries topKeywords trafficHistory

The call

data_api({"api":"ahrefs.traffic","input":{"mode":"subdomains","url":"ahrefs.com"}})

Good to know

When to choose something else

Choose a provider that specialises in Ahrefs data when you need it at high volume, on a schedule, or as bulk exports: you will get volume pricing and more control. Choose the platform's official API when you need data from your own account. These APIs are for an agent that needs an answer now, alongside other tools on the same balance.

Questions

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.

Prices and availability read from the production service on . A credit is about 10 cents of tool use; see pricing. Your assistant can quote the exact cost before a paid call.