Backlink Quality Audit Notebook: DataForSEO, Embeddings and Claude
A backlink export is thousands of rows with a handful of metrics per link, and most of the work is deciding which rows deserve a human look. This free Google Colab notebook turns a backlink profile into a short, explainable list: referring domains worth knowing about, spam you can ignore, links a person should check, and broken backlinks you could reclaim. Clear cases are decided by transparent rules and only the ambiguous middle goes to Claude, so you can see why every link landed where it did.
Who it’s for
SEOs, link builders and agencies who audit backlink profiles regularly and want a repeatable first pass that is cheap to run and easy to explain to a client. It is also useful if you sell courses or templates: download and “group buy” pages copy your product names and look clean to every metric, so the notebook sends them to review instead of trusting them.
How to use it
- Open the notebook in Colab and run it with
USE_SAMPLE = True. It replays a real audit of mlforseo.com from November 2026, with no keys and no cost. - Set your domain and a one-line description of your site, which the relevance step compares every link against.
- Check the worst-case cost estimate, then add your DataForSEO login and password and your Anthropic API key as Colab secrets.
- Run the collection: five DataForSEO Backlinks API calls for the summary, referring domains, one backlink per domain, anchors and broken links. Spend caps and a local cache stop surprises and repeat charges.
- Read the four buckets and the reclamation list, then export.
What you get
- Rule features per link: spam score band, domain rank band, follow or nofollow, position on the page, anchor type and link age
- A relevance score from cosine similarity between each link and your site description, using a small local embedding model
- Claude verdicts with a short reason and a confidence, only for the rows the rules can’t settle
- Valuable, Neutral, Likely spam and Investigate buckets, each saying who decided and why
- Broken backlinks grouped by dead URL with a suggested redirect target fuzzy-matched from your sitemap, plus CSVs, an Excel workbook and a cost log
Costs and limits
You pay DataForSEO per request and per row returned, and Anthropic per token. The sample run on mlforseo.com, with 288 referring domains, cost under $0.20 in total across both. Prices change, so check both pricing pages before a large run.
Every score here is a proxy. DataForSEO’s rank and spam score are its own metrics, and the relevance score and Claude only see link metadata. Claude’s verdicts also vary a little between runs, so the notebook keeps every response. Treat the Likely spam bucket as a list to understand: Google says disavowing is rarely needed.
Read the walkthrough in Score Backlink Quality in Python: DataForSEO, Embeddings and Claude, and start from the AI-powered backlink strategy guide for the wider picture.
What’s included
- Sorts referring domains into Valuable, Neutral, Likely spam and Investigate, with who decided and why
- Transparent rules settle the clear cases; only the ambiguous middle goes to Claude
- Relevance from a small local embedding model, no extra key needed
- Broken backlinks grouped by dead URL with a suggested redirect target from your sitemap
- Runs on a saved real audit of mlforseo.com with no keys; spend caps and a cache on live runs
Where this resource is used on MLforSEO
Walkthroughs on the blog
Concepts behind it
More content audits resources
- Coding Script or NotebookFuzzy Booster: Match Top Search Console Queries to Titles, Metas and H1s
- Coding Script or NotebookScreaming Frog Custom Extraction Helper: Selector Tester and Dataset Cleaner
- Coding Script or NotebookFuzzy Matching for SEO in Python: Scorers, Redirects and Library Comparison
- WorkbookEntity Audit and Prioritisation Workbook: mlforseo.com Masterclass Example
- Coding Script or NotebookLink Blocks for WordPress: Related Posts, Topic Cards, Siblings and Mentions
- Coding Script or NotebookInternal Link Menu Notebook: Priority Score and Versioned Recommendations
See all 28 content audits resources →See all 15 reporting resources →See all 73 coding script or notebook resources →
