Automate SEO research with Ahrefs -- analyze backlink profiles, research keywords, track domain metrics history, audit organic rankings, and perform batch URL analysis through the Composio Ahrefs integration.
SKILL.md
Ahrefs Automation
Run Ahrefs SEO analytics directly from Claude Code. Analyze backlink profiles, research keywords, track domain authority over time, audit organic keyword rankings, and batch-analyze multiple URLs without leaving your terminal.
where -- rich filter expressions on keyword, volume, best_position, intent flags, etc.
limit (default 1000), order_by
Example prompt: "Show all organic keywords where example.com ranks in the top 10 in the US"
6. Batch URL Analysis
Analyze up to 100 URLs or domains simultaneously to compare SEO metrics across competitors or site sections.
Tool:AHREFS_BATCH_URL_ANALYSIS
Key parameters:
targets (required) -- array of objects with url, mode (exact/prefix/domain/subdomains), and protocol (both/http/https)
select (required) -- array of column identifiers
country -- ISO country code
output -- json or php
Example prompt: "Compare SEO metrics for competitor1.com, competitor2.com, and competitor3.com"
Known Pitfalls
Column selection is required: Most Ahrefs tools require a select parameter specifying which columns to return. Omitting it or using invalid column names will cause errors. Refer to each tool's response schema for valid identifiers.
Date format consistency: Dates must be in YYYY-MM-DD format. Some historical endpoints return data at the granularity set by history_grouping, not by exact date.
API unit costs vary: Different columns consume different unit amounts. Columns marked with "(5 units)" or "(10 units)" in the schema are more expensive. Monitor API usage when requesting expensive columns like traffic, refdomains_source, or difficulty.
Batch limit is 100 targets:AHREFS_BATCH_URL_ANALYSIS accepts up to 100 targets per request. For larger analyses, split into multiple batches.
Filter expressions are complex: The where parameter uses Ahrefs' filter expression syntax, not standard SQL. Consult the column descriptions in each tool's schema for supported filter types and value formats.
Deprecated offset parameter: The offset parameter was deprecated on May 31, 2024. Use cursor-based pagination or adjust limit instead.
Mode affects scope significantly: Setting mode to subdomains (the default) includes all subdomains, which can dramatically increase result counts compared to domain or exact.