Blog/Product
5 min read

Backlink API: Link Counts, Referring Domains, Anchors

Pull backlink totals, referring domains and anchor text for one domain or a list, and learn which numbers to trust before you report them.

Backlink API: Link Counts, Referring Domains, Anchors

Get the backlink totals, referring domains and anchor text of any domain without a link-tool subscription. Paste this into your agent:

Set up https://monid.ai/SKILL.md, and then use Monid to get the live and all-time backlink counts of apify.com, its top 5 anchors by referring domains, and the 3 referring domains that send it the most links, and tell me which numbers I can trust.

One prompt returns the totals, the domains and the anchors. 1 min setup · 2-6 hrs saved.

You want to know who links to a site, how many links it has and what the anchor text says, and you want that as data an agent can read, not a report you export by hand. This guide shows the quick route: one call for the totals, one for the referring domains and one for the anchors, then how to read each number so a report does not mislead anyone. We ran every call on 2026-10-16, so the fields and figures below are what came back. It runs through Monid, the OpenRouter for agent tools: one key, one balance, every tool priced per call.

Monid. Install it once, add a key, and your agent calls the link reports for a domain and gets typed JSON back, with no plan to choose first and no dashboard to open.

  • Pay per row. Each returned row is billed on its own. The totals call is $0.00774 for its one row, a referring-domain row is $0.00387 and an anchor row is $0.005805 (Verified 2026-10-16 on the SEO tools page). Buy calls as you need them: no monthly plan and no minimum top-up. Discovery and inspection are free, and an empty result is not billed.
  • One install, every API. The same key and the same balance call the link reports and every other tool on Monid, so a SERP or keyword lookup for the same site is another call, not another vendor.
  • Lives inside your agent. Install the CLI, add your key, run the prompt above, and the tools are there whenever your agent needs them. Your agent reads SKILL.md and learns the rest, so setup is about a minute.

Checking the size of the link profile of 100 domains costs about $0.774 (Verified 2026-10-16).

📖 See also Find All URLs on a Domain: List Every Page in One Call

Run the totals call once per domain, and spend the per-row calls only on the domains that survive it. All three reports belong to the provider key ahrefs.

RouteWhat you getCost shapeFits
Free online checkerA few rows for one domain, by handFreeA quick look at one site
Export from a link-tool dashboardCSV files you downloadWhatever plan you holdLooking at your own sites
Write your own clientExactly the fields you code forYour hoursA fixed job you will maintain
Monid link endpointsTyped rows per domain, capped by limitPay per row, buy flexiblyLists of domains, agents, audits

Monid fits a list because the work is the same call repeated, and you pay for the rows you receive and nothing between runs.

For agents

Grab an API key at app.monid.ai, then paste this to your agent and hand it the key:

set up https://monid.ai/SKILL.md

It learns the whole discover, inspect, run workflow itself. More in the agent quickstart.

For humans

npm install -g @monid-ai/cli
monid keys add -k <your-api-key> -l main

Step 1. The totals, because it is one row

What it does. Returns live and all-time backlinks and referring domains for a domain in a single object.

The call.

monid run -p ahrefs -e /site-explorer/backlinks-stats \
  --query '{"target":"apify.com","mode":"subdomains","date":"2026-10-16"}'

target and date are required, and date is today's date for current values.

What it costs. One row, $0.00774 (Verified 2026-10-16). Do this before anything else: it tells you whether the domain is worth a deeper pull.

Step 2. The referring domains, with the limit you mean

What it does. Lists the unique domains that link to the target, with rating and link counts.

The call.

monid run -p ahrefs -e /site-explorer/refdomains \
  --query '{"target":"apify.com","mode":"subdomains","limit":3,"order_by":"links_to_target:desc"}'

limit is the cost control on a per-row endpoint, and the maximum is 100. order_by decides which rows you are paying for: three rows sorted by link count are a different purchase from three sorted by rating. There is no date key on this call.

What it costs. $0.00387 a row (Verified 2026-10-16).

Step 3. The anchors, sorted

What it does. Groups the target's links by anchor text and counts the referring domains behind each anchor.

The call.

monid run -p ahrefs -e /site-explorer/anchors \
  --query '{"target":"apify.com","mode":"subdomains","limit":4,"order_by":"refdomains:desc"}'

What it costs. $0.005805 a row (Verified 2026-10-16).

Loop the totals over your list

Put one domain per line in domains.txt, and write one file per domain:

mkdir -p out
while read -r d; do
  monid run -p ahrefs -e /site-explorer/backlinks-stats \
    --query "{\"target\":\"$d\",\"mode\":\"subdomains\",\"date\":\"$(date -u +%F)\"}" > "out/$d.json"
