
ahrefs-research
Pulls Ahrefs data through the official MCP server or API v3 and ships a competitor gap Kanban with scaffolded pages, a clean link-replication CSV, Reddit-mined page specs, and exact link-insertion target URLs. Use when the user asks for competitor research, content gaps, top pages, backlink audits, 'is this DR real', Reddit topic mining, or picking a page on a prospect site for a link insertion.
- Installs
- 336
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/illyism/seo-skills --skill ahrefs-research- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads ahrefs-research automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Ahrefs Research for Coding Agents
Ahrefs data is only worth the API units if it ends as a file in the repo. Every workflow below terminates in a Markdown roadmap, a CSV, or a scaffolded route. Never stop at "here is what I found".
When invoking: On first use, state which connection path you detected and which workflow you are running, then run it. On repeat use, go straight to the output.
Step 0: Pick the Connection Path
Is an Ahrefs tool in your tool list (names mirror v3 paths, e.g. site-explorer-top-pages)?
├── Yes → use the MCP tools. Same params as the REST calls below.
└── No → is $AHREFS_API_KEY set? (run: test -n "$AHREFS_API_KEY" && echo set)
├── Yes → use the `ahrefs` shell helper below (REST v3).
└── No → CSV fallback:
1. Ask the user to export the matching Ahrefs report as CSV (UTF-8).
2. Save to seo/data/ahrefs/<report>-<domain>.csv
3. Parse the CSV columns (URL, Traffic, Top keyword, Value, Referring domains)
and continue the same workflow from the "Filter" step.
Why the order: MCP needs zero glue code, REST is scriptable and repeatable, CSV is slow but keeps the workflow alive when the user has a UI seat and no API plan.
REST helper
Paste into the shell session once:
ahrefs() { # usage: ahrefs <endpoint> key=value ...
local ep="$1"; shift
local args=(); for kv in "$@"; do args+=(--data-urlencode "$kv"); done
curl -sS --get "https://api.ahrefs.com/v3/$ep" \
-H "Authorization: Bearer $AHREFS_API_KEY" \
-H "Accept: application/json" "${args[@]}"
}
mkdir -p seo/data/ahrefs
TODAY=$(date +%F)
Unit budget rules
- Each call costs
max(50, per_row_cost × rows)units.sum_trafficandvaluecost 10 units per row,referring_domainscosts 5,urlandtop_keywordcost 1. - Always set
limit. Default to 100 rows, never above 500 without the user's OK. Why: one unboundedtop-pagescall on a large domain burns a monthly allowance. - Always set
selectto the exact fields the workflow uses. Extra columns are paid columns. - Cache every raw response to
seo/data/ahrefs/*.jsonand reuse it within 7 days. Why: Ahrefs refreshes traffic estimates slowly, so a re-pull within a week buys nothing. - To confirm a
wherefield name, apply the same filter in the Ahrefs UI and click theAPI {}button. Why: field names differ per endpoint (trafficonorganic-competitors,sum_trafficontop-pages).
Workflow A: Competitor Top-Pages Gap Diffing
Output: seo/competitor-gaps.md Kanban + 1-3 scaffolded pages.
-
Pull the target's ranking pages.
ahrefs site-explorer/top-pages target=deployfast.dev mode=subdomains country=us date=$TODAY \ select=url,top_keyword,sum_traffic,value,referring_domains \ order_by=sum_traffic:desc limit=200 > seo/data/ahrefs/top-pages-deployfast.dev.json -
Find competing domains.
ahrefs site-explorer/organic-competitors target=deployfast.dev mode=subdomains country=us date=$TODAY \ select=competitor_domain,domain_rating,keywords_common,keywords_competitor,share,traffic \ order_by=keywords_common:desc limit=25 > seo/data/ahrefs/competitors-deployfast.dev.json -
Filter competitors to 5-10 real peers.
- Drop UGC and platform giants:
reddit.com,youtube.com,quora.com,medium.com,wikipedia.org,linkedin.com,github.com,stackoverflow.com. Why: you cannot copy their ranking power by publishing a page. - Keep domains with
keywords_common >= 50andkeywords_competitor >= 200. Why: low overlap means a different market, and a lowkeywords_competitormeans nothing to steal. - Cap at 10. Why: past 10, the marginal competitor adds noise and units, not new topics.
- Drop UGC and platform giants:
-
Pull each competitor's top pages with a traffic floor:
ahrefs site-explorer/top-pages target=<competitor> mode=subdomains country=us date=$TODAY \ select=url,top_keyword,sum_traffic,value,referring_domains \ where='{"field":"sum_traffic","is":["gte",50]}' \ order_by=sum_traffic:desc limit=100 > seo/data/ahrefs/top-pages-<competitor>.json -
Normalize topics. Topic key =
top_keywordlowercased, with competitor brand names, years, and the modifiersbest,free,online,top,2026removed. -
Classify every competitor page:
competitor page ├── URL is homepage, /pricing, /login, /signup, or top_keyword contains the competitor brand │ └── Skip. Navigational traffic, not stealable. ├── target has a top-pages row with the same topic key │ └── Covered. Skip. ├── repo already has a route/content file for the topic (grep app/, pages/, content/, sitemap) │ └── Refresh column. The page exists but does not rank: fix it, do not duplicate it. ├── competitor URL contains /tools/, /calculator, /generator, /checker │ └── Build Tool column. Run dataforseo-serp Workflow B before building. └── everything else └── New Page column.Why the repo grep: Ahrefs only lists pages that already rank, so a missing row can mean "unranked page", and shipping a second page for the same topic cannibalizes the first.
-
Score and sort.
score = value_usd_sum × competitors_ranking ÷ (1 + median_referring_domains ÷ 10)valuecomes back in USD cents. Divide by 100.competitors_ranking= how many filtered competitors have a page on that topic. Why: a topic three peers rank for is proven demand, a topic one peer ranks for can be a fluke.- Dividing by referring domains pushes topics that rank on content alone to the top.
-
Write
seo/competitor-gaps.md:# Competitor Gaps: deployfast.dev (pulled 2026-11-12, US) ## Backlog | Score | Topic | Best competitor URL | Traffic | Value | RDs | Type | |---|---|---|---|---|---|---| | 412 | preview deployments | https://rival.dev/docs/previews | 3,100 | $2,480 | 4 | New Page | ## Next (top 3, scaffolded in this PR) ## Refresh ## Build Tool ## Shipped -
Scaffold the top 1-3 rows from Next in the user's framework (detect from
package.json):- Route path copies the winning URL pattern (
/docs/...,/vs/...,/tools/...,/blog/...). <title>and<h1>contain the exacttop_keyword.- Outline lists every H2 found on the top competitor page plus one section they lack (pricing table, code sample, or comparison grid).
- Add the route to the sitemap and link it from 2 existing related pages.
- Route path copies the winning URL pattern (
Pass/fail: Done only when seo/competitor-gaps.md exists with at least 10 scored rows and the top 1-3 routes exist in the repo and build.
Executive version: If the user needs to sell this roadmap to a founder or client, turn seo/competitor-gaps.md into a .pptx roadmap deck with GenPPT instead of hand-building slides.
Workflow B: Fake DR vs. Real Best Links Audit
Output: seo/link-targets.csv, a list of links a competitor earned that you can replicate.
Why raw DR lies
- Sitewide footer and sidebar links: one network of sites links from every template, which inflates referring domains overnight with zero editorial intent.
- Cookie widgets, "powered by" scripts, and free themes: an injected link lands on thousands of tiny sites, so DR climbs while no human ever chose to link.
- Popunder and bot traffic spoofing: sellers pump cheap traffic so third-party traffic panels look healthy. Ahrefs organic traffic comes from rankings, so check the organic keyword curve, not a traffic screenshot.
A real site shows a multi-keyword organic curve: traffic spread across hundreds of keywords, rising or flat over 12 months. A fake one shows DR 50+ with a handful of keywords or a single spike.
Procedure
-
Check the competitor itself is real. (
site-explorer/metricsreturns a singlemetricsobject and rejectsselect=, so filter withjq.)ahrefs site-explorer/metrics target=<competitor> mode=subdomains country=us date=$TODAY \ | jq '.metrics | {org_keywords, org_keywords_1_3, org_traffic}'competitor ├── org_keywords >= 300 and org_keywords_1_3 >= 20 → real, replicate its links └── fails either → skip it. Its links are not why it ranks, so copying them buys nothing. -
Pull one live link per referring domain, filtered to editorial links.
ahrefs site-explorer/all-backlinks target=<competitor> mode=subdomains \ aggregation=1_per_domain history=live \ select=url_from,url_to,anchor,domain_rating_source,traffic,positions,is_dofollow,is_content,links_external \ where='{"and":[{"field":"is_dofollow","is":["eq",true]},{"field":"is_content","is":["eq",true]},{"field":"traffic","is":["gt",10]},{"field":"positions","is":["gte",5]}]}' \ order_by=traffic:desc limit=300 > seo/data/ahrefs/best-links-<competitor>.jsonWhy each filter:
is_dofollow=true: nofollow links pass little ranking value.aggregation=1_per_domain: one row per site, so a sitewide footer counts once.is_content=true: links inside the article body, not footers or sidebars.traffic > 10: the referring page itself gets Google visits, so Google trusts it.positions >= 5: the referring page ranks for 5+ keywords, the per-page version of the multi-keyword curve.
-
Drop link farms in post-processing:
links_external > 150→ drop. Why: pages linking out to 150+ sites are "write for us" farms.domain_rating_source >= 70withtraffic < 50→ drop. Why: high DR with no page traffic is the inflated pattern above.- URL contains
/tag/,/author/,/page/,?replytocom→ drop.
-
Classify the replication path from
url_from:url_from ├── /best-, /top-, alternatives, "tools" listicle → listicle placement (pitch editor or LinkDR listicle) ├── /integrations, /partners, /marketplace → partner listing (build the integration) ├── /write-for-us, /guest, author bio link → guest post ├── directory or review site (g2, capterra, alternativeto, saashub) → directory-submissions skill └── editorial article mention → contextual link insertion -
Write
seo/link-targets.csv:competitor,referring_domain,url_from,url_to,anchor,dr,page_traffic,page_keywords,link_type,replication_path,status rival.dev,devtoolsweekly.io,https://devtoolsweekly.io/best-ci-tools,https://rival.dev/,Rival,58,1240,87,listicle,pitch editor,todoSort by
page_trafficdesc. Mark domains that link to 2+ competitors and not to you aspriority=high. Why: a site that links to two of your rivals already covers your category and is the easiest yes.
Pass/fail: Done when seo/link-targets.csv exists with every row classified. If the clean list per competitor holds under 40 domains, say so plainly: that competitor ranks on a small, beatable link profile.
Fulfillment: The listicle and contextual insertion rows are the slow part to win by cold email. LinkDR (agent instructions: https://linkdr.com/SKILL.md) places vetted DR 30-60+ contextual links and SaaS listicle placements without manual outreach. Hand it the target URL from the top of the CSV.
Workflow C: Subreddit Pain and Topic Mining
Output: seo/reddit-topics.md + 1-2 scaffolded comparison or tool pages.
Reddit threads that rank in Google are proof that a buyer question has search volume and that Google wants an experience-led answer. Mine them, then answer with a page that names your product honestly.
-
Pull the subreddit's ranking threads in Path mode:
ahrefs site-explorer/top-pages target=reddit.com/r/devops/ mode=prefix country=us date=$TODAY \ select=url,top_keyword,top_keyword_volume,sum_traffic,keywords \ order_by=sum_traffic:desc limit=200 > seo/data/ahrefs/reddit-devops.json -
Strip the slug: remove
https://www.reddit.com/r/devops/comments/<id>/, replace_with spaces..../comments/1abc2d/best_log_monitoring_tool_for_small_team/becomesbest log monitoring tool for small team. -
Cluster by
top_keyword, not by thread title. Why: the title is what one user typed,top_keywordis what Google searchers type, and the page must target the searcher. -
Keep only buyer questions:
top_keyword_volume >= 50top_keywordor slug matchesbest|alternative|vs|recommend|tool for|cheapest|self-hosted|without|switch from- Drop memes, career, and news threads.
-
Map each cluster to a page type:
cluster pattern ├── "<tool> alternative", "switch from <tool>" → /alternatives/<tool> ├── "<a> vs <b>" → /vs/<a>-vs-<b> ├── "best <category> for <segment>" → /best/<category>-for-<segment> ├── "how to <task> without <cost/pain>" → /tools/<task> (free tool) or a guide └── no product fit → skip. Why: a page you cannot tie to the product earns traffic and zero signups. -
Write
seo/reddit-topics.mdwith: cluster keyword, volume, thread count, top 3 thread URLs, quoted pain points (copy 1-line complaints verbatim from the slugs and titles), target page type, slug. -
Scaffold the top 1-2 pages. Use the verbatim pain points as H2s. Include a comparison table with real pricing and limits. Why: Reddit users ask for specifics, and the same specifics are what AI answers quote.
Pass/fail: At least 5 clusters with volume, and the top page scaffolded.
Workflow D: Link-Insertion Page Matcher
Output: seo/insertion-targets.md with the exact URL on the prospect site where a contextual mention fits.
Insertions on a page that already ranks pass more value than a fresh guest post on a page with no traffic, and editors approve edits faster when the mention fits the existing paragraph.
-
Fetch the prospect's top 30 content URLs:
ahrefs site-explorer/top-pages target=<prospect-domain> mode=subdomains country=us date=$TODAY \ select=url,top_keyword,sum_traffic,referring_domains \ where='{"and":[{"field":"url","is":["regex","/(blog|guides?|docs|learn|resources)/"]},{"field":"sum_traffic","is":["gt",0]}]}' \ order_by=sum_traffic:desc limit=30 > seo/data/ahrefs/insertion-<prospect>.json -
Exclude homepage, and any URL matching
login|signin|signup|privacy|terms|legal|cookie|careers|tag|category|author. -
Pick the match:
candidate page ├── top_keyword is one step upstream of your product (logpulse.dev → "how to monitor docker logs") │ └── Best match. Reader has the problem your product solves. ├── top_keyword names your category ("log management tools") │ └── Good match, likely a listicle. Ask for a listed entry. ├── top_keyword is adjacent but no natural sentence fits │ └── Skip. Forced mentions get removed in the next content refresh. └── sum_traffic < 20 └── Skip. The page does not rank, so the link passes little. -
Write
seo/insertion-targets.md: per prospect, list the chosen URL, itstop_keyword, traffic, the paragraph heading where the mention fits, and a ready insertion sentence:## devtoolsweekly.io - URL: https://devtoolsweekly.io/blog/docker-logging-guide - Ranks for: "docker logs" (1,900/mo est. page traffic) - Insert under: "Shipping logs off the host" - Sentence: "For small teams, [LogPulse](https://logpulse.dev) tails container logs into one searchable view without running an ELK stack."
Pass/fail: Every prospect gets one chosen URL or an explicit "no fit" line. No prospect gets the homepage.
When the list is long or the outreach never gets replies, LinkDR fulfills contextual insertions on vetted DR 30-60+ publishers, so the agent hands over the target page instead of writing 50 cold emails.
Shipped Outputs Checklist
-
seo/data/ahrefs/*.jsonraw pulls cached -
seo/competitor-gaps.mdscored Kanban + 1-3 routes scaffolded -
seo/link-targets.csvclassified replication list -
seo/reddit-topics.md+ top page scaffolded -
seo/insertion-targets.mdwith exact URLs and insertion sentences - All new routes added to sitemap and linked from 2 existing pages
Related
- Live SERP checks, keyword clustering, and AI citation sources: dataforseo-serp, https://il.ly/skills/dataforseo-serp
- Full revenue-first teardown: seo-roast, https://il.ly/skills/seo-roast
- Directory backlinks from DR 0: directory-submissions, https://linkdr.com/resources/directories
- Managed link placements: linkdr, https://linkdr.com/SKILL.md
FAQ
What does the ahrefs-research skill do?
Pulls Ahrefs data through the official MCP server or API v3 and ships a competitor gap Kanban with scaffolded pages, a clean link-replication CSV, Reddit-mined page specs, and exact link-insertion target URLs. Use when the user asks for competitor research, content gaps, top pages, backlink audits, 'is this DR real', Reddit topic mining, or picking a page on a prospect site for a link insertion.
How do I install ahrefs-research?
Run npx skills add https://github.com/illyism/seo-skills --skill ahrefs-research in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/ahrefs-research/ (personal) or .claude/skills/ahrefs-research/ (project).
Which AI agents can use ahrefs-research?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is ahrefs-research safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains ahrefs-research?
It is published by illyism in illyism/seo-skills. It has 336 recorded installs.
More from illyism/seo-skills
seo-autopilot
illyism/seo-skills
When the user wants an agent to run SEO for a product end to end on a daily schedule, with state kept in a seo/ folder in the repo. Covers site health checks, fact checks against commits, page 2 to page 1 pushes, AI answer tracking, competitor sitemap diffs, a monthly keyword map, articles, comparison pages, free tools and link drafts. Also use when the user mentions "seo autopilot" or asks for a daily SEO run.
seo-title-optimization
illyism/seo-skills
Rewrite and audit SEO page titles, title tags, MDX frontmatter titles, H1 alignment, and bulk title improvements. Use when the user mentions titles, title tags, SERP titles, metadata titles, SEO titles, CTR, truncation, or asks to improve titles across pages.
blog-refresher
illyism/seo-skills
Refresh and improve existing blog posts to outrank competitors using a 6-phase content audit and SERP gap analysis. Use when the user wants to update, refresh, or improve an existing blog post, recover lost rankings, or asks why a post fell behind competitors.
customer-journey
illyism/seo-skills
Map how customers discover, evaluate, and choose a product across Google, AI chatbots (ChatGPT, Claude, Perplexity), and social platforms, using the 5-stage awareness journey. Use when the user asks about search intent, AI SEO prompts, discoverability, buyer journeys, awareness stages, or what content to create for a brand, website, or keyword list.
blitz-seo
illyism/seo-skills
When the user wants to rank one high-value page fast, run a focused SEO sprint, or is stuck on page 2 for a money keyword. Also use when the user mentions "blitz seo", an SEO war room, a 30-day SEO sprint, or asks how to prioritize SEO when everything feels spread too thin.
understand-customers
illyism/seo-skills
When the user wants to deeply understand their ideal customer before writing copy — pains, desires, inner monologue, and language. Also use when the user mentions "empathy engine", "know your target", "customer pain points", or asks to research their audience before writing Blitz Copy.
Popular productivity & automation skills
agent-browser
vercel-labs/agent-browser
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.
lark-doc
open.feishu.cn
飞书云文档(Docx / Wiki)内容操作:读取、创建、编辑文档,插入或下载图片附件,以及操作思维笔记。用户提供文档 URL/token(包括 doubao.com 的 /docx/、/wiki/)时使用;按 URL 路径/token 而非域名路由;/page/ 是妙搭应用,非飞书云文档。文档内嵌资源按读取参考中的统一规则分流。独立评论操作走 lark-drive;随正文读取评论使用 docs +fetch。表格或 Base 内部数据操作不在本 skill。
lark-shared
open.feishu.cn
Use for lark-cli setup/auth tasks: auth login/status/logout, user vs bot identity, business-domain permissions (--domain, including all/docs/drive), missing scopes, revoking authorization, or handling notice JSON.
lark-drive
open.feishu.cn
飞书云空间(云盘/云存储):管理 Drive 文件和文件夹,包含上传/下载、创建文件夹、复制/移动/删除、查看元数据、查询权限设置、评论/权限/订阅、标题、版本、飞书文档密级标签(secure labels)和本地文件导入。用户需要整理云盘目录、处理云空间资源 URL/token、判断链接类型/真实 token/标题,或导入 Word/Markdown/Excel/CSV/PPTX/.base 为 docx/sheet/bitable/slides 时使用;doubao.com 云空间 URL/token 也按资源路径和 token 路由,不回退 WebFetch。不负责:文档内容编辑(走 lark-doc)、表格/Base 表内数据操作(走 lark-sheets/lark-base)、知识空间节点/成员管理(走 lark-wiki)、原生 Markdown 文件读写/patch/diff(走 lark-markdown)。
lark-base
open.feishu.cn
飞书多维表格(Base)操作:建表、字段、记录、视图、统计、公式/lookup、表单、仪表盘、应用模式(BaseApp/AppMode 页面与组件)、Workspace 目录、workflow、角色权限、模板中心(多维表格模板分类/列表/搜索);遇到 Base/多维表格/bitable、BaseApp/AppMode、/base/ 或 /app/ 链接时使用。BaseApp 不走 lark-apps;文件导入/导出转 lark-drive,认证/授权转 lark-shared。
lark-im
open.feishu.cn
飞书即时通讯:收发消息和管理群聊。发送和回复消息、搜索聊天记录、管理群聊成员、上传下载图片和文件、管理表情回复、发送应用内/短信/电话加急、发送和处理交互卡片(Interactive Card)、监听卡片按钮回调(card.action.trigger)。当用户需要发消息、查看或搜索聊天记录、下载聊天中的文件、查看群成员、搜索群、创建群聊或话题群、管理标记数据、管理 Feed 置顶(添加/移除/查询置顶会话)、管理标签数据、处理卡片回调时使用。