SEO backlink extractor API in a docs build, field by field
Docs sites collect links quietly. A short script in your build can list them every month without a dashboard subscription.
LinksApp research team ·
The call, then the fields
This pulls the 50 strongest referring domains for a docs host. Replace the key and the domain.
curl -H "Authorization: Bearer sk_live_..." \
"https://linksapp.org/api.php?action=refdomains&q=docs.yourapp.com&sort=dr&order=desc&per=50&page=1"What each part means
| Field | Meaning | Notes |
|---|---|---|
| action | Which report to run | refdomains costs 2 credits; overview is free |
| q | The domain to look up | Use the host you publish docs on |
| key or Bearer header | Your secret, starting with sk_ | Header keeps it out of server logs and URLs |
| sort and order | Column to sort by, asc or desc | Sort by DR for a quick read |
| per | Rows per page, 10 to 5000 | Up to 1,000 rows per call; one call is billed once |
| page | Page number | Deep pagination is capped at 50,000 rows |
| ok | True when the call worked | Check it before reading anything else |
| _credits | Cost of this call and balance left | Present on authenticated calls |
A note on pagination and sort
Most docs hosts have fewer than a thousand referring domains, so one call with per=1000 returns the lot. Larger domains need page to walk through the rest, up to the 50,000-row cap.
Sorting by DR descending puts the strongest linkers first. Sorting ascending is rarely useful, though it quickly shows how much of a profile is tiny sites.
Billing does not change with row count. A call that returns 10 rows and one that returns 1,000 both cost 2 credits for refdomains.
Wiring it into a build
Store the key as a CI secret
Name it something like LINKSAPP_KEY. Never commit it to the docs repository.
Run the script on a schedule, not on every push
The data refreshes roughly monthly, so a weekly job is plenty.
Write the result to a file in the repository
A JSON file diffed in a pull request shows who started linking since last time.
Handle the two errors
HTTP 401 means a missing or bad key. HTTP 402 means the credit ran out, so top up with USDT (TRC-20) on the account page.
A cost estimate you can check
Say a docs site and three rival docs hosts, four domains in all. One weekly refdomains call each is 4 calls at 2 credits, so 8 credits a week and about 35 credits a month. That is $0.0035.
The same money in a subscription tool would be a rounding error on the bill, but the point is that you do not pay for idle months. Ahrefs sells API units inside subscriptions from $129/month, with at least 50 units per request.
These numbers are an invented example for the arithmetic only.
Competitor overlap in one call
The intersect action takes 2 to 10 domains and returns sites that link to several of them. Feed it the docs hosts of two or three rival apps.
That is the closest thing here to a competitor backlink analysis you would otherwise build in Ahrefs. It is narrower: no keyword layer, no daily crawl.
At 2 credits per call the whole thing costs $0.0002. See the troubleshooting table before you trust an empty answer.
CORS is open, so a browser could call the API directly, but a key in front-end code is a key anyone can copy. Call from your build or a server route, and start with the landing page walkthrough if you have not yet. A monthly log file is also the cheapest backup you can keep of your link profile; if you ever move the docs to a new host, you will know which old URLs people linked to.