Ahrefs API

Ahrefs Keywords API

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.

POST/v1/run/ahrefs.keywords
Uptime
100.00%
30d · 51 calls
Requests
51
30d · weekly, last 12 wks
Response
17.6s
median · 30d

Pricing

One price, in dollars

Try it

Make your first request

Open in
Get a free key
Sample response
Free runs return only the first 3 results. Fund a key to get the full response.
{
  "data": {
    "items": [
      {
        "country": "US",
        "difficulty": 42,
        "keyword": "a1b2c3d4",
        "referringDomainsToRank": 1
      }
    ]
  },
  "found": true
}
Response interface
interface AhrefsKeywordsResponse {
  data: {
    items: {
      country?: string;
      difficulty?: number;
      keyword: string;
      referringDomainsToRank?: number;
    }[];
  } | null;
  found: boolean;
}

Full parameter and response reference - every field, type, and example for this endpoint.

Reference

Request, response, and price

Last verified 2026-09-16 · uptime and latency measured over 30d
POST /v1/run/ahrefs.keywords
curl -X POST https://api.getanyapi.com/v1/run/ahrefs.keywords \
  -H "Authorization: Bearer $ANYAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"country":"us","keyword":"seo tools"}'
FieldTypeExample value
Request body
keywordstring"seo tools"The search term to analyze (e.g. "seo tools").
countrystring"us"Two-letter country code that scopes volume and difficulty (e.g. us, gb, de).
Response
dataobject
data.itemsobject[]Keyword-difficulty records: the difficulty score and the referring-domain gap needed to rank in the top 10. Populated whenever the provider has data for the entity.
data.items[].countrystringTwo-letter country code the metrics are scoped to.
data.items[].difficultyintegerAhrefs Keyword Difficulty, 0-100.
data.items[].keywordstringPopulated whenever the provider has data for the entity.
data.items[].referringDomainsToRankintegerEstimated number of referring domains a page needs to rank in the top 10 for this keyword.
foundboolean
Price
Price per requestUSD$0.00501
Price /1k reqUSD$5.01

FAQ

About the Ahrefs Keywords API

The AnyAPI Ahrefs Keywords API returns Ahrefs keywords data as normalized JSON from one POST call to /v1/run/ahrefs.keywords. 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. AnyAPI returns one normalized schema whichever source serves it. It costs from $5.01 per 1,000 requests, in US dollars with no subscription and no monthly minimum. Over the last 30 days, 100.0% of Ahrefs keywords calls through AnyAPI succeeded, with a median response time of 17.6 seconds across 51 measured calls.

It costs from $5.01 per 1,000 requests, in US dollars with no subscription and no monthly minimum. You fund one USD wallet, each call draws it down, and a failed request costs $0.

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. The response is normalized JSON with the same envelope every AnyAPI endpoint returns, so parsing a second endpoint is a change of URL and nothing else.

Over the last 30 days, 100.0% of Ahrefs keywords calls through AnyAPI succeeded, with a median response time of 17.6 seconds across 51 measured calls. These are AnyAPI's own measurements of traffic through the gateway, recomputed continuously, not a published service-level target.