Ahrefs API

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.

POST/v1/run/ahrefs.backlinks
Uptime
100.00%
30d · 15 calls
Requests
15
30d · weekly, last 12 wks
Response
20.3s
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": [
      {
        "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
}
Response interface
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 30d
POST /v1/run/ahrefs.backlinks
curl -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"}'
FieldTypeExample value
Request body
urlstring"ahrefs.com"The domain or page URL to find backlinks for (e.g. "ahrefs.com").
modeenum"exact"Match scope: "exact" for the given URL only, or "subdomains" to include the domain and its subdomains.
Response
dataobject
data.itemsobject[]Referring pages that link to the domain or URL. Populated whenever the provider has data for the entity.
data.items[].anchorstringAnchor text of the link.
data.items[].contextAfterstringText immediately after the anchor on the referring page.
data.items[].contextBeforestringText immediately before the anchor on the referring page.
data.items[].domainRatingnumberAhrefs Domain Rating (0-100) of the linking domain.
data.items[].titlestringTitle of the referring page.
data.items[].urlFromstringURL of the referring page that contains the link. Populated whenever the provider has data for the entity.
data.items[].urlTostringTarget URL the link points to.
foundboolean
Price
Price per requestUSD$0.00501
Price /1k reqUSD$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.

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 referring pages linking to a domain or URL, each with the source page, anchor text, linking domain rating, and page title. 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 backlinks calls through AnyAPI succeeded, with a median response time of 20.3 seconds across 15 measured calls. These are AnyAPI's own measurements of traffic through the gateway, recomputed continuously, not a published service-level target.