Skill
ahrefs
Agent-native CLI for Ahrefs SEO + competitive intelligence. Six endpoint families (Keywords Explorer, Site Explorer, Site Audit, Rank Tracker, SERP Overview, Subscription Info), --compact token-saving output, typed exit codes (0/4/7), and an offline-friendly SQLite store for repeated queries. Read-only — never mutates Ahrefs state.
When to use ahrefs
Choose if
You're running SEO / competitive-intel workflows from an agent loop and need read-only Ahrefs data — backlinks, keywords, SERP positions, site audit results — with typed exit codes for self-correction, --compact output to save tokens, and a local SQLite mirror for repeated lookups. Requires an existing Ahrefs API key.
Avoid if
You don't have a paid Ahrefs subscription (the upstream API is not free). Also avoid when the agent needs write operations against Ahrefs (the CLI is read-only by design) or when the workload would burn through your account's rate limits — monitor the Subscription Info endpoint first.
Risk Flags
- MEDIUM auth Requires an AHREFS_API_KEY tied to a paid Ahrefs subscription. No free tier on the upstream API; agents without the key get exit code 4 (auth failure) immediately.
- MEDIUM rate_limit Upstream Ahrefs API enforces rate limits per plan. The CLI surfaces these as exit code 7 but the README discloses no concrete thresholds — agents on heavy workloads must monitor the Subscription Info endpoint to avoid hard limits.
- LOW scope Strictly read-only — no create/update/delete/publish/send/mutate. Agents needing to push data back into Ahrefs must use the web UI or a different tool.
- LOW runtime Default install path needs Node (npm). Go-source fallback needs Go 1.26.3+. Sandboxed JS-only runtimes without those binaries get the pre-built GitHub releases instead.
Cost
Type: Usage based · Free tier: The CLI binary is MIT-licensed and free to install. All API calls bill against your Ahrefs account; the AHREFS_API_KEY env var (or ~/.config/ahrefs-pp-cli/config.toml) is mandatory before any endpoint works.
Hidden costs
- Requires a paid Ahrefs API plan — the CLI is a free wrapper but the upstream API key is not. Tier pricing not disclosed in the README.
Install
Default
npx -y @mvanhorn/printing-press install ahrefs
# Then set the upstream API key (mandatory):
export AHREFS_API_KEY=<your-key>
# or persist:
mkdir -p ~/.config/ahrefs-pp-cli && \
echo "api_key = \"<your-key>\"" >> ~/.config/ahrefs-pp-cli/config.toml
Estimated time to first success: ~10 min
Claude code
npx skills add mvanhorn/printing-press-library/cli-skills/pp-ahrefs -g
Then set AHREFS_API_KEY in your shell or persisted config.
Dependencies
Minimum runtime: Node.js 18+ (or Go 1.26.3+ for source install)
Distribution
- Repository
- https://github.com/mvanhorn/printing-press-library
- License
- MIT