canonical: https://jentic.com/apis/ahrefs.com/ahrefs

# Ahrefs API

Jentic publishes the only available OpenAPI specification for Ahrefs API v3, keeping it validated and agent-ready. Ahrefs is an SEO data platform; the v3 API exposes 31 read endpoints across Site Explorer (backlinks, referring domains, organic traffic), Keywords Explorer (keyword overview, ideas, volume history), SERP Overview, Subscription metadata, and Batch Analysis. Authentication uses a bearer token, and every endpoint is a GET designed for read-heavy SEO research workflows.

## For AI agents

Pull SEO research data from Ahrefs - backlinks, referring domains, organic and paid keywords, keyword volume, SERP overview, and subscription usage - through 31 GET endpoints.

## Scope

Does not handle site crawling, rank tracking projects, or content publishing - use for read-only SEO data lookups across Site Explorer, Keywords Explorer, and SERP Overview only.

## Capabilities

- Retrieve domain rating, backlink stats, and outlink stats for any domain
- Pull historic time series for domain rating, URL rating, refdomains, and metrics
- List backlinks, referring domains, anchors, and broken backlinks for a target
- Inspect organic and paid keywords, top pages, and organic competitors
- Run keyword overview, keyword ideas, and volume-by-country lookups
- Check subscription quota and remaining row credits before heavy queries

## Use cases

### Backlink Profile Analysis

SEO teams pull backlinks, referring domains, and anchor distribution for a target via Site Explorer endpoints. /v3/site-explorer/backlinks returns the link list with attributes like rating and anchor text, while /v3/site-explorer/refdomains aggregates by domain. Combined with the historic endpoints, an integration can chart link growth or detect drops over time.

Example prompt: GET /v3/site-explorer/backlinks?target=example.com&limit=100 and tabulate by ahrefs_rank

### Keyword Research Automation

Content and growth teams run keyword overview and ideas calls to size opportunity at scale. /v3/keywords-explorer/keyword-overview returns volume, difficulty, and CPC for one or many seeds, while /v3/keywords-explorer/keyword-ideas expands a seed into a full idea list. The volume-by-country endpoint helps with international planning without per-region clicking.

Example prompt: GET /v3/keywords-explorer/keyword-overview?keywords=electric%20bikes&country=us

### Organic Performance Tracking

Marketing teams sync Ahrefs organic data into their own dashboards. /v3/site-explorer/all-organic-keywords lists ranking keywords for a domain, /v3/site-explorer/top-pages returns the highest-traffic pages, and /v3/site-explorer/organic-competitors surfaces overlapping rivals. With history endpoints, the same agent can report trend lines without re-querying the slow paths.

Example prompt: GET /v3/site-explorer/top-pages?target=example.com&country=us&limit=50

### Quota-Aware Batch Research

Ahrefs charges row credits, so sustained automation needs to budget queries. The Subscription endpoints expose remaining row credits, letting an agent check capacity before kicking off a wide research run. Batch Analysis offers higher throughput for repeated lookups against the same metric across many targets.

Example prompt: GET the subscription info endpoint to read remaining_rows before running a batch analysis

### AI Agent SEO Research via Jentic

An agent built on Jentic can answer natural language SEO questions - 'compare backlinks growth between us and competitor X this quarter' - by chaining Site Explorer history calls. Jentic stores the bearer token in its vault and applies it on each call, so the agent never sees the raw API key while still benefiting from the read-heavy GET-based design.

Example prompt: Use Jentic to search 'get a domain rating from Ahrefs', execute the call, then chain into backlinks-stats

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /v3/site-explorer/domain-rating | Get domain rating |
| GET | /v3/site-explorer/backlinks | List backlinks for a target |
| GET | /v3/site-explorer/refdomains | List referring domains |
| GET | /v3/site-explorer/all-organic-keywords | List organic keywords for a target |
| GET | /v3/site-explorer/top-pages | List top pages by traffic |
| GET | /v3/keywords-explorer/keyword-overview | Get keyword overview metrics |
| GET | /v3/keywords-explorer/keyword-ideas | Generate keyword ideas |
| GET | /v3/site-explorer/broken-backlinks | List broken backlinks |

## Key resources

- **Site Explorer** — Backlinks, referring domains, organic keywords, and traffic for a target
- **Keywords Explorer** — Keyword overview, ideas, volume history, and country-level data
- **SERP Overview** — SERP results and feature breakdown for a keyword
- **Batch Analysis** — High-throughput metric lookups across many targets
- **Subscription** — Plan info and remaining row credits
- **Public** — Public reference endpoints

## Why Jentic

- **Setup:** Wiring the Ahrefs API by hand means managing its bearer token and coding read calls across Site Explorer, Keywords Explorer, and SERP Overview. Through Jentic you install once, import the Ahrefs API from the API Directory, store the token once, and your agent calls it.
- **Permission scoping:** Ahrefs takes its target, country, and mode as query parameters and every operation is a read, so limit the agent to the operations it needs, such as reading domain rating or backlinks. You choose which read operations are in the allowed set, so anything you leave out is not reachable.
- **Credential handling:** Your Ahrefs bearer token is stored once, encrypted, by your own Jentic One instance and attached at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'get backlinks for a domain', and Jentic returns the matching Ahrefs operation with its query parameters, including target, country, mode, and limit, so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Semrush** — SEO and competitive research API with broad keyword, traffic, and advertising datasets
- **Moz** — SEO data API with Domain Authority and link metrics
- **SEO GPT** — AI-powered SEO content generation API for titles, meta, and page copy
- **Agility Writer** — Long-form AI article generator that takes a target keyword as input

## FAQ

### Why is there no official OpenAPI spec for Ahrefs API?

Ahrefs publishes API documentation but not an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call the Ahrefs API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Ahrefs API use?

The API uses a bearer token in the Authorization header. Tokens are issued from your Ahrefs API plan. Through Jentic, the token is held in the credential vault and injected at execution time, so the secret never appears in agent context.

### How do I get backlinks for a domain through the Ahrefs API?

Call GET /v3/site-explorer/backlinks with target set to the domain and optional filters such as mode, history, and limit. The endpoint returns paginated backlink rows including referring page, anchor, and link strength metrics.

### How are Ahrefs API row credits consumed?

Each row in a response counts against your plan's monthly row credits. Use GET subscription info to read remaining_rows before batch jobs and prefer aggregated endpoints (refdomains, anchors) over raw backlink listings when you only need totals.

### How do I run keyword research through Jentic?

Search Jentic for 'run an Ahrefs keyword overview'. Load the GET /v3/keywords-explorer/keyword-overview schema, supply seed keywords and a country, and execute. Jentic adds the bearer token, returns the volume, difficulty, and CPC fields.

### Can I get historic data for a domain rating?

Yes. GET /v3/site-explorer/domain-rating-history returns a time series of domain rating values for a target, useful for trend analysis without storing historical snapshots yourself.

### Can I limit what my agent is allowed to do with the Ahrefs API?

Yes. Every Ahrefs operation is a read, so with your self-hosted Jentic One instance you decide which of those reads your agent may call, and your own rules define the allowed set. You can, for example, let it fetch domain rating and backlinks while leaving keyword overview, keyword ideas, or the subscription endpoints out, and anything you exclude stays unreachable. Because Ahrefs takes target, country, mode, and limit as query parameters on GET calls, the agent can only run the read operations you permit.
