Agent skill · marketing growth · openclaudia

ahrefs-python

Manages Ahrefs API usage in Python using `ahrefs-python` library. Use when working with SEO / marketing related tasks or with data including backlinks, keywords, domain ratings, organic traffic, site audits, rank tracking, and brand monitoring. Covers `ahrefs-python` usage including AhrefsClient / AsyncAhrefsClient, typed request/response models, error handling, and all API sections.

Why this skill is useful

Provides specific usage patterns and error handling for the Ahrefs API that the AI wouldn't reliably generate on its own.

What it needs

Requires ahrefs-python, httpx, pydantic installed locally. Requires ahrefs account access. About 4k tokens when loaded. Last updated 2026-08-07. 620 stars on the source repository.

What this skill does

Ahrefs Python SDK Skill Overview The Ahrefs API provides programmatic access to Ahrefs SEO data. The official Python SDK (ahrefs-python) provides typed request and response models for all endpoints, auto-generated from the OpenAPI spec. Key capabilities: Site Explorer - Backlinks, organic keywords, domain rating, traffic, referring domains Keywords Explorer - Keyword research, volumes, difficulty, related terms Rank Tracker - SERP monitoring, competitor tracking Site Audit - Technical SEO issues, page content, page explorer Brand Radar - AI brand mentions, share of voice, impressions SERP Overview - Search result analysis Batch Analysis - Bulk domain/URL metrics via POST Installation Requires Python 3.11+. Dependencies: httpx, pydantic. API Method Discovery The SDK has 52 methods across 7 API sections. The built-in search tool is the fastest way to find the right method — it returns matching method signatures, parameters, and return types directly, so there's no need to scan through a large reference. Python (preferred when already in a Python context): CLI (preferred when exploring from the terminal): IMPORTANT RULES ALWAYS use the ahrefs-python SDK. DO NOT make raw httpx/requests calls to the Ahrefs API. ALWAYS pass dates as strings in YYYY-MM-DD format (e.g. "2025-01-15"). ALWAYS use select on list endpoints to request only the columns you need. List endpoints return all columns by default, which wastes API units and increases response size. USE context managers (with / async with) for client lifecycle management. NEVER hardcode API keys in source code. Use the AHREFSAPIKEY environment variable or your preferred secrets mechanism. The client handles retries (429, 5xx, connection errors) automatically. DO NOT implement your own retry logic on top of the SDK. Quick Start SDK Patterns Client Setup Async client: For parallel calls, use asyncio.gather: Calling Methods Two calling styles -- both are equivalent: Method names follow {apisection}{endpoint}, e.g. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills openclaudia/ahrefs-research

View the source on GitHub

Browse the @skills marketplace