Reference
Ahrefs backlink report versus API output: a reference of actions
If you are used to exporting an Ahrefs backlink report, this reference shows which parts you can rebuild from our actions, what each call costs, and where the big suites stay ahead.
Actions, prices and what they replace in a report
| Action | Credits | Closest part of a typical report | Notes |
|---|---|---|---|
| domain, overview, stats, suggest | 0 | Headline counts | No key needed |
| bulk_dr | 1 | A DR column for a list | Up to 2,000 domains per call |
| compare | 1 | Side-by-side domains | Up to 20 domains |
| top, dr_distribution, tld_breakdown | 1 | Summary charts | Distribution-style summaries |
| refdomains | 2 | Referring domains tab | Paginated |
| backlinks | 2 | Backlinks tab | Paginated |
| anchors, anchor_cloud | 2 | Anchors tab | Cloud is for display |
| toppages | 2 | Best by links | Pages that attract the links |
| intersect | 2 | Link intersect | 2 to 10 domains |
| search, keyword | 3 | No direct match | Anchor, title and URL search |
Parameters that apply across calls
Three things control every list. They are page, per and the pair sort with order. Keep them fixed between months.
per accepts 10 to 5000, though one call returns up to 1,000 rows, and deep pagination stops at 50,000 rows. Each call is billed once whatever the row count, so asking for a full page costs the same as asking for ten rows.
Authentication takes either key=sk_... in the query or an Authorization: Bearer sk_... header. CORS is open, but keep the key on your server regardless, since browser code exposes it to every visitor.
Order matters. When you page through results, sort by DR descending for the domains that probably matter, or ascending to inspect the long tail of small sites. Whichever you choose, write it down beside the file.
Treat the table above as a map and the saved responses as the territory. If a field you expected is absent, build around what is there.
Troubleshooting responses
| You see | Cause | Fix |
|---|---|---|
| HTTP 401 | Key missing or wrong | Check the key and the header spelling |
| HTTP 402 | Credit has run out | Top up in USDT (TRC-20) on the account page |
| ok is false | The request was rejected | Read the message in the body and the parameters you sent |
| Fewer rows than a big suite shows | Different index and crawl timing | Compare trends, not totals |
| A link you made last week is missing | Index rebuilt about monthly | Check again next cycle |
Before you build a report on top of these calls
- Open one saved response per action and note the row field names you actually receive.
- Decide which month label goes into every file name.
- Keep
page,per,sortandorderidentical between monthly pulls. - Log the
_creditsobject from each authenticated response so spend per job is visible. - Cap deep pagination in your script, since lists stop at 50,000 rows.
- Add a freshness note to any report you hand over, saying the index refreshes about monthly.
Reading the envelope
Every response carries ok. Authenticated ones also add _credits, so you can log spend per job and watch the balance.
curl -s "https://rankele.com/api.php?action=toppages&q=example.com&per=50&key=sk_live_..." | head -c 600
# header style
curl -s -H "Authorization: Bearer sk_live_..." \
"https://rankele.com/api.php?action=bulk_dr&domains=example.com,example.org"Ahrefs sells API units inside subscriptions, from $129 a month for 200,000 units at 50 units minimum per request. It also offers keywords, rank tracking and a fresher crawl, and so does Semrush. We cover link data at a low per-call price and nothing beyond. Use the monthly runbook if that is the gap you need to fill. The spam spike decision tree is a good first use of the cheap summary calls.