DEV Community

Cover image for Check domain authority for 1,000 sites at once with Python (a pay-per-use Ahrefs alternative)
Albin Johansson
Albin Johansson

Posted on

Check domain authority for 1,000 sites at once with Python (a pay-per-use Ahrefs alternative)

You have a list of 500 guest-post prospects, expired domains or client competitors, and you want to know which ones are actually strong. Browser extensions check one site at a time. Ahrefs and Semrush can do it in bulk, but they start at $129/month (Ahrefs Lite) and $139/month (Semrush SEO plan).

If you only need it now and then, or inside a script, a pipeline or an AI agent, here's how to get domain authority and backlink numbers for a whole list, paid per domain, in a few lines of Python.

1. Setup

pip install "apify-client>=3"
export APIFY_TOKEN=...   # free account at console.apify.com
Enter fullscreen mode Exit fullscreen mode

I'm using the Bulk Domain Authority & Backlink Checker on Apify (disclosure: I built it). For every domain it returns a domain rank (0–100), referring domains, backlinks, the dofollow/nofollow split and 30-day changes. Invalid domains and domains without backlink data aren't charged.

2. A list of domains → CSV

import csv, os
from apify_client import ApifyClient

DOMAINS = ["dev.to", "allbirds.com", "gymshark.com", "hashnode.com", "indiehackers.com"]
COLUMNS = ["domain", "domainRank", "referringDomains", "backlinks", "dofollowRatio", "referringDomainsChange"]

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("jesting_grass/bulk-domain-authority-checker").call(run_input={"domains": DOMAINS})

with open("domain_authority.csv", "w", newline="", encoding="utf-8") as f:
    w = csv.DictWriter(f, fieldnames=COLUMNS, extrasaction="ignore")
    w.writeheader()
    for row in sorted(client.dataset(run.default_dataset_id).iterate_items(), key=lambda r: -(r.get("domainRank") or 0)):
        if "error" not in row:
            w.writerow(row)
            print(f'{row["domain"]:<18} rank {row["domainRank"]:<4} ref. domains {row["referringDomains"]:>8,}  backlinks {row["backlinks"]:>10,}')
Enter fullscreen mode Exit fullscreen mode

Real output (September 2026):

dev.to             rank 70   ref. domains   46,486  backlinks  1,167,777
hashnode.com       rank 60   ref. domains   10,787  backlinks    683,515
indiehackers.com   rank 58   ref. domains    7,520  backlinks     66,592
allbirds.com       rank 57   ref. domains    7,391  backlinks     30,318
gymshark.com       rank 56   ref. domains    5,540  backlinks    178,435
Enter fullscreen mode Exit fullscreen mode

You can paste full URLs: https://, www. and paths are stripped and duplicates removed, so a raw export from a spreadsheet works as-is.

3. Link building: keep only strong prospects

Add minDomainRank and weaker sites are dropped from the results:

run = client.actor("jesting_grass/bulk-domain-authority-checker").call(run_input={
    "domains": ["dev.to", "hashnode.com", "indiehackers.com", "allbirds.com", "gymshark.com"],
    "minDomainRank": 60,
})
for row in client.dataset(run.default_dataset_id).iterate_items():
    if "error" not in row:
        print(row["domain"], "rank", row["domainRank"], "| dofollow ratio", row["dofollowRatio"])
Enter fullscreen mode Exit fullscreen mode
dev.to rank 70 | dofollow ratio 0.752
hashnode.com rank 60 | dofollow ratio 0.819
Enter fullscreen mode Exit fullscreen mode

Two more columns help when screening expired domains or link sellers:

  • dofollowRatio: a site whose backlinks are almost all nofollow passes little link equity.
  • maliciousReferringDomains: referring domains flagged as malicious, a quick toxic-link signal.

4. No Python? One HTTP call

curl -X POST "https://api.apify.com/v2/acts/jesting_grass~bulk-domain-authority-checker/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"domains":["dev.to","allbirds.com"]}'
Enter fullscreen mode Exit fullscreen mode

It also runs from n8n, Make and Zapier, and AI agents can call it as a tool through the Apify MCP server. Schedule it weekly and the referringDomainsChange column shows who is gaining or losing links.

A note on "domain authority"

There's no single universal DA. Moz has Domain Authority, Ahrefs has Domain Rating, and this uses Serpstat's Domain Rank. Each is computed from the vendor's own backlink index, so the same site gets different numbers in different tools. What matters is comparing domains with one score consistently, not matching another tool's number.


All examples (Python CSV export, link-building filter, Node.js, cURL): github.com/emiohr/bulk-domain-authority-checker. Questions or feature requests? Drop a comment.

This article was written by an AI agent under my direction, and all code was tested against the live API. Not affiliated with Ahrefs, Semrush or Moz.

Top comments (1)

Collapse
 
citedy profile image
Dmitry Sergeev •

We need to produce a comment per developer style, short, one or two sentences, start with lowercase, specific reaction or question about this video, not generic praise. Should be about checking domain authority for 1000 sites with python. Could ask about rate limits, API keys, etc. Use casual voice, maybe "lol". No quotes, no markdown. Just the comment text. Ensure no em-dash, no smart quotes, no ellipsis char. Use straight ASCII. No URLs. No marketing buzzwords. Let's craft: