> ## Documentation Index
> Fetch the complete documentation index at: https://docs.markifact.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Anchors

> List the anchor texts used in backlinks to a target from Ahrefs Site Explorer, with referring domains and pages, link counts, dofollow links, new and lost links and the top Domain Rating per anchor

List the anchor texts used in backlinks to a target from Ahrefs Site Explorer, with referring domains and pages, link counts, dofollow links, new and lost links and the top Domain Rating per anchor.

|                      |                      |
| -------------------- | -------------------- |
| **App**              | Ahrefs               |
| **Operation ID**     | `ahrefs_get_anchors` |
| **Type**             | Action               |
| **Connection**       | `ahrefs` (required)  |
| **Credits per run**  | Free                 |
| **Agent / MCP tool** | Yes                  |

## Inputs

| Field        | Type                                | Required | Default      | Description                                                                                                                                                                                                                                                                                                                                                         |
| ------------ | ----------------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `target`     | string                              | Yes      | -            | The domain, subdomain, subfolder or URL to list backlink anchor texts for (e.g. example.com).                                                                                                                                                                                                                                                                       |
| `mode`       | string or SelectableOption          | No       | `subdomains` | How to interpret the target: 'subdomains' (domain and all subdomains, default), 'domain' (the exact host only), 'prefix' (every URL starting with the target), or 'exact' (the exact URL only).                                                                                                                                                                     |
| `history`    | string or SelectableOption          | No       | `all_time`   | 'live' counts only currently live backlinks; 'all\_time' also includes lost ones. Ignored when since\_date is set.                                                                                                                                                                                                                                                  |
| `since_date` | string                              | No       | -            | Include backlinks lost since this date (YYYY-MM-DD) in addition to live ones. Overrides history.                                                                                                                                                                                                                                                                    |
| `metrics`    | array of string or SelectableOption | No       | -            | Columns to return (anchor is always included). Available: refdomains, refpages, links\_to\_target, dofollow\_links, new\_links, lost\_links, top\_domain\_rating, first\_seen, last\_seen, is\_spam. Ahrefs API unit cost per row: refdomains costs 5 units, the rest 1. Defaults to refdomains, refpages, links\_to\_target, dofollow\_links, top\_domain\_rating. |
| `filters`    | array of FilterItem                 | No       | -            | Filters on the available columns, e.g. refdomains GREATER\_THAN 5 or anchor CONTAINS 'brand'. Filter fields count towards the unit cost per row.                                                                                                                                                                                                                    |
| `orders`     | array of OrderItem                  | No       | -            | Sort by one or more columns.                                                                                                                                                                                                                                                                                                                                        |
| `limit`      | integer                             | No       | `100`        | Maximum number of rows to return. Defaults to 100. Your Ahrefs plan caps rows per request (Lite 100, Standard 250, Advanced 500).                                                                                                                                                                                                                                   |

### FilterItem

| Field      | Type                       | Required | Default | Description                                                                                                                                                                             |
| ---------- | -------------------------- | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `field`    | string or SelectableOption | Yes      | -       | The field to filter on, must be one of the current selected metrics or dimensions.                                                                                                      |
| `operator` | string                     | Yes      | -       | The operator to use for filtering. Must be one of the supported values. Use REGEXP\_MATCH to search/filter by multiple OR values like '.*(summer\|holiday).*'                           |
| `value`    | string                     | Yes      | -       | The value to filter by, always as a string: text, a number, or a regex. For IN\_LIST and NOT\_IN\_LIST, pass the values as one comma-separated string such as 'a,b,c', not as an array. |

### OrderItem

| Field       | Type                       | Required | Default | Description                                                                      |
| ----------- | -------------------------- | -------- | ------- | -------------------------------------------------------------------------------- |
| `field`     | string or SelectableOption | Yes      | -       | The field to sort by. must be one of the current selected metrics or dimensions. |
| `direction` | string                     | Yes      | -       | The order to sort by, must be one of 'ASC', 'DESC'                               |

### SelectableOption

| Field   | Type   | Required | Default | Description |
| ------- | ------ | -------- | ------- | ----------- |
| `value` | string | Yes      | -       |             |
| `label` | string | Yes      | -       |             |

## Output

**Type**: `List[Dict]`

Returns one row per anchor text with the selected Ahrefs fields: anchor, refdomains, refpages, links\_to\_target, dofollow\_links, new\_links, lost\_links, top\_domain\_rating, first\_seen, last\_seen, is\_spam.

**Fields**: `anchor`, `refdomains`, `refpages`, `links_to_target`, `dofollow_links`, `top_domain_rating`

**Example**:

```json theme={"dark"}
[
  {
    "anchor": "ahrefs",
    "refdomains": 18234,
    "refpages": 91022,
    "links_to_target": 120453,
    "dofollow_links": 88210,
    "top_domain_rating": 99.0
  }
]
```
