example.comAhrefs new and lost backlinks · Claude Code
17 referring domains gained, 6 lost
Ahrefs found 17 new referring domains and 6 lost this week; the live count is 1,284 (+11). The strongest new link is a DR 90 dev.to article citing the late payments study; the costliest loss is a DR 80 alternatives page that now redirects.
New this week (top 4 of 17)
Domain
DR
Links to
Anchor
dev.to
90
/blog/late-payments-study
a study of 40,000 invoices
indiehackers.com
79
/pricing
transparent pricing
freelance-weekly.example
54
/templates/invoice-pdf
free invoice template
saas-directory.example
47
/
Example
Lost this week (top 3 of 6)
Domain
DR
Reason
Was linking to
alternatives-hub.example
80
Redirected
/
accounting-blog.example
58
Link removed
/blog/net-30-payment-terms
old-partner.example
41
Page not found
/integrations
Email alternatives-hub.example first: the page moved to a new URL, and asking for the link there is an easy yes.
An example with made-up numbers. Your agent posts your real ones.
What it does
Links arrive and disappear without telling you. A blogger cites your study, a directory drops your listing in a redesign, a partner page starts redirecting. Ahrefs records all of it, but the New and Lost tabs mix strong links with scraped junk, and the useful few are easy to miss.
The agent asks the Ahrefs API for the week's changes, keeps one link per referring domain, drops the low-quality ones and ranks the rest by Domain Rating. Lost links come with their reason, because a removed link and a page that now redirects call for different emails.
How it works
Ah
1Pull links that changed this week
Call the Ahrefs API v3 site-explorer/all-backlinks endpoint with target=example.com, mode=subdomains, history=since:<7 days ago> and aggregation=1_per_domain, so each referring domain appears once. Select the linking and target URLs, anchor, the source's Domain Rating, follow status and the first-seen and lost dates.
2
2Split new from lost
A link is new when it was first seen in the last 7 days, and lost when its lost date falls in that window. Keep the reason Ahrefs gives for each lost link: Link removed, Not found, 301/302 redirect, Noindex, Dropped or Crawl errors.
3
3Drop the noise
Leave out sources below DR 20, nofollow links from comment sections and forums, and domains that look like scrapers or mirrors (thousands of outbound links, no organic traffic).
Ah
4Add the live totals
Read site-explorer/backlinks-stats for the live count of referring domains, and keep last week's figure so the card can show the net change.
5
5Write the follow-ups
New links by DR with anchor and target page, then lost links with the reason and a suggested next step: ask to restore a removed link, or to point a redirected one at your new URL.
Post it to the board
With BRIEFKIN_TOKEN set, the agent sends the result as one card that updates in place every run. Without it, you get the report in the chat.
What you get
Net change in referring domains this week: new, lost and the live total.
New links worth knowing about, by Domain Rating: source, target page, anchor and follow status.
Lost links with the reason Ahrefs gives and a follow-up for each.
The one outreach email to send first.
Install and run it
Pick your agent, where the data comes from and how to schedule it; the commands below follow.
Agent
Data
Schedule
Install the skill
One command. It puts the SKILL.md in ~/.claude/skills and in ~/.agents/skills, which Codex, Cursor, Gemini CLI, Copilot CLI and OpenCode read too.
shellcurl -fsSL https://briefkin.dev/skills/ahrefs-new-and-lost-backlinks/install | sh
Run it
Ask Claude Code:
promptRun the ahrefs-new-and-lost-backlinks skill
Or paste the prompt instead of installing:
promptUsing the Ahrefs API v3, find backlink changes for example.com in the last 7 days: call site-explorer/all-backlinks with mode=subdomains, history=since:[date 7 days ago] and aggregation=1_per_domain. Split links first seen this week (new) from links lost this week, keeping the lost reason. Drop sources under DR 20 and obvious scraper sites. List new links by Domain Rating with source URL, target page, anchor and follow status, and lost links with the reason and a suggested follow-up (restore a removed link, update a redirected one). Give the net change in referring domains, and tell me the one outreach email to send first.
Put it on a schedule
Fridays at 10:00, from cron on any machine where Claude Code is signed in:
crontab0 10 * * 5 claude -p "Run the ahrefs-new-and-lost-backlinks skill"
Add it with crontab -e. A laptop asleep at that time runs it when it wakes if you use launchd or Task Scheduler instead; GitHub Actions works for the API route.
Send it to your board
Connect Briefkin once with curl -fsSL https://briefkin.dev/install | sh and every run lands on your board as a report card. How setup works
SKILL.md---
name: ahrefs-new-and-lost-backlinks
description: "Every Friday, the referring domains Ahrefs found linking to you this week, the ones that stopped, and the links worth a follow-up email. Use when the user asks for this, or when it runs on a schedule."
---
# Ahrefs new and lost backlinks
Every Friday, the referring domains Ahrefs found linking to you this week, the ones that stopped, and the links worth a follow-up email.
Links arrive and disappear without telling you. A blogger cites your study, a directory drops your listing in a redesign, a partner page starts redirecting. Ahrefs records all of it, but the New and Lost tabs mix strong links with scraped junk, and the useful few are easy to miss.
The agent asks the Ahrefs API for the week's changes, keeps one link per referring domain, drops the low-quality ones and ranks the rest by Domain Rating. Lost links come with their reason, because a removed link and a page that now redirects call for different emails.
## Two ways to get the data
Use the API or MCP route when you have an MCP server, a CLI or an API token for the app. Otherwise, if you can drive a browser the user is signed in to (Claude in Chrome, a Playwright or Chrome DevTools MCP server), use the browser route. Say which one you used.
## Route A: API or MCP server
### What you need
- An Ahrefs plan with API access (Lite and above since mid-2026) and an API key, kept in `AHREFS_API_KEY` or held by the official Ahrefs MCP server.
- Room in your API units: each request is charged by the rows and fields it returns, with a 50-unit minimum, so the skill selects only the fields above.
If something is missing, say what and stop; do not invent numbers.
### Steps
1. **Pull links that changed this week** (Ahrefs): Call the Ahrefs API v3 `site-explorer/all-backlinks` endpoint with `target=example.com`, `mode=subdomains`, `history=since:<7 days ago>` and `aggregation=1_per_domain`, so each referring domain appears once. Select the linking and target URLs, anchor, the source's Domain Rating, follow status and the first-seen and lost dates.
2. **Split new from lost**: A link is new when it was first seen in the last 7 days, and lost when its lost date falls in that window. Keep the reason Ahrefs gives for each lost link: Link removed, Not found, 301/302 redirect, Noindex, Dropped or Crawl errors.
3. **Drop the noise**: Leave out sources below DR 20, nofollow links from comment sections and forums, and domains that look like scrapers or mirrors (thousands of outbound links, no organic traffic).
4. **Add the live totals** (Ahrefs): Read `site-explorer/backlinks-stats` for the live count of referring domains, and keep last week's figure so the card can show the net change.
5. **Write the follow-ups**: New links by DR with anchor and target page, then lost links with the reason and a suggested next step: ask to restore a removed link, or to point a redirected one at your new URL.
## Route B: the browser
### What you need
- Signed in to Ahrefs on a paid plan with Site Explorer access; no project is needed for the target.
If something is missing, say what and stop; do not invent numbers.
### Steps
Start at https://app.ahrefs.com/site-explorer. The user is signed in already; never type passwords or codes, and ask if a sign-in page appears.
1. **Open the Backlinks report for the site**: Open `https://app.ahrefs.com/site-explorer`, enter `example.com` with the mode set to `Subdomains`, and click `Backlinks` in the left menu.
2. **Read the new links**: Switch the report to `New` and set the period to `Last 7 days`. Set grouping to one link per domain, filter `DR` to 20 and up and link type to `Dofollow`, then sort by DR and note source, target page and anchor for the top rows.
3. **Read the lost links with reasons**: Switch to `Lost` for the same 7 days and keep the DR filter. Read each row's lost reason (Link removed, Not found, 301/302 redirect, Noindex, Dropped, Crawl errors); the status filter narrows to one reason at a time.
4. **Take the live total**: Go back to `Overview` and read the `Referring domains` figure, with last week's number for the net change.
5. **Write the follow-ups**: Skip scraper-looking domains. Suggest an email for each lost link worth keeping: ask to restore a removed link, or to point a redirected page at your new URL.
Note: The UI counts can differ from the API by a few links because of crawl timing and the spam filter. Each table pages at 100 rows; for a site gaining hundreds of links a week, use Export and read the file.
## The report
- **Net change in referring domains** this week: new, lost and the live total.
- **New links** worth knowing about, by Domain Rating: source, target page, anchor and follow status.
- **Lost links** with the reason Ahrefs gives and a follow-up for each.
- The one outreach email to send first.
## Post it to Briefkin
When `BRIEFKIN_TOKEN` is set, or `~/.config/briefkin/env` exists (the installer from https://briefkin.dev/docs writes it), also send the result to the user's Briefkin board as one card. Keep the `item_key` the same on every run so the card updates in place, use a new `event_id` per run, and put today's real numbers in place of the example ones. If the request fails, say so once and carry on.
```bash
[ -n "${BRIEFKIN_TOKEN:-}" ] || . ~/.config/briefkin/env
curl -sS -X POST "${BRIEFKIN_URL:-https://briefkin.dev}/v1/events" \
-H "authorization: Bearer $BRIEFKIN_TOKEN" \
-H "content-type: application/json" \
-d @- <<'JSON'
{
"v": 1,
"event_id": "ahrefs-new-and-lost-backlinks/<date of this run, e.g. 2026-10-16>",
"item_key": "ahrefs-new-and-lost-backlinks",
"project": "example.com",
"source": "Ahrefs new and lost backlinks skill",
"kind": "update",
"title": "17 referring domains gained, 6 lost",
"summary": "Ahrefs found **17 new referring domains** and **6 lost** this week; the live count is 1,284 (+11). The strongest new link is a DR 90 dev.to article citing the late payments study; the costliest loss is a DR 80 alternatives page that now redirects.",
"widget": [
{
"type": "Text",
"props": {
"text": "New this week (top 4 of 17)",
"variant": "heading"
}
},
{
"type": "Table",
"props": {
"columns": [
"Domain",
"DR",
"Links to",
"Anchor"
],
"align": [
"left",
"right",
"left",
"left"
],
"rows": [
[
"dev.to",
90,
"/blog/late-payments-study",
"a study of 40,000 invoices"
],
[
"indiehackers.com",
79,
"/pricing",
"transparent pricing"
],
[
"freelance-weekly.example",
54,
"/templates/invoice-pdf",
"free invoice template"
],
[
"saas-directory.example",
47,
"/",
"Example"
]
]
}
},
{
"type": "Text",
"props": {
"text": "Lost this week (top 3 of 6)",
"variant": "heading"
}
},
{
"type": "Table",
"props": {
"columns": [
"Domain",
"DR",
"Reason",
"Was linking to"
],
"align": [
"left",
"right",
"left",
"left"
],
"rows": [
[
"alternatives-hub.example",
80,
"Redirected",
"/"
],
[
"accounting-blog.example",
58,
"Link removed",
"/blog/net-30-payment-terms"
],
[
"old-partner.example",
41,
"Page not found",
"/integrations"
]
]
}
},
{
"type": "Callout",
"props": {
"text": "Email alternatives-hub.example first: the page moved to a new URL, and asking for the link there is an easy yes.",
"tone": "info"
}
}
]
}
JSON
```
Widgets come from the Briefkin catalog (https://briefkin.dev/v1/catalog). Without a token, just give the user the report.
## Run it on a schedule
Suggested: Fridays at 10:00 (`0 10 * * 5`). From cron, with the agent signed in on that machine:
```bash
0 10 * * 5 claude -p "Run the ahrefs-new-and-lost-backlinks skill"
# Codex: codex exec, Gemini CLI: gemini -p, Copilot CLI: copilot -p, OpenCode: opencode run
```
Or use the agent's own scheduler (Claude Code routines, Codex automations, Claude or ChatGPT scheduled tasks): https://briefkin.dev/skills/ahrefs-new-and-lost-backlinks#schedule
Source: https://briefkin.dev/skills/ahrefs-new-and-lost-backlinks
What your agent needs
An Ahrefs plan with API access (Lite and above since mid-2026) and an API key, kept in AHREFS_API_KEY or held by the official Ahrefs MCP server.
Room in your API units: each request is charged by the rows and fields it returns, with a 50-unit minimum, so the skill selects only the fields above.
AhConnecting Ahrefs
Ahrefs MCP server, Ahrefs' official remote server at https://api.ahrefs.com/mcp/mcp. In Claude, add Ahrefs from the connector directory and sign in to your workspace with OAuth (setup guide). For Claude Code, Codex or Cursor, use the same URL with an MCP key from Account settings > API keys ("Generate MCP key").
API v3 with a key. Call https://api.ahrefs.com/v3/... with Authorization: Bearer and the key from AHREFS_API_KEY. Whether you get API access, and how many units, depends on your Ahrefs plan.
These reports only read data, so the thing to manage is unit spend: keep limit low and schedule weekly rather than hourly.
Questions
Why does a lost link sometimes come back the next week?
Ahrefs marks a link lost when its crawler cannot find it, which can be a timeout or a page that was briefly down. For links lost to a crawl error, the agent waits a second week before suggesting an email, and says so when a lost link reappears.
Will this match the Links report in Search Console?
No. Search Console shows a sample of the links Google knows about, without dates, while Ahrefs uses its own crawler and timestamps every link. Ahrefs is better for spotting week-to-week changes; Search Console for what Google itself has seen.
Do I need Briefkin to use the Ahrefs new and lost backlinks skill?
No. The skill runs with your own agent and gives you the report in the chat. With a Briefkin token set, each run also posts it to your board as a report card, so you can glance at it instead of asking again.
Which agents can run it?
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot CLI, OpenCode, Windsurf and Amp all read SKILL.md files. The install command puts it in ~/.claude/skills and ~/.agents/skills, where they look. ChatGPT, the Claude app and Grok take the prompt instead. Pick your agent under "Install and run it" and the commands change to match.
Can it work without an API or MCP server, from my browser?
Yes. Switch the data source to "Your browser" and the steps change to the Ahrefs pages themselves: the agent opens app.ahrefs.com/site-explorer in a browser you are signed in to and reads the numbers off the page. Claude Code, Codex, Cursor, Claude app and ChatGPT can drive a browser out of the box; Gemini CLI, Copilot CLI and OpenCode need a Playwright or Chrome DevTools MCP server first. It is slower than the API and needs you signed in, so it suits a report you run by hand or from a scheduler on your own computer.
Skills are free to use with any agent. Briefkin is where their results land: one board for every report, number and question your agents send, with a ping when something needs you.