> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/integrations/catalog/ahrefs.md).

# Ahrefs

Pull SEO and backlink data from Ahrefs: domain rating, backlinks (live and broken), referring domains, organic keywords and competitors, top pages, keyword research (overview, matching/related terms, volume history), and batch metrics for up to 100 targets at once.

### Connectors

Choose the connector that matches your authentication method. The options below use the names shown in StackAI.

| Connector | Authentication |
| --------- | -------------- |
| Ahrefs    | API Key        |

#### Ahrefs

Connect to Ahrefs with an API v3 key from your workspace Account settings. Pulls data from Site Explorer (domain rating, backlinks, referring domains, organic keywords, top pages), Keywords Explorer, Subscription Info, and Batch Analysis endpoints. Requires an eligible paid plan with API v3 access.

**Set up in Ahrefs**

1. Sign in to Ahrefs with a paid plan that includes API v3 access (only workspace owners and admins can manage keys).
2. Open **Account settings → API keys** and click to create a new API key. Optionally set a monthly API-unit limit for the key.
3. Copy the generated API key (it is shown as a Bearer token used in the Authorization header). Keys are valid for one year.

**Set up in StackAI**

1. Open **Settings → Connections**, add a connection, and select **Ahrefs**.
2. Enter the credentials and connection details in the fields below.
3. Save the connection and check its connection status. Select this saved connection when configuring an action or feature that uses it.

**Connection fields**

| StackAI field | Required | What to enter                                                                                                                                                                                                                                                                                                                                                                                           |
| ------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| API Key       | Yes      | Your Ahrefs API v3 key. Create one at <https://app.ahrefs.com/account/api-keys> — only workspace owners and admins can create keys. The key is sent as a Bearer token on every request and expires one year after creation. Ahrefs API v3 is available on eligible paid plans; unit usage is shared across all keys in the workspace. [Provider instructions](https://app.ahrefs.com/account/api-keys). |

