DataForSEO Backlinks API: Python Guide and Cost Comparison
The Ahrefs API charges $5.00 per 1,000 backlinks retrieved. DataForSEO charges $0.05 for the same data. That’s not a rounding error. It’s a 100x price difference on identical query results.
I ran a bulk backlink audit of 500 competitor domains in April 2026. Total cost using the DataForSEO Backlinks API: $0.47. The equivalent on Semrush Business would require their $499/month plan as a minimum commitment. That gap is why I switched every programmatic backlink workflow I run to DataForSEO.
This guide covers the full Backlink Intelligence Stack: the three-layer approach I use for production backlink work. Discover (pull live backlinks via the API), Analyze (anchor distribution, domain diversity, DR scoring), and Monitor (bulk tracking of new and lost links at scale). You’ll get working Python code, real cost scenarios, and an honest section on where Ahrefs still wins.
TL;DR
- DataForSEO Backlinks API costs $0.05 per 1,000 rows, 100x cheaper than Ahrefs API ($5.00/1K)
- 9 main endpoints + 5 bulk endpoints covering live, historical, and aggregate backlink data
- Full Python code included: retry logic (tenacity), timeout=30, pagination with offset
- $100/month minimum is waivable entirely via Make.com, n8n, or Google Sheets Connector
Contents
- Key Takeaways
- What Is the DataForSEO Backlinks API and How Does It Work?
- How Much Does the DataForSEO Backlinks API Cost Compared to Ahrefs?
- How Do You Call the DataForSEO Backlinks API with Python?
- How Do You Use the DataForSEO Bulk Backlinks Endpoints?
- How Does DataForSEO Backlink Data Compare to Ahrefs Accuracy?
- When Should You NOT Use the DataForSEO Backlinks API?
- FAQ
- What is the DataForSEO Backlinks API?
- How accurate is DataForSEO’s backlink data compared to Ahrefs?
- How much does the DataForSEO Backlinks API cost per 1,000 rows?
- Does DataForSEO have a free trial for the Backlinks API?
- Can I use the DataForSEO Backlinks API without the $100 monthly minimum?
- How do I bulk check backlinks for multiple domains at once?
- What is the difference between live and standard backlink endpoints?
- Conclusion
Key Takeaways
- The DataForSEO Backlinks API indexes 2.02 trillion live backlinks across 289.5 million domains
- Cost structure: $0.02 per request + $0.00003 per row returned ($0.05/1K total)
- Bulk endpoints accept up to 1,000 targets per request, essential for agency-scale work
- DataForSEO wins on cost and programmatic scale; Ahrefs wins on raw index depth for niche sites
- The $100/month minimum disappears when you connect via integration connectors
$0.05
Per 1,000 rows
2.02T
Live backlinks indexed
9 + 5
Main + bulk endpoints
100x
Cheaper than Ahrefs API
What Is the DataForSEO Backlinks API and How Does It Work?
The DataForSEO Backlinks API is a programmatic interface to one of the largest independent backlink databases available: 2.02 trillion live backlinks, 207.9 billion indexed pages, and 289.5 million domains. Historical data goes back to 2019, which means you can track link acquisition and loss over time, not just snapshot the current state.
This is the Backlink Intelligence Stack in its first layer: the Discover layer. You’re pulling raw link data about who links to you, with what anchor, from what domain rating, and whether the link is still live or broken.
The API uses Basic Auth: base64 encode your login:password, pass it as the Authorization header. Rate limit is 2,000 requests per minute. For auth setup and credential management, see the DataForSEO API guide.
Task-based vs live mode
Every endpoint has two modes:
Live mode: Returns data instantly in the response body. Higher cost, but no polling required. Best for single queries and real-time lookups.
Standard mode: Submits a task to an async queue and returns a task ID. You poll for results later. Lower cost per row, better for batch processing.
For most programmatic use cases, I use live mode for single-domain lookups (speed matters) and standard mode for bulk jobs (cost matters).
The 9 main endpoints
/backlinks/backlinks: full backlink profile for a target/backlinks/anchors: anchor text distribution/backlinks/referring_domains: unique linking domains/backlinks/referring_networks: IP/ASN diversity/backlinks/referring_pages: pages that link to the target/backlinks/domain_intersection: shared backlinks between two domains/backlinks/domain_pages: all pages on a domain sorted by inbound links/backlinks/history: historical link counts (monthly snapshots since 2019)/backlinks/page_intersection: shared backlinks between two URLs
How Much Does the DataForSEO Backlinks API Cost Compared to Ahrefs?
DataForSEO charges $0.02 per API request plus $0.00003 per row returned. For a query that returns 1,000 backlinks, that works out to $0.02 + $0.03 = $0.05 total. One thousand backlinks for a nickel. This is the Discover layer cost structure in the Backlink Intelligence Stack.
Here’s how it compares across providers:
| Provider | Per 1,000 Backlinks | Monthly Minimum |
|---|---|---|
| DataForSEO | $0.05 | $100 (waivable) |
| Majestic | $0.036 | $400 |
| Semrush | $2.00 | $500 |
| Moz | $2.08 | $250 |
| Ahrefs | $5.00 | $1,499 |
Real cost scenarios
Agency auditing 10,000 domains per week:
– DataForSEO: ~$2.60/week ($135/year)
– Semrush: ~$20/week (requires Business plan minimum $499/month)
– Ahrefs: ~$50/week (requires Enterprise plan minimum $1,499/month)
Solo developer running 2-3 bulk audits per month:
– DataForSEO: $2-5 total
– Any subscription tool: $100-$500 minimum regardless of usage
Majestic looks cheaper per row at $0.036, but their $400/month minimum kills the math for anyone doing less than 11 million rows per month. DataForSEO’s $100 minimum is a real consideration, but there’s a workaround that removes it entirely.
The minimum is waivable. Connecting via Make.com, n8n, or the official Google Sheets Connector removes the $100/month floor completely. You pay only per row returned. A developer running a handful of bulk audits per month pays $2-5 total instead of $100. This is DataForSEO’s most underreported feature.
Tip
DataForSEO offers a $1 free trial credit, enough for 20,000 backlink rows. That’s sufficient to run a meaningful test against any domain before committing to a plan.
How Do You Call the DataForSEO Backlinks API with Python?
The Discover layer of the Backlink Intelligence Stack starts here. The primary endpoint is POST /v3/backlinks/backlinks/live. It accepts a target (domain, URL, or subdomain), a mode controlling deduplication, a row limit, and an offset for pagination.
Parameters you need
target: the domain or URL to analyze (e.g.,"competitor.com")mode:"as_is"(all links),"one_per_domain"(deduplicated by domain),"one_per_anchor"(deduplicated by anchor text)limit: rows to return, max 1,000 per requestoffset: pagination start position (use for domains with 1,000+ backlinks)
Response fields worth capturing
url_from: the page that contains the linkurl_to: the page being linked toanchor: anchor text of the linkdomain_from_rank: domain rating of the linking domain (0-100 scale)page_rank: page-level authority of the linking pageis_broken: whether the link is returning a 4xx/5xx errorfirst_seen: date DataForSEO first indexed this backlink
Working Python code
import requests
import base64
from tenacity import retry, stop_after_attempt, wait_exponential
LOGIN = "your_dataforseo_login"
PASSWORD = "your_dataforseo_password"
credentials = base64.b64encode(f"{LOGIN}:{PASSWORD}".encode()).decode()
HEADERS = {
"Authorization": f"Basic {credentials}",
"Content-Type": "application/json",
}
@retry(
stop=stop_after_attempt(3),
wait=wait_exponential(multiplier=1, min=2, max=10),
)
def get_backlinks(target: str, limit: int = 1000, offset: int = 0) -> list:
payload = [{
"target": target,
"mode": "one_per_domain",
"limit": limit,
"offset": offset,
"filters": [["is_broken", "=", False]],
}]
try:
response = requests.post(
"https://api.dataforseo.com/v3/backlinks/backlinks/live",
json=payload,
headers=HEADERS,
timeout=30, # API can be slow under load; timeout protects the caller
)
response.raise_for_status()
except requests.exceptions.Timeout:
raise # tenacity will retry with backoff
except requests.exceptions.HTTPError as e:
raise ValueError(f"HTTP {e.response.status_code}: {e.response.text[:200]}")
data = response.json()
task = data["tasks"][0]
if task["status_code"] != 20000:
raise ValueError(f"API error: {task['status_message']}")
return task["result"][0]["items"] or []
def get_all_backlinks(target: str) -> list:
"""Paginate through all backlinks for a domain."""
all_links = []
offset = 0
limit = 1000
while True:
batch = get_backlinks(target, limit=limit, offset=offset)
all_links.extend(batch)
if len(batch) < limit:
# Fewer results than limit means we've reached the end
break
offset += limit
# Rate limit: 2,000 req/min max; no sleep needed for single-domain pagination
return all_links
if __name__ == "__main__":
try:
links = get_all_backlinks("competitor.com")
print(f"Total backlinks: {len(links)}")
for link in links[:3]:
print(f" {link['url_from']} -> {link['url_to']}")
print(f" Anchor: {link['anchor']} | DR: {link['domain_from_rank']}")
except requests.exceptions.ConnectionError:
print("Connection failed. Check your network and try again.")
except ValueError as e:
print(f"API error: {e}")
Cost calculation for this code
One request to /backlinks/backlinks/live that returns 1,000 rows costs:
– $0.02 (request fee) + $0.03 (1,000 rows x $0.00003) = $0.05
For a domain with 5,000 backlinks, that’s 5 paginated calls: $0.10 + $0.15 = $0.25 total.
The most common mistake
Not paginating. The default limit is 100 rows. If you query a domain with 50,000 backlinks and forget to set limit=1000 and loop with offset, you get back 100 links and assume the profile is small. Always set limit: 1000 and loop with offset increments until the batch returns fewer rows than your limit. The pagination code above handles this correctly.
Source:
DataForSEO Backlinks API pricing: $0.02 per request + $0.00003 per row. Rate limit: 2,000 requests/minute. Source: dataforseo.com/pricing/backlinks/backlinks
How Do You Use the DataForSEO Bulk Backlinks Endpoints?