done < domains.txt

Each domain bills one row. The loop uses the UTC date so date stays in step with the provider when your machine runs ahead of it.

📖 See also Ahrefs API: Get Domain Rating and Backlinks Per Call

Give this to your agent

$Set up https://monid.ai/SKILL.md, and then use Monid to pull live and all-time backlinks for these five competitor domains, then the top 25 referring domains for each sorted by link count, and tell me which domains link to more than one of them.

Yes, but the data is the hard part, not the code. A backlink checker is only as good as the crawl behind it, and a crawl of the web is not something a script of yours reproduces. What you can build alone is a small checker that visits a list of pages you already know and looks for a link to your domain. It finds links you placed, and it cannot discover the ones other people placed.

So the realistic options are a data provider or a hand-kept list. A provider means a key, an agreement and each report's parameters: in this family the totals call requires a date while the referring-domain and anchor calls reject one. A hand-kept list means you maintain it.

Through Monid the same job is a CLI call with the same parameters, so a Python script reaches it with subprocess and no client library:

import json, subprocess

out = subprocess.run(
    ["monid", "run", "-p", "ahrefs", "-e", "/site-explorer/backlinks-stats",
     "--query", json.dumps({"target": "apify.com", "mode": "subdomains", "date": "2026-10-16"})],
    capture_output=True, text=True,
)
print(json.loads(out.stdout))

The CLI works from any language that can start a process, and your agent can make the same call without any script at all.

Three layers: the totals for the domain, the domains behind them, and the words they used. We ran all three against apify.com on 2026-10-16.

The totals

{ "live": 4018426,
  "all_time": 8429928,
  "live_refdomains": 16783,
  "all_time_refdomains": 34518 }

Four numbers in one object. Live links are 48% of the all-time count, and live referring domains are 49% of theirs.

The referring domains

Three rows, sorted by link count:

DomainDRLinksDofollowFirst seenLast seen
devrelcon.dev381,978,7271,978,7272024-12-07null
licify.cl0915,455915,4552026-03-19null
bazzi.sk0652,229652,2292018-04-232020-02-12

Six fields per row: domain, domain_rating, links_to_target, dofollow_links, first_seen and last_seen. A last_seen date means the link has been gone since then.

The anchors

Four rows, sorted by referring domains:

AnchorReferring domainsLinksFirst seen
Apify4,317608,4712017-09-24
apify.com1,91720,0562017-05-16
(empty)9902,136,0312015-07-28
TELEGRAM @SEO_ANOMALY - SEO BACKLINKS, BLACK-LINKS, TRAFFIC BOOST, LINK INDEXING5605,8322025-05-01

Five fields per row: anchor, refdomains, links_to_target, first_seen and last_seen.

What you can build with it

  • A decay monitor. Pull the totals monthly for a list of sites and store live divided by all time. A falling ratio means links are disappearing faster than they arrive.
  • A competitor link gap. Pull the top referring domains of five rivals and list the ones that link to several of them but not to you.
  • An anchor audit. Pull your anchors sorted by referring domains and read whether the text is your brand, your URL or something someone else wrote about you.

📖 See also Ahrefs vs KWFinder: Both Halves Are Available by the Call

Three things showed up in the runs of 2026-10-16.

Why is the live count half the all-time count?

Because links die, and the all-time figure is a counter that only rises. apify.com had 8,429,928 links all time and 4,018,426 live, so 52% of the links it ever had are gone. On referring domains it was 34,518 all time and 16,783 live, so 51% of the domains that ever linked have stopped.

The rule: label the number. Report live, say so in the label, and never put one site's live count beside another site's all-time count. That comparison is off by a factor of about two on this domain, and the error is invisible in a table.

Because link volume from one domain is not a count of endorsements. Sorted by links_to_target, the top referring domain, devrelcon.dev, sent 1,978,727 links, and licify.cl sent 915,455. Together those two domains supply 2,894,182 of the 4,018,426 live links, which is 72%, out of 16,783 live referring domains. A rating of 38 and a rating of 0 sit behind those two numbers.

The rule: count referring domains, not links. A total of four million links sounds like a large following. It is two domains and a long tail. The third row, bazzi.sk, shows what removal looks like: 652,229 links, with a last_seen of 2020-02-12.

Why do empty and spam anchors sit in the list?

Because an anchor report counts what was written, not what is flattering. Sorted by referring domains, the top two anchors were the brand and the URL, as you would hope. The third was an empty anchor, which is what an image link or a link around a logo produces: 990 referring domains and 2,136,031 links. The fourth was an advertisement for black-hat link selling, from 560 referring domains and 5,832 links, first seen on 2025-05-01.

