Install
openclaw skills install ahrefsComplete Ahrefs API integration for SEO analysis. Covers Site Explorer (domains, backlinks, rankings), Keywords Explorer (search volume, difficulty, SERP analysis), Rank Tracker (position monitoring), Site Audit (technical SEO), SERP Overview, Batch Analysis, and Brand Radar. Use for any SEO-related queries including keyword research, backlink analysis, competitor intelligence, technical audits, and rank tracking.
openclaw skills install ahrefsQuery and analyze SEO data using the Ahrefs API for backlinks, keywords, rankings, and competitive intelligence.
You need an Ahrefs subscription with API access:
Get your API token from Ahrefs Account Settings
Configure in OpenClaw:
Add to ~/.openclaw/workspace/.env:
AHREFS_API_TOKEN=your_api_token_here
AHREFS_API_PLAN=enterprise # Options: lite, standard, advanced, enterprise
Verify setup:
grep AHREFS ~/.openclaw/workspace/.env
org_keywords_1_3 metric).au domains)best_position, sum_traffic, volumeGet comprehensive SEO metrics for any domain:
Discover and analyze keywords:
Track keyword rankings over time:
Identify technical SEO issues:
Analyze search engine results:
Process multiple targets efficiently:
Track brand performance:
Compare domains and identify opportunities:
Ahrefs API base URL: https://api.ahrefs.com/v3/site-explorer/
All requests require the API token in the header:
Authorization: Bearer {AHREFS_API_TOKEN}
Important: Use AHREFS_API_TOKEN, NOT AHREFS_MCP_TOKEN.
All API calls require:
date: Current date in format YYYY-MM-DDtarget: Domain (e.g., example.com)For detailed endpoint documentation and parameters, see references/api-endpoints.md.
limit parameter to reduce costselect parameter for only needed fieldsDATE=$(date +%Y-%m-%d)
curl -X GET "https://api.ahrefs.com/v3/site-explorer/backlinks-stats?date=$DATE&target=example.com" \
-H "Authorization: Bearer $AHREFS_API_TOKEN"
Returns:
{
"metrics": {
"live": 4545,
"all_time": 25318,
"live_refdomains": 718,
"all_time_refdomains": 3272
}
}
DATE=$(date +%Y-%m-%d)
curl -X GET "https://api.ahrefs.com/v3/site-explorer/metrics?date=$DATE&target=example.com" \
-H "Authorization: Bearer $AHREFS_API_TOKEN"
Returns:
{
"metrics": {
"org_keywords": 6925,
"org_traffic": 38702,
"org_keywords_1_3": 1560,
"org_cost": 2372016
}
}
DATE=$(date +%Y-%m-%d)
curl -X GET "https://api.ahrefs.com/v3/site-explorer/domain-rating?date=$DATE&target=example.com" \
-H "Authorization: Bearer $AHREFS_API_TOKEN"
Returns:
{
"domain_rating": {
"domain_rating": 43.0,
"ahrefs_rank": 1189155
}
}
DATE=$(date +%Y-%m-%d)
curl -X GET "https://api.ahrefs.com/v3/site-explorer/top-pages?date=$DATE&target=example.com&limit=10&select=url,sum_traffic" \
-H "Authorization: Bearer $AHREFS_API_TOKEN"
curl -X GET "https://api.ahrefs.com/v3/keywords-explorer/overview?keyword=seo+tools&country=us" \
-H "Authorization: Bearer $AHREFS_API_TOKEN"
Returns:
{
"keyword": "seo tools",
"volume": 14000,
"keyword_difficulty": 75,
"cpc": 25.50,
"serp_features": ["featured_snippet", "people_also_ask"],
"traffic_potential": 18500
}
curl -X GET "https://api.ahrefs.com/v3/keywords-explorer/related-keywords?keyword=seo+tools&country=us&limit=50" \
-H "Authorization: Bearer $AHREFS_API_TOKEN"
curl -X GET "https://api.ahrefs.com/v3/serp-overview?keyword=seo+tools&country=us" \
-H "Authorization: Bearer $AHREFS_API_TOKEN"
Returns top 100 organic results with domain metrics.
Note: Requires pre-configured project in Ahrefs web interface.
curl -X GET "https://api.ahrefs.com/v3/rank-tracker/project?project_id=12345" \
-H "Authorization: Bearer $AHREFS_API_TOKEN"
Note: Requires pre-configured project in Ahrefs web interface.
curl -X GET "https://api.ahrefs.com/v3/site-audit/project?project_id=12345" \
-H "Authorization: Bearer $AHREFS_API_TOKEN"
curl -X POST "https://api.ahrefs.com/v3/site-explorer/batch/metrics" \
-H "Authorization: Bearer $AHREFS_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"targets": ["example.com", "competitor1.com", "competitor2.com"],
"date": "2026-02-18"
}'
Returns metrics for all domains in one request.
Requires Site Audit project
limit and offset parameters for large datasetsLoad the token from the workspace .env file:
# PowerShell
$env:AHREFS_API_TOKEN = (Get-Content ~/.openclaw/workspace/.env -Raw | Select-String "AHREFS_API_TOKEN=([^\r\n]+)" | ForEach-Object { $_.Matches.Groups[1].Value })
# Bash
export AHREFS_API_TOKEN=$(grep AHREFS_API_TOKEN ~/.openclaw/workspace/.env | cut -d'=' -f2)
API responses vary by endpoint but typically return JSON:
Stats endpoints (backlinks-stats, metrics, domain-rating):
{
"metrics": { /* metric fields */ },
"domain_rating": { /* rating fields */ }
}
List endpoints (top-pages, backlinks, etc.):
{
"pages": [ /* array of results */ ],
"backlinks": [ /* array of results */ ]
}
.env