> ## 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 Top Pages

> List the pages of a domain or subfolder that get the most organic search traffic in Ahrefs Site Explorer, with keyword counts, traffic, traffic value, top keyword, URL Rating, referring domains, an...

List the pages of a domain or subfolder that get the most organic search traffic in Ahrefs Site Explorer, with keyword counts, traffic, traffic value, top keyword, URL Rating, referring domains, and AI citation counts per platform on plans with Brand Radar access. Use ahrefs\_get\_organic\_keywords for the keyword-level view.

|                      |                        |
| -------------------- | ---------------------- |
| **App**              | Ahrefs                 |
| **Operation ID**     | `ahrefs_get_top_pages` |
| **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 top organic pages for (e.g. example.com, example.com/blog/).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `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).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `country`       | string or SelectableOption          | No       | -            | Two-letter country code (e.g. us, gb, de) to restrict results to one country. Leave empty for all countries.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `date`          | string                              | No       | -            | Report date in YYYY-MM-DD format. Defaults to today (latest data).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `date_compared` | string                              | No       | -            | Optional earlier date in YYYY-MM-DD format to compare against; enables the \*\_prev and \*\_diff metrics.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `metrics`       | array of string or SelectableOption | No       | -            | Metrics to return (url is always included). Available: keywords, keywords\_prev, keywords\_diff, keywords\_diff\_percent, sum\_traffic, sum\_traffic\_prev, traffic\_diff, traffic\_diff\_percent, value (USD), value\_prev, value\_diff, value\_diff\_percent, top\_keyword, top\_keyword\_volume, top\_keyword\_best\_position, top\_keyword\_country, ur, referring\_domains, page\_type, status (needs date\_compared), and AI citation counts ai\_responses\_chatgpt, ai\_responses\_google\_ai\_overviews, ai\_responses\_google\_ai\_mode, ai\_responses\_gemini, ai\_responses\_perplexity, ai\_responses\_copilot, ai\_responses\_grok (require Brand Radar access on the Ahrefs plan). Ahrefs API unit cost per row: sum\_traffic, sum\_traffic\_prev, value, value\_prev, top\_keyword\_volume and each ai\_responses\_\* field cost 10 units, referring\_domains 5, the rest 1. Defaults to keywords, sum\_traffic, value, top\_keyword, top\_keyword\_best\_position, ur, referring\_domains. |
| `filters`       | array of FilterItem                 | No       | -            | Filters on the available metrics, e.g. sum\_traffic GREATER\_THAN 100 or url CONTAINS '/blog/'. Filter fields count towards the unit cost per row.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `orders`        | array of OrderItem                  | No       | -            | Sort by one or more metrics.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `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 page with the selected Ahrefs fields: url, keywords, sum\_traffic, value (USD), top\_keyword, top\_keyword\_volume, top\_keyword\_best\_position, ur, referring\_domains, page\_type, \*\_prev / **diff comparison fields, and ai\_responses** citation counts.

**Fields**: `url`, `keywords`, `sum_traffic`, `value`, `top_keyword`, `top_keyword_best_position`, `ur`, `referring_domains`

**Example**:

```json theme={"dark"}
[
  {
    "url": "https://ahrefs.com/backlink-checker",
    "keywords": 1411,
    "sum_traffic": 3114948,
    "value": 520661.27,
    "top_keyword": "backlink checker",
    "top_keyword_best_position": 1,
    "ur": 27.0,
    "referring_domains": 4887
  }
]
```