The rule: pass order_by before you read a single row. An unsorted page of a long tail is a sample of an ordering you did not choose. Sorting by refdomains:desc gives you the anchors many different sites used, which is the question people think they are asking. If you audit your own domain, the spam row is a finding, not a bug: somebody has your domain in a list that gets reused.

What does a pull cost?

Cost tracks the rows you request. Our three calls billed 8 rows in total, $0.04257 (Verified 2026-10-16). A full 100-row refdomains page is $0.387 and a full 100-row anchors page is $0.5805 (Verified 2026-10-16). The sensible pattern is the totals for everyone and the detail only for the few domains that matter.

Which endpoint should I use for which job?

EndpointWhat it doesInputBillingPrice (Verified 2026-10-16)
ahrefs/site-explorer/backlinks-statsLive and all-time totalstarget, mode, datePer row$0.00774
ahrefs/site-explorer/refdomainsWho links to a targettarget, limit, where, order_byPer row$0.00387
ahrefs/site-explorer/anchorsHow they describe ittarget, limit, where, order_byPer row$0.005805
ahrefs/site-explorer/all-backlinksIndividual links with source page and anchortarget, limit, where, order_byPer row$0.00645
ahrefs/site-explorer/refdomains-historyReferring domains over timetarget, date_from, history_groupingPer bucket$0.00387

Prices Verified 2026-10-16 with monid inspect. We ran the first three rows. The other two were inspected for their input and billing and not run. Every row bills per returned unit and an empty result is free, so limit and where are the whole cost model. The history call bills one row per bucket, up to 60 buckets a request.

When is another route a better fit?

You want to know whether a link helped. Nothing here attributes traffic or ranking to a link. For that you need your own analytics next to the link data, and even then it is an inference.

You are checking one page, once. A browser and a free checker will answer that. The API earns its place when you do it for fifty domains on a schedule.

You need every link. These are index-derived numbers, and a domain with millions of links has more than any one crawler lists. For a disavow decision, pull more than one source.

You are reporting all-time counts to someone who will act on them. The number only goes up and it describes links that no longer exist. If it has to appear, put the live number next to it.

And the disclosure: this is the blog of Monid, and we resell these endpoints. The two most useful things in this post cost nothing: report the live number, and pass order_by before you read a row.

Conclusion

The quickest way to get backlink data through an API is one call per report through Monid: $0.00774 for the totals, $0.00387 for each referring domain and $0.005805 for each anchor (Verified 2026-10-16), one key for this and every other tool, about a minute to set up, and ready inside your agent whenever you need it.

Two things matter more than the endpoint. Report the live count and label it, because on the domain we measured about half of all links ever seen were gone. And count referring domains, not links, because two domains out of 16,783 supplied 72% of the live links.

How we estimated the time saved: learning the parameters of each report is 1 to 2 hours, and building the list loop and the live-versus-all-time and referring-domain checks is another 1 to 4 hours. That is 2 to 6 hours. The 1 minute is the install, key and first call once you already have a Monid key.

Free next step: run monid inspect -p ahrefs -e /site-explorer/backlinks-stats, then make one call for your own domain and divide live by all_time. One row costs $0.00774 (Verified 2026-10-16). Start at monid.ai.

FAQ

Is there a free backlink API?

Not free, but you can start without a plan: through Monid the totals call costs $0.00774 for its one row (Verified 2026-10-16), with no monthly plan and no minimum top-up. Discovery and inspection cost nothing, and an empty result is not billed.

Should a backlink report use the live count or the all-time count?

Live, with the word live in the label. The all-time figure is a cumulative counter that cannot fall, so it includes every link that was seen and later removed. For apify.com on 2026-10-16 it was 8,429,928 against 4,018,426 live. The one good use of the all-time figure is as a denominator: live divided by all time is a decay rate. Pull both, report one, and keep the ratio.

Why does one domain show millions of links?

Because one site can place a link on every page of a large template, and the report counts each page. In our run, devrelcon.dev alone sent 1,978,727 links to apify.com. Count distinct referring domains to see how many separate sites link to you, and treat link volume from one domain as a sign of templating, not endorsement.

How often should I refetch a link profile?

Match the frequency to how fast the metric moves. The totals move slowly for an established domain, so monthly is plenty, and weekly only makes sense during a campaign or after a migration. Referring domains and anchors bill per row, so repeating them on a schedule is where a budget goes. Pull a cheap monthly total for every domain you track and the detail only when the total moved enough to ask why. For a trend, the history call returns many months in one request.

Published October 2026.

backlink apibacklink checker apireferring domains apianchor text apilink data