Ahrefs Backlinks API
Get the referring pages linking to a domain or URL, each with the source page, anchor text, linking domain rating, and page title.
Try it
Make your first request
{
"data": {
"items": [
{
"anchor": "example",
"contextAfter": "A short example description of this item.",
"contextBefore": "A short example description of this item.",
"domainRating": 4.6,
"title": "Example title",
"urlFrom": "https://example.com/page",
"urlTo": "https://example.com/page"
}
]
},
"found": true
}interface AhrefsBacklinksResponse {
data: {
items: {
anchor?: string;
contextAfter?: string;
contextBefore?: string;
domainRating?: number;
title?: string;
urlFrom: string;
urlTo?: string;
}[];
} | 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.backlinks \
-H "Authorization: Bearer $ANYAPI_KEY" \
-H "Content-Type: application/json" \
-d '{"mode":"exact","url":"ahrefs.com"}'| Field | Type | Example value |
|---|---|---|
| Request body | ||
| url | string | "ahrefs.com"The domain or page URL to find backlinks for (e.g. "ahrefs.com"). |
| mode | enum | "exact"Match scope: "exact" for the given URL only, or "subdomains" to include the domain and its subdomains. |
| Response | ||
| data | object | |
| data.items | object[] | Referring pages that link to the domain or URL. Populated whenever the provider has data for the entity. |
| data.items[].anchor | string | Anchor text of the link. |
| data.items[].contextAfter | string | Text immediately after the anchor on the referring page. |
| data.items[].contextBefore | string | Text immediately before the anchor on the referring page. |
| data.items[].domainRating | number | Ahrefs Domain Rating (0-100) of the linking domain. |
| data.items[].title | string | Title of the referring page. |
| data.items[].urlFrom | string | URL of the referring page that contains the link. Populated whenever the provider has data for the entity. |
| data.items[].urlTo | string | Target URL the link points to. |
| found | boolean | |
| Price | ||
| Price per request | USD | $0.00501 |
| Price /1k req | USD | $5.01 |
FAQ
About the Ahrefs Backlinks API
The AnyAPI Ahrefs Backlinks API returns Ahrefs backlinks data as normalized JSON from one POST call to /v1/run/ahrefs.backlinks. Get the referring pages linking to a domain or URL, each with the source page, anchor text, linking domain rating, and page title. 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 backlinks calls through AnyAPI succeeded, with a median response time of 20.3 seconds across 15 measured calls.