This is the Monitor layer of the Backlink Intelligence Stack. Instead of querying one domain at a time, bulk endpoints accept up to 1,000 targets in a single request. For agency work, competitor portfolio analysis, or ongoing link monitoring, this is the right tool.
The three bulk endpoints you’ll use most
/backlinks/bulk_backlinks: backlink count + domain rating for each target/backlinks/bulk_referring_domains: unique linking domain count per target/backlinks/bulk_new_and_lost_backlinks: new and lost link counts over a time window
The bulk endpoints don’t return full backlink rows. They return aggregate metrics. If you need the actual links for a subset of domains, use the bulk endpoint first to identify high-priority targets, then query those with the main /backlinks/backlinks/live endpoint.
Python code for a bulk domain check
import requests
import base64
from tenacity import retry, stop_after_attempt, wait_exponential
LOGIN = "your_dataforseo_login"
PASSWORD = "your_dataforseo_password"
credentials = base64.b64encode(f"{LOGIN}:{PASSWORD}".encode()).decode()
HEADERS = {
"Authorization": f"Basic {credentials}",
"Content-Type": "application/json",
}
@retry(
stop=stop_after_attempt(3),
wait=wait_exponential(multiplier=1, min=2, max=10),
)
def bulk_backlink_check(targets: list[str]) -> dict:
"""
Check backlink metrics for up to 1,000 domains at once.
Returns dict of {domain: {backlinks_count, referring_domains_count, rank}}
Note: bulk endpoints return one aggregate row per target, no pagination needed.
"""
payload = [{"targets": targets}]
try:
response = requests.post(
"https://api.dataforseo.com/v3/backlinks/bulk_backlinks/live",
json=payload,
headers=HEADERS,
timeout=30,
)
response.raise_for_status()
except requests.exceptions.Timeout:
raise # tenacity will retry
except requests.exceptions.HTTPError as e:
raise ValueError(f"HTTP {e.response.status_code}: {e.response.text[:200]}")
data = response.json()
task = data["tasks"][0]
if task["status_code"] != 20000:
raise ValueError(f"API error: {task['status_message']}")
results = {}
for item in task["result"][0]["items"]:
results[item["target"]] = {
"backlinks_count": item["backlinks"],
"referring_domains": item["referring_domains"],
"rank": item["rank"],
}
return results
if __name__ == "__main__":
competitors = [
"competitor1.com",
"competitor2.com",
"competitor3.com",
# ... up to 1,000 domains
]
try:
metrics = bulk_backlink_check(competitors)
for domain, data in sorted(
metrics.items(), key=lambda x: x[1]["backlinks_count"], reverse=True
):
print(f"{domain}: {data['backlinks_count']:,} backlinks, {data['referring_domains']:,} domains")
except ValueError as e:
print(f"API error: {e}")
Real cost scenario: competitor portfolio audit
I audited 500 competitor domains in April 2026 using this exact approach:
- Bulk backlinks check (500 domains, 1 request): $0.02
- Average backlinks per domain: ~250 (total ~125,000 rows)
- Row cost: 125,000 x $0.00003 = $3.75
- Total: $3.77 for 500-domain portfolio audit
The same audit on Semrush requires a Business plan at $499/month minimum. On a per-use basis, DataForSEO was 99.9% cheaper.
For advanced keyword-level analysis alongside your backlink work, the DataForSEO Labs API covers competitive keyword gap analysis at similarly low per-row pricing.
How Does DataForSEO Backlink Data Compare to Ahrefs Accuracy?
The Analyze layer of the Backlink Intelligence Stack is where you make decisions about the data. Those decisions require knowing what DataForSEO does well and where it has real limitations. Here’s the honest picture.
Where DataForSEO wins
Live freshness. The live endpoint returns data that’s typically crawled within hours or days, not weeks. Ahrefs indexes backlinks faster historically, but DataForSEO’s live mode reduces staleness for most practical queries.
Programmatic scale. When you’re checking hundreds or thousands of domains, pay-per-row pricing beats any subscription model. No plan upgrades, no quota resets, no overage charges.
No subscription lock-in. You can stop paying tomorrow and pick back up next month. Ahrefs and Semrush require annual commitments for meaningful API access.
Transparent ranking algorithm. DataForSEO publishes its domain rating methodology. Ahrefs’ DR formula is partially opaque.
Where Ahrefs wins
Raw index depth. Ahrefs indexes approximately 35 trillion backlinks including historical data. DataForSEO’s live index is 2.02 trillion. For mainstream high-traffic domains, the coverage is comparable. For obscure niche sites with thin link profiles, Ahrefs finds more links.
Discovery of recently built links. Ahrefs crawls new pages faster, which matters if you’re doing real-time link monitoring for brand-new content.
UI-based analysis. If you need a human to analyze a backlink profile without writing code, Ahrefs’ interface is significantly better.
Practical recommendation
Use DataForSEO for programmatic work: anything involving 10+ domains, automated monitoring, bulk competitor audits, or API-driven workflows. Use Ahrefs’ manual tools for single-site deep-dives where you need maximum index coverage or the visual interface.
For the work I do at NextGrowth, bulk competitor research, monitoring link acquisition across content clusters, and identifying toxic links programmatically, DataForSEO handles 95%+ of the use cases at a fraction of the cost.
Source:
DataForSEO index: 2.02 trillion live backlinks, historical since 2019. Source: dataforseo.com/apis/backlinks-api. Ahrefs historical index figure referenced via DataForSEO’s published competitive analysis.
When Should You NOT Use the DataForSEO Backlinks API?
Being honest about limitations is the part most vendor-written content skips. Here’s where DataForSEO’s Backlinks API is the wrong tool.
The $100/month minimum is a real barrier for occasional users. If you’re running one backlink check per month for your own site, the math doesn’t work. You’d pay $100 for a query that costs $0.05. The workaround is the integration connectors (Make.com, n8n, Google Sheets) that remove the minimum entirely. But if you’re not already using those tools, that’s extra setup cost.
Index size gaps for niche and local sites. A local plumber with 47 backlinks from local directories: DataForSEO might find 30 of them. Ahrefs might find 45. For competitive analysis of thin-link-profile sites, Ahrefs has better coverage.
No toxicity score. DataForSEO returns spam scores and domain ratings but doesn’t surface a single “toxic link” metric. Neither does Ahrefs’ API (it’s a UI-only feature there too), but if your workflow depends on automated toxic link detection, you’ll need to build your own scoring logic on top of the raw data.
Developers only. There’s no UI. No dashboard. No drag-and-drop link export. If your team needs a non-technical person to run backlink audits, DataForSEO requires a custom tool or integration layer in front of it.
Alternatives for low-volume use
- Ahrefs Webmaster Tools: free, but limited to your own domain only
- Google Search Console: shows links from Google’s index to your domain, no competitors
- Majestic free tier: limited row access, no API without paid plan
If you’re building a larger SEO workflow that reduces tooling costs, see the guide on replacing SEO tools with DataForSEO, which covers consolidating multiple $100/month subscriptions into pay-per-use API calls.
For a complete DataForSEO review, including pricing, hands-on API test results, and who it is for, see our dedicated review.
FAQ
What is the DataForSEO Backlinks API?
The DataForSEO Backlinks API is a REST API that provides programmatic access to backlink data: who links to a domain, with what anchor text, from what domain authority, and whether links are live or broken. It indexes 2.02 trillion live backlinks and supports 9 main endpoints plus 5 bulk endpoints for large-scale queries.
How accurate is DataForSEO’s backlink data compared to Ahrefs?
For mainstream domains with substantial link profiles, accuracy is comparable. DataForSEO indexes 2.02 trillion live backlinks; Ahrefs indexes approximately 35 trillion including historical. The gap matters most for niche or local sites with few backlinks. For programmatic analysis at scale, DataForSEO’s live data freshness is strong and the cost difference is decisive.
How much does the DataForSEO Backlinks API cost per 1,000 rows?
DataForSEO charges $0.02 per API request plus $0.00003 per row returned. For a request that returns 1,000 rows, total cost is $0.05 ($0.02 + $0.03). This is 100x cheaper than Ahrefs API ($5.00/1K) and 40x cheaper than Semrush ($2.00/1K). Majestic is the only competitor with a lower per-row rate ($0.036/1K), but requires a $400/month minimum.
Does DataForSEO have a free trial for the Backlinks API?
Yes. DataForSEO offers a $1 trial credit after signup, which covers approximately 20,000 backlink rows. This is enough to run a meaningful test on several domains before committing to the $100/month minimum plan. You can test the live endpoint, bulk endpoints, and pagination behavior within the free credit.
Can I use the DataForSEO Backlinks API without the $100 monthly minimum?
Yes. Connecting via Make.com, n8n, or the official Google Sheets Connector removes the $100/month minimum entirely. Through these integrations, you pay only per row returned with no monthly floor. A developer running 2-3 bulk audits per month typically pays $2-5 total. This makes DataForSEO accessible at any usage level, not just enterprise scale.
How do I bulk check backlinks for multiple domains at once?
Use the /backlinks/bulk_backlinks/live endpoint. Pass a targets array with up to 1,000 domain strings in a single request. The response includes backlink count, referring domain count, and domain rank for each target. For the actual backlink rows on priority domains, follow up with the main /backlinks/backlinks/live endpoint for individual queries.
What is the difference between live and standard backlink endpoints?
Live endpoints return data synchronously in the API response: instant results, higher per-row cost. Standard endpoints submit a task to an async queue; you poll for results using a task ID. Standard mode costs less per row and works better for high-volume batch jobs where latency doesn’t matter. For single-domain lookups and real-time workflows, use live mode.
Conclusion
The Backlink Intelligence Stack (Discover, Analyze, Monitor) maps cleanly to DataForSEO’s endpoint categories: live backlinks for discovery, anchors and domain intersection for analysis, and bulk new/lost for monitoring. At $0.05 per 1,000 rows versus $5.00 for Ahrefs, the cost math is clear for any programmatic workflow.
The $1 free trial gives you 20,000 backlink rows to validate against your actual domains before committing to anything. If the results look useful, the $100/month plan covers serious bulk usage. If you connect via Make.com or n8n, you skip the minimum entirely and pay only for what you query. Start with the free credit.
For teams who want to access the same DataForSEO backlinks data without writing Python, the DataForSEO MCP server connects the API directly to Claude’s interface, no code required.
