> ## 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 Referring Domains

> List the domains linking to a target from Ahrefs Site Explorer with Domain Rating, number of links, dofollow links, new and lost links, spam flag and dates

List the domains linking to a target from Ahrefs Site Explorer with Domain Rating, number of links, dofollow links, new and lost links, spam flag and dates. Use ahrefs\_get\_backlinks for individual links.

|                      |                                |
| -------------------- | ------------------------------ |
| **App**              | Ahrefs                         |
| **Operation ID**     | `ahrefs_get_referring_domains` |
| **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 referring domains 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 (domain is always included). Available: domain\_rating, links\_to\_target, dofollow\_links, new\_links, lost\_links, first\_seen, last\_seen, is\_spam, is\_root\_domain, ip\_source, traffic\_domain, positions\_source\_domain, dofollow\_refdomains, dofollow\_linked\_domains. Ahrefs API unit cost per row: traffic\_domain costs 10 units, dofollow\_refdomains 5, the rest 1. Defaults to domain\_rating, links\_to\_target, dofollow\_links, first\_seen, last\_seen, is\_spam. |
| `filters`    | array of FilterItem                 | No       | -            | Filters on the available columns, e.g. domain\_rating GREATER\_THAN 50 or is\_spam EQUALS false. 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 referring domain with the selected Ahrefs fields: domain, domain\_rating, links\_to\_target, dofollow\_links, new\_links, lost\_links, first\_seen, last\_seen, is\_spam, is\_root\_domain, ip\_source, traffic\_domain, positions\_source\_domain, dofollow\_refdomains, dofollow\_linked\_domains.

**Fields**: `domain`, `domain_rating`, `links_to_target`, `dofollow_links`, `first_seen`, `last_seen`, `is_spam`

**Example**:

```json theme={"dark"}
[
  {
    "domain": "google.com",
    "domain_rating": 99.0,
    "links_to_target": 326,
    "dofollow_links": 127,
    "first_seen": "2013-08-19T17:59:53Z",
    "last_seen": null,
    "is_spam": false
  }
]
```
