llms.txt Content
# Ahrefs API
> Ahrefs API v3 gives programmatic access to Ahrefs' SEO, marketing, and AI-search data — backlinks, organic and paid traffic, keywords, SERPs, rank tracking, site audits, brand/AI-search visibility, web and social analytics, and account management.
The Ahrefs API is organized into **tools**, each a self-contained group of REST endpoints. The complete OpenAPI specification for every tool is at [/openapi.json](/openapi.json). Each tool also has its own spec — a machine-readable index of them is at [/reference/index.json](/reference/index.json).
## Basics
- **Base URL:** `https://api.ahrefs.com/v3/{tool}/{endpoint}` (for example `https://api.ahrefs.com/v3/site-explorer/domain-rating`).
- **Authentication:** send your API key as a bearer token in the `Authorization: Bearer <API_KEY>` header. Free "public" endpoints do not require a key. See [API keys creation and management](/api/docs/api-keys-creation-and-management.md).
- **Requests:** all data endpoints are `GET` with query-string parameters.
- **Responses:** JSON by default (`application/json`); most endpoints also support XML. Use the `output` parameter to choose the format.
- **Selecting fields:** most reports take a `select` parameter listing the columns to return; response cost depends on the rows and fields requested. See [Parameters](/api/docs/parameters.md).
- **Filtering:** rows can be filtered with a JSON filter expression via the `where` parameter. See [Filter syntax](/api/docs/filter-syntax.md).
## Units and limits
Most requests consume **API units**; the minimum cost of any billable request is 50 units. Rank Tracker, Management, Public, and some other endpoints are free, and each tool's documentation marks free endpoints. During development, prefer the [free test queries](/api/docs/free-test-queries.md) to avoid spending units. See [Limits consumption](/api/docs/limits-consumption.md).
## Monetary values
Monetary values across all endpoints (for example `value`, `org_cost`, `pai