Skip to content

New accounts get $100 of free credit. No card.

LinksApp
LinksAppGet $100 free

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.

bash
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

FieldMeaningNotes
actionWhich report to runrefdomains costs 2 credits; overview is free
qThe domain to look upUse the host you publish docs on
key or Bearer headerYour secret, starting with sk_Header keeps it out of server logs and URLs
sort and orderColumn to sort by, asc or descSort by DR for a quick read
perRows per page, 10 to 5000Up to 1,000 rows per call; one call is billed once
pagePage numberDeep pagination is capped at 50,000 rows
okTrue when the call workedCheck it before reading anything else
_creditsCost of this call and balance leftPresent 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

01

Store the key as a CI secret

Name it something like LINKSAPP_KEY. Never commit it to the docs repository.

02

Run the script on a schedule, not on every push

The data refreshes roughly monthly, so a weekly job is plenty.

03

Write the result to a file in the repository

A JSON file diffed in a pull request shows who started linking since last time.

04

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.

Keep the key off the client

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.