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.
Try it
Make your first request
{
"data": {
"items": [
{
"country": "US",
"difficulty": 42,
"keyword": "a1b2c3d4",
"referringDomainsToRank": 1
}
]
},
"found": true
}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 30dcurl -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"}'| Field | Type | Example value |
|---|---|---|
| Request body | ||
| keyword | string | "seo tools"The search term to analyze (e.g. "seo tools"). |
| country | string | "us"Two-letter country code that scopes volume and difficulty (e.g. us, gb, de). |
| Response | ||
| data | object | |
| data.items | object[] | 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[].country | string | Two-letter country code the metrics are scoped to. |
| data.items[].difficulty | integer | Ahrefs Keyword Difficulty, 0-100. |
| data.items[].keyword | string | Populated whenever the provider has data for the entity. |
| data.items[].referringDomainsToRank | integer | Estimated number of referring domains a page needs to rank in the top 10 for this keyword. |
| found | boolean | |
| Price | ||
| Price per request | USD | $0.00501 |
| Price /1k req | USD | $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.