Backlinks API [beta]
Returns a backlink sample (up to 5,000 rows) for a domain with anchor text, NF/DF status, source URL, target URL, and a handy metrics summary.
At a glance
- Backlink rows include:
anchor,title,nf(nofollow=1, dofollow=0),source,target. - Top-level
metricssummarize the domain’s link profile (links in/out, page count, DF/NF split, ref domains, EDU/GOV). - Up to 5,000 rows per call (order is not guaranteed).
- 3 credits per request; balance can be checked via the v2 balance endpoint.
What you get
Each API call for backlinks will consume 3 credits and return all of the data below.
Backlinks array
anchor- visible link text (falls back totitleif empty).nf-1for nofollow,0for dofollow.source- page where the link lives.target- destination URL on your domain.
Metrics summary
links_in,links_out,page_countbacklinks_follow,backlinks_nofollow,nofollow_ratioref_domains,links_from_edu,links_from_gov
Endpoint
GET /api2/getBacklinks.php?apikey=YOUR_KEY&app=YourApp&domain=example.com
Parameters
apikey(required) - Your account API key.app(required) - Identifier for your integration (e.g.,YourApp).domain(required) - Target domain (no protocol). We normalize common prefixes (e.g., stripwww.).onePerDomain(optional) -1to return at most one backlink per referring domain (de-dupe); omit or0for full sample.
Example response
{
"domain": "domdetailer.com",
"metrics": {
"page_count": 364,
"links_in": 504,
"links_out": 2114,
"backlinks_follow": 469,
"backlinks_nofollow": 35,
"nofollow_ratio": 6.9,
"ref_domains": 215,
"links_from_gov": 0,
"links_from_edu": 0
},
"backlinks": [
{
"anchor": "Domdetailer.com",
"title": "Domdetailer.com",
"nf": 1,
"source": "https://bestfew.com/elementor-test/",
"target": "https://domdetailer.com/"
},
{
"anchor": "DomDetailer Homepage",
"title": "https://domdetailer.com/",
"nf": 0,
"source": "https://docu.gsa-online.de/proxy_scraper/url_metrics?bootswatch-theme=paper",
"target": "https://domdetailer.com/"
}
]
}
Response schema (summary)
{
"domain": string,
"metrics": {
"page_count": number,
"links_in": number,
"links_out": number,
"backlinks_follow": number,
"backlinks_nofollow": number,
"nofollow_ratio": number, // percentage (0–100)
"ref_domains": number,
"links_from_gov": number,
"links_from_edu": number
},
"backlinks": [
{
"anchor": string, // may be empty; fall back to title
"title": string, // page title of source
"nf": 0|1, // 1 = nofollow, 0 = dofollow
"source": string, // URL of page that links to you
"target": string // destination URL on your domain
}
]
}
Code examples
// curl curl -G https://domdetailer.com/api2/getBacklinks.php \ --data-urlencode "apikey=YOUR_KEY" \ --data-urlencode "app=YourApp" \ --data-urlencode "domain=example.com" \ --data-urlencode "onePerDomain=1"
// PHP
$params = [
'apikey' => 'YOUR_KEY',
'app' => 'YourApp',
'domain' => 'example.com',
'onePerDomain' => 1,
];
$resp = file_get_contents('https://domdetailer.com/api2/getBacklinks.php?'.http_build_query($params));
$data = json_decode($resp, true);
// Python (requests)
import requests
params = dict(apikey='YOUR_KEY', app='YourApp', domain='example.com', onePerDomain=1)
r = requests.get('https://domdetailer.com/api2/getBacklinks.php', params=params, timeout=60)
data = r.json()
// Node.js (fetch)
const u = new URL('https://domdetailer.com/api2/getBacklinks.php');
Object.entries({apikey:'YOUR_KEY',app:'YourApp',domain:'example.com',onePerDomain:1})
.forEach(([k,v])=>u.searchParams.set(k,v));
const res = await fetch(u);
const data = await res.json();
// jQuery
$.getJSON('https://domdetailer.com/api2/getBacklinks.php', {
apikey:'YOUR_KEY',
app:'YourApp',
domain:'example.com',
onePerDomain:1
}).done(function(data){ console.log(data); });
Errors
Uses standard HTTP codes; body contains a small JSON error object.
HTTP/1.1 400 Bad Request
{"error":"missing_parameter","message":"domain is required"}
HTTP/1.1 401 Unauthorized
{"error":"invalid_api_key","message":"API key not found or inactive"}
- 400 - invalid/missing parameter
- 401 - API key missing/invalid
- 402 - out of credits
- 429 - too many requests
- 5xx - transient server error
Usage tips & best practices
- Normalize inputs: send bare domains (e.g.,
example.com), not full URLs. - De-dup quickly: use
onePerDomain=1when you just need one backlink per referring domain. - Cache & throttle: respect 429s and cache recent pulls to save credits.
- Pair with v2 domain stats: call API v2 for Moz/Majestic/Pretty summaries alongside backlink rows.
Web tools
Prefer a UI? Use the online tools (same data under the hood): Backlinks Tool · Domain Stats Tool.