**Provider documentation:** [Setup reference](https://docs.ahrefs.com/en/api/docs/api-keys-creation-and-management).

#### Verify the connection

Check that the connection is healthy. Then run a read operation against a resource the connected account can access. A successful connection check confirms authentication; it does not guarantee permission for every action.

If access is denied, check the credential or OAuth permissions, the selected account or environment, and access to the specific resource. Update expired credentials or reconnect after permissions change.

### Use an action

1. Add the required **Ahrefs** action to the workflow.
2. Select a connection when the action requests one.
3. Complete the required fields. Use the reference picker when a value comes from another workflow step.
4. Run the workflow and inspect the action’s output. Check the result before using it in a later step.

### Actions

#### Get Subscription Info

Get your Ahrefs API plan limits and remaining API units.

**Inputs**

No input fields are required in this catalog entry.

**Outputs**

| Field        | Type   | Description                                    |
| ------------ | ------ | ---------------------------------------------- |
| Subscription | object | Ahrefs plan limits and current API-unit usage. |

#### Get Domain Rating

Get Ahrefs Domain Rating and Ahrefs Rank for a target on a given date.

**Inputs**

| Field       | Type            | Required | Description                                                                                             |
| ----------- | --------------- | -------- | ------------------------------------------------------------------------------------------------------- |
| Target      | string          | Yes      | The domain or URL to score.                                                                             |
| Report Date | string          | Yes      | Report date in YYYY-MM-DD format.                                                                       |
| Protocol    | select (string) | No       | Restrict to a specific link protocol (defaults to both). Available values: Both (default), HTTPS, HTTP. |

**Outputs**

| Field         | Type    | Description                                                 |
| ------------- | ------- | ----------------------------------------------------------- |
| Domain Rating | number  | Ahrefs Domain Rating on a 0-100 logarithmic scale.          |
| Ahrefs Rank   | integer | Position of the target among all sites in Ahrefs' database. |

#### Get Backlinks Stats

Get backlinks and referring-domain counts for a target on a given date.

**Inputs**

| Field       | Type            | Required | Description                                                                                                                         |
| ----------- | --------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Target      | string          | Yes      | Domain or URL to analyze.                                                                                                           |
| Report Date | string          | Yes      | Report date in YYYY-MM-DD format.                                                                                                   |
| Match Mode  | select (string) | No       | How the target should be matched against Ahrefs' index. Available values: Subdomains (default), Exact URL, URL Prefix, Root Domain. |
| Protocol    | select (string) | No       | Restrict to a specific link protocol. Available values: Both (default), HTTPS, HTTP.                                                |

**Outputs**

| Field                  | Type    | Description                                     |
| ---------------------- | ------- | ----------------------------------------------- |
| Live Backlinks         | integer | Count of live backlinks at the requested date.  |
| All-time Backlinks     | integer | Lifetime discovered backlinks (including lost). |
| Live Referring Domains | integer | Distinct live referring domains.                |

#### List Organic Keywords

List the organic keywords a target ranks for, with volume and position.

**Inputs**

| Field       | Type                      | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ----------- | ------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Target      | string                    | Yes      | Domain or URL to analyze.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Report Date | string                    | Yes      | Report date in YYYY-MM-DD format.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Columns     | multiple\_select (string) | No       | Columns to return for each keyword row. Available values: All Positions, All Positions Prev, Best Position, Best Position Diff, Best Position Has Thumbnail, Best Position Has Thumbnail Prev, Best Position Has Video, Best Position Has Video Prev, Best Position Kind, Best Position Kind Merged, Best Position Kind Prev, Best Position Prev, Best Position Set, Best Position Set Prev, Best Position URL, Best Position URL Prev, Best Position URL Raw, Best Position URL Raw Prev, CPC, CPC Merged, CPC Prev, Entities, Event Entities, Is Best Position Set Top 3, Is Best Position Set Top 3 Prev, Is Best Position Set Top 4 10, Is Best Position Set Top 4 10 Prev, Is Best Position Set Top 11 50, Is Best Position Set Top 11 50 Prev, Is Branded, Is Commercial, Is Informational, Is Local, Is Main Position, Is Main Position Prev, Is Navigational, Is Transactional, Keyword, Keyword Country, Keyword Difficulty, Keyword Difficulty Merged, Keyword Difficulty Prev, Keyword Language, Keyword Merged, Keyword Prev, Language, Language Prev, Last Update, Last Update Prev, Location Entities, Organisation Entities, Person Entities, Position Kind, Position Kind Prev, Positions Kinds, Positions Kinds Prev, Product Entities, Serp Features, Serp Features Count, Serp Features Count Prev, Serp Features Merged, Serp Features Prev, Serp Target Main Positions Count, Serp Target Main Positions Count Prev, Serp Target Positions Count, Serp Target Positions Count Prev, Status, Sum Paid Traffic, Sum Paid Traffic Merged, Sum Paid Traffic Prev, Sum Traffic, Sum Traffic Merged, Sum Traffic Prev, Title, Title Prev, Volume, Volume Desktop Pct, Volume Merged, Volume Mobile Pct, Volume Prev, Words, Words Merged, Words Prev, Work Entities. |
| Country     | string                    | No       | Two-letter ISO country code (lowercase).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Match Mode  | select (string)           | No       | How the target should be matched against Ahrefs' index. Available values: Subdomains (default), Exact URL, URL Prefix, Root Domain.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Protocol    | select (string)           | No       | Restrict to a specific link protocol. Available values: Both (default), HTTPS, HTTP.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Limit       | integer                   | No       | Max rows to return (1-10000).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Offset      | integer                   | No       | Number of rows to skip (for pagination).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Order By    | string                    | No       | Ordering clause, e.g. 'volume:desc'.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Filter      | string                    | No       | Filter expression using Ahrefs filter syntax.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |

**Outputs**

| Field     | Type    | Description                                        |
| --------- | ------- | -------------------------------------------------- |
| Keywords  | array   | Array of keyword rows returned by Ahrefs.          |
| Row Count | integer | Number of rows returned (not the total available). |

#### List Top Pages

List the pages on a domain that bring in the most organic traffic.

**Inputs**

| Field       | Type                      | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ----------- | ------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Target      | string                    | Yes      | Domain or URL to analyze.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Report Date | string                    | Yes      | Report date in YYYY-MM-DD format.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Columns     | multiple\_select (string) | No       | Columns to return for each top page row. Available values: CPC, CPC Prev, Has Thumbnail, Has Thumbnail Prev, Has Video, Has Video Prev, Keyword, Keyword Difficulty, Keyword Difficulty Prev, Keyword Prev, Keywords, Keywords Diff, Keywords Diff Percent, Keywords Merged, Keywords Prev, Page Type, Position, Position Kind, Position Kind Prev, Position Prev, Raw URL, Raw URL Prev, Referring Domains, Serp Features, Serp Features Prev, Status, Sum Traffic, Sum Traffic Merged, Sum Traffic Prev, Top Keyword, Top Keyword Best Position, Top Keyword Best Position Diff, Top Keyword Best Position Kind, Top Keyword Best Position Kind Prev, Top Keyword Best Position Prev, Top Keyword Best Position Title, Top Keyword Best Position Title Prev, Top Keyword Country, Top Keyword Country Prev, Top Keyword Prev, Top Keyword Volume, Top Keyword Volume Prev, Traffic Diff, Traffic Diff Percent, UR, URL, URL Prev, Value, Value Diff, Value Diff Percent, Value Merged, Value Prev, Volume, Volume Prev, Words, Words Prev. |
| Country     | string                    | No       | Two-letter ISO country code (lowercase).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Match Mode  | select (string)           | No       | How the target should be matched against Ahrefs' index. Available values: Subdomains (default), Exact URL, URL Prefix, Root Domain.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Protocol    | select (string)           | No       | Restrict to a specific link protocol. Available values: Both (default), HTTPS, HTTP.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Limit       | integer                   | No       | Max rows to return (1-10000).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Offset      | integer                   | No       | Number of rows to skip (for pagination).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Order By    | string                    | No       | Ordering clause, e.g. 'traffic:desc'.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Filter      | string                    | No       | Filter expression using Ahrefs filter syntax.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |

**Outputs**

| Field     | Type    | Description                            |
| --------- | ------- | -------------------------------------- |
| Pages     | array   | Array of top pages returned by Ahrefs. |
| Row Count | integer | Number of rows returned.               |

#### List Referring Domains

List the domains linking to a target, with domain rating and dates.

**Inputs**

| Field       | Type                      | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ----------- | ------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Target      | string                    | Yes      | Domain or URL to analyze.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Report Date | string                    | Yes      | Report date in YYYY-MM-DD format.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Columns     | multiple\_select (string) | No       | Columns to return for each referring domain row. Available values: Anchor, Discovered Status, Dofollow Linked Domains, Dofollow Links, Dofollow Refdomains, Domain, Domain Rating, Drop Reason, First Seen, IP Source, Is Content, Is Dofollow, Is Homepage Link, Is Nofollow, Is Non HTML, Is Root Domain, Is Spam, Is Sponsored, Is Ugc, Languages, Last Seen, Len URL Redirect, Link Type, Linked Domains, Links External, Links To Target, Lost Links, Lost Reason, New Links, Noindex, Port Source, Port Target, Positions, Positions Source Domain, Powered By, Refdomains, Root Domain Name, Snippet Left, Snippet Right, Source Page Author, Title, Traffic Domain, Traffic Page, URL From, URL Redirect, URL Redirect With Target, URL To. |
| Match Mode  | select (string)           | No       | How the target should be matched against Ahrefs' index. Available values: Subdomains (default), Exact URL, URL Prefix, Root Domain.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Protocol    | select (string)           | No       | Restrict to a specific link protocol. Available values: Both (default), HTTPS, HTTP.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Limit       | integer                   | No       | Max rows to return (1-10000).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Offset      | integer                   | No       | Number of rows to skip (for pagination).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Order By    | string                    | No       | Ordering clause, e.g. 'domain\_rating:desc'.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Filter      | string                    | No       | Filter expression using Ahrefs filter syntax.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |

**Outputs**

| Field             | Type    | Description                                        |
| ----------------- | ------- | -------------------------------------------------- |
| Referring Domains | array   | Array of referring domain rows returned by Ahrefs. |
| Row Count         | integer | Number of rows returned.                           |

#### Keywords Explorer Overview

Get search volume, difficulty, and CPC for a list of keywords in a country.

**Inputs**

| Field       | Type                      | Required | Description                                                                                                                                                                                                                                                                                                              |
| ----------- | ------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Keywords    | array                     | Yes      | List of keywords to look up (1-10000).                                                                                                                                                                                                                                                                                   |
| Country     | string                    | Yes      | Two-letter ISO country code (e.g. 'us', 'gb', 'de').                                                                                                                                                                                                                                                                     |
| Columns     | multiple\_select (string) | No       | Columns to return for each keyword row. Available values: Clicks, CPC, CPS, Difficulty, First Seen, Global Volume, Intents, Keyword, Parent Topic, Parent Volume, Serp Features, Serp Last Update, Traffic Potential, Volume, Volume Desktop Pct, Volume Mobile Pct, Volume Monthly, Volume Monthly History, Word Count. |
| Volume Mode | select (string)           | No       | How search volume is aggregated. Available values: Monthly (default), Average.                                                                                                                                                                                                                                           |

**Outputs**

| Field     | Type    | Description                   |
| --------- | ------- | ----------------------------- |
| Keywords  | array   | Array of keyword metric rows. |
| Row Count | integer | Number of rows returned.      |

#### Batch Analysis

Fetch the same SEO metrics for up to 100 targets in a single call.

**Inputs**

| Field       | Type                      | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ----------- | ------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Targets     | array                     | Yes      | Up to 100 target objects. Each requires 'url' and may set 'mode' and 'protocol'.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Columns     | multiple\_select (string) | Yes      | Ahrefs column identifiers to return for each target (e.g. 'domain\_rating', 'backlinks', 'refdomains', 'org\_traffic'). Available values: Ahrefs Rank, Backlinks, Backlinks Dofollow, Backlinks Internal, Backlinks Nofollow, Backlinks Redirect, Domain Rating, Index, IP, Linked Domains, Linked Domains Dofollow, Mode, Org Cost, Org Keywords, Org Keywords 1 3, Org Keywords 4 10, Org Keywords 11 20, Org Keywords 21 50, Org Keywords 51 Plus, Org Traffic, Org Traffic Top By Country, Outgoing Links, Outgoing Links Dofollow, Paid Ads, Paid Cost, Paid Keywords, Paid Traffic, Protocol, Refdomains, Refdomains Dofollow, Refdomains Nofollow, Refips, Refips Subnets, URL, URL Rating. |
| Country     | string                    | No       | Two-letter ISO country code for traffic/keyword metrics.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Volume Mode | select (string)           | No       | How search volume is aggregated. Available values: Monthly (default), Average.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Order By    | array                     | No       | List of ordering clauses, e.g. \['domain\_rating:desc'].                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |

**Outputs**

| Field     | Type    | Description                                      |
| --------- | ------- | ------------------------------------------------ |
| Targets   | array   | Array of target rows with the requested columns. |
| Row Count | integer | Number of target rows returned.                  |

#### List Backlinks

List the actual backlink rows pointing to a target (URL, anchor, source DR).

**Inputs**

| Field       | Type                      | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ----------- | ------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Target      | string                    | Yes      | Domain or URL to analyze.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Columns     | multiple\_select (string) | No       | Columns to return for each backlink row. Available values: Ahrefs Rank Source, Ahrefs Rank Target, Alt, Anchor, Broken Redirect New Target, Broken Redirect Reason, Broken Redirect Source, Class C, Discovered Status, Domain Rating Source, Domain Rating Target, Drop Reason, Encoding, First Seen, First Seen Link, Http Code, Http Crawl, IP Source, Is Alternate, Is Canonical, Is Content, Is Dofollow, Is Form, Is Frame, Is Homepage Link, Is Image, Is Lost, Is New, Is Nofollow, Is Non HTML, Is Redirect, Is Redirect Lost, Is Root Source, Is Root Target, Is RSS, Is Spam, Is Sponsored, Is Text, Is Ugc, Js Crawl, Languages, Last Seen, Last Visited, Len URL Redirect, Link Type, Linked Domains Source Domain, Linked Domains Source Page, Linked Domains Target Domain, Links External, Links Internal, Lost Reason, Name Source, Name Target, Noindex, Page Category Source, Page Size, Page Type Source, Port Source, Port Target, Positions, Positions Source Domain, Powered By, Redirect Code, Redirect Kind, Refdomains Source, Refdomains Source Domain, Refdomains Target Domain, Root Name Source, Root Name Target, Snippet Left, Snippet Right, Source Page Author, Source Page Publish Date, Title, TLD Class Source, TLD Class Target, Traffic, Traffic Domain, URL From, URL From Plain, URL Rating Source, URL Redirect, URL Redirect With Target, URL To, URL To Plain. |
| Match Mode  | select (string)           | No       | How the target should be matched against Ahrefs' index. Available values: Subdomains (default), Exact URL, URL Prefix, Root Domain.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Protocol    | select (string)           | No       | Restrict to a specific link protocol. Available values: Both (default), HTTPS, HTTP.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Aggregation | select (string)           | No       | How backlinks are grouped. Available values: Similar Links (default), One per Domain, All.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| History     | string                    | No       | History window: 'live', 'all\_time', or 'since:YYYY-MM-DD'.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Limit       | integer                   | No       | Max rows to return (1-10000).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Order By    | string                    | No       | Ordering clause, e.g. 'domain\_rating\_source:desc'.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Filter      | string                    | No       | Filter expression using Ahrefs filter syntax.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |

**Outputs**

| Field     | Type    | Description                                |
| --------- | ------- | ------------------------------------------ |
| Backlinks | array   | Array of backlink rows returned by Ahrefs. |
| Row Count | integer | Number of rows returned.                   |

#### List Broken Backlinks

List inbound links pointing to non-functional URLs on the target.

**Inputs**

| Field       | Type                      | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ----------- | ------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Target      | string                    | Yes      | Domain or URL to analyze.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Columns     | multiple\_select (string) | No       | Columns to return for each broken backlink row. Available values: Ahrefs Rank Source, Ahrefs Rank Target, Alt, Anchor, Class C, Domain Rating Source, Domain Rating Target, Encoding, First Seen, First Seen Link, Http Code, Http Code Target, Http Crawl, IP Source, Is Alternate, Is Canonical, Is Content, Is Dofollow, Is Form, Is Frame, Is Homepage Link, Is Image, Is Nofollow, Is Non HTML, Is Redirect, Is Root Source, Is Root Target, Is RSS, Is Spam, Is Sponsored, Is Text, Is Ugc, Js Crawl, Languages, Last Seen, Last Visited, Last Visited Target, Len URL Redirect, Link Group Count, Link Type, Linked Domains Source Domain, Linked Domains Source Page, Linked Domains Target Domain, Links External, Links Internal, Name Source, Name Target, Page Category Source, Page Size, Page Type Source, Port Source, Port Target, Positions, Positions Source Domain, Powered By, Redirect Code, Redirect Kind, Refdomains Source, Refdomains Source Domain, Refdomains Target Domain, Root Name Source, Root Name Target, Snippet Left, Snippet Right, Source Page Author, Title, TLD Class Source, TLD Class Target, Traffic, Traffic Domain, URL From, URL From Plain, URL Rating Source, URL Redirect, URL Redirect With Target, URL To, URL To Plain. |
| Match Mode  | select (string)           | No       | How the target should be matched against Ahrefs' index. Available values: Subdomains (default), Exact URL, URL Prefix, Root Domain.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Protocol    | select (string)           | No       | Restrict to a specific link protocol. Available values: Both (default), HTTPS, HTTP.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Aggregation | select (string)           | No       | How backlinks are grouped. Available values: Similar Links (default), One per Domain, All.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Limit       | integer                   | No       | Max rows to return (1-10000).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Order By    | string                    | No       | Ordering clause, e.g. 'domain\_rating\_source:desc'.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Filter      | string                    | No       | Filter expression using Ahrefs filter syntax.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

**Outputs**

| Field     | Type    | Description                    |
| --------- | ------- | ------------------------------ |
| Backlinks | array   | Array of broken backlink rows. |
| Row Count | integer | Number of rows returned.       |

#### List Organic Competitors

List domains competing for the same organic keywords as the target.

**Inputs**

| Field           | Type                      | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| --------------- | ------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Target          | string                    | Yes      | Domain or URL to analyze.                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Country         | string                    | Yes      | Two-letter ISO country code (lowercase).                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Report Date     | string                    | Yes      | Report date in YYYY-MM-DD format.                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Columns         | multiple\_select (string) | No       | Columns to return for each competitor row. Available values: Competitor Domain, Competitor URL, CPC Competitor, CPC Target, Domain Rating, Group Mode, Keyword Difficulty Competitor, Keyword Difficulty Target, Keywords Common, Keywords Competitor, Keywords Target, Pages, Pages Diff, Pages Merged, Pages Prev, Share, Traffic, Traffic Diff, Traffic Merged, Traffic Prev, Value, Value Diff, Value Merged, Value Prev, Volume Competitor, Volume Target, Words Competitor, Words Target. |
| Match Mode      | select (string)           | No       | How the target should be matched against Ahrefs' index. Available values: Subdomains (default), Exact URL, URL Prefix, Root Domain.                                                                                                                                                                                                                                                                                                                                                             |
| Protocol        | select (string)           | No       | Restrict to a specific link protocol. Available values: Both (default), HTTPS, HTTP.                                                                                                                                                                                                                                                                                                                                                                                                            |
| Comparison Date | string                    | No       | Optional comparison date in YYYY-MM-DD format.                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Volume Mode     | select (string)           | No       | How search volume is aggregated. Available values: Monthly (default), Average.                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Limit           | integer                   | No       | Max rows to return (1-10000).                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Order By        | string                    | No       | Ordering clause, e.g. 'keywords\_common:desc'.                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Filter          | string                    | No       | Filter expression using Ahrefs filter syntax.                                                                                                                                                                                                                                                                                                                                                                                                                                                   |

**Outputs**

| Field       | Type    | Description                       |
| ----------- | ------- | --------------------------------- |
| Competitors | array   | Array of organic-competitor rows. |
| Row Count   | integer | Number of rows returned.          |

#### Keywords Explorer Matching Terms

Find keyword ideas that match a seed keyword or list (term-based expansion).

**Inputs**

| Field           | Type                      | Required | Description                                                                                                                                                                                                                                                               |
| --------------- | ------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Country         | string                    | Yes      | Two-letter ISO country code (e.g. 'us', 'gb', 'de').                                                                                                                                                                                                                      |
| Seed Source     | select (string)           | Yes      | Choose whether to seed from a list of keywords or a saved Keywords Explorer list. Available values: Keywords, Keyword List. Default: keywords.                                                                                                                            |
| Seed Keywords   | array                     | Yes      | Seed keywords to find matching ideas for. Default: \[].                                                                                                                                                                                                                   |
| Keyword List ID | integer                   | Yes      | Numeric ID of a saved Keywords Explorer list. Open the list in app.ahrefs.com (Keywords Explorer → Lists) and copy the number from the URL, e.g. /keywords-explorer/lists/123456 → 123456.                                                                                |
| Columns         | multiple\_select (string) | No       | Columns to return for each keyword row. Available values: CPC, CPS, Difficulty, First Seen, Global Volume, Intents, Keyword, Parent Topic, Serp Features, Serp Last Update, Traffic Potential, Volume, Volume Desktop Pct, Volume Mobile Pct, Volume Monthly, Word Count. |
| Match Mode      | string                    | No       | Match strategy (defaults to 'terms').                                                                                                                                                                                                                                     |
| Terms Filter    | string                    | No       | Subset of terms to include (defaults to 'all').                                                                                                                                                                                                                           |
| Search Engine   | string                    | No       | Search engine (defaults to 'google').                                                                                                                                                                                                                                     |
| Limit           | integer                   | No       | Max rows to return (1-10000).                                                                                                                                                                                                                                             |
| Order By        | string                    | No       | Ordering clause, e.g. 'volume:desc'.                                                                                                                                                                                                                                      |
| Filter          | string                    | No       | Filter expression using Ahrefs filter syntax.                                                                                                                                                                                                                             |

**Outputs**

| Field     | Type    | Description                      |
| --------- | ------- | -------------------------------- |
| Keywords  | array   | Array of matching keyword ideas. |
| Row Count | integer | Number of rows returned.         |

#### Keywords Explorer Related Terms

Find keyword ideas semantically related to a seed keyword or list.

**Inputs**

| Field           | Type                      | Required | Description                                                                                                                                                                                                                                                               |
| --------------- | ------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Country         | string                    | Yes      | Two-letter ISO country code (e.g. 'us', 'gb', 'de').                                                                                                                                                                                                                      |
| Seed Source     | select (string)           | Yes      | Choose whether to seed from a list of keywords or a saved Keywords Explorer list. Available values: Keywords, Keyword List. Default: keywords.                                                                                                                            |
| Seed Keywords   | array                     | Yes      | Seed keywords to find related ideas for. Default: \[].                                                                                                                                                                                                                    |
| Keyword List ID | integer                   | Yes      | Numeric ID of a saved Keywords Explorer list. Open the list in app.ahrefs.com (Keywords Explorer → Lists) and copy the number from the URL, e.g. /keywords-explorer/lists/123456 → 123456.                                                                                |
| Columns         | multiple\_select (string) | No       | Columns to return for each keyword row. Available values: CPC, CPS, Difficulty, First Seen, Global Volume, Intents, Keyword, Parent Topic, Serp Features, Serp Last Update, Traffic Potential, Volume, Volume Desktop Pct, Volume Mobile Pct, Volume Monthly, Word Count. |
| View For        | string                    | No       | SERP slice used to compute relatedness (defaults to 'top\_10').                                                                                                                                                                                                           |
| Terms Filter    | string                    | No       | Subset of terms to include (defaults to 'all').                                                                                                                                                                                                                           |
| Limit           | integer                   | No       | Max rows to return (1-10000).                                                                                                                                                                                                                                             |
| Order By        | string                    | No       | Ordering clause, e.g. 'volume:desc'.                                                                                                                                                                                                                                      |
| Filter          | string                    | No       | Filter expression using Ahrefs filter syntax.                                                                                                                                                                                                                             |

**Outputs**

| Field     | Type    | Description                     |
| --------- | ------- | ------------------------------- |
| Keywords  | array   | Array of related keyword ideas. |
| Row Count | integer | Number of rows returned.        |

#### Keywords Explorer Volume History

Return monthly search-volume history for a single keyword in a country.

**Inputs**

| Field     | Type   | Required | Description                                                    |
| --------- | ------ | -------- | -------------------------------------------------------------- |
| Keyword   | string | Yes      | Single keyword to fetch volume history for.                    |
| Country   | string | Yes      | Two-letter ISO country code (e.g. 'us', 'gb', 'de').           |
| From Date | string | No       | Start date in YYYY-MM-DD format. Use the first day of a month. |
| To Date   | string | No       | End date in YYYY-MM-DD format. Use the first day of a month.   |

**Outputs**

| Field     | Type    | Description                                      |
| --------- | ------- | ------------------------------------------------ |
| Metrics   | array   | Array of monthly volume entries (date + volume). |
| Row Count | integer | Number of monthly entries returned.              |

### Important behavior

Actions that create, update, send, or delete data can change the connected service. Review their inputs before running them. A retry can repeat an operation; consider this when configuring retries for actions that change data.

The catalog lists the fields and capabilities available in the supplied provider definition. Availability can also depend on your deployment and organization’s Feature Access settings.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/integrations/catalog/ahrefs.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
