> ## 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 Organic Keywords

> List the organic keywords a domain, subfolder or URL ranks for in Ahrefs Site Explorer with position, ranking URL, volume, difficulty, CPC, traffic and SERP features, optionally compared against an...

List the organic keywords a domain, subfolder or URL ranks for in Ahrefs Site Explorer with position, ranking URL, volume, difficulty, CPC, traffic and SERP features, optionally compared against an earlier date. Use ahrefs\_get\_top\_pages for the page-level view.

| | |
| - | - |
| **App** | Ahrefs |
| **Operation ID** | `ahrefs_get_organic_keywords` |
| **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 pull ranking keywords 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 (keyword is always included). Available: best\_position, best\_position\_prev, best\_position\_diff, best\_position\_url, best\_position\_kind, best\_position\_has\_thumbnail, best\_position\_has\_video, volume, volume\_prev, keyword\_difficulty, cpc (USD), sum\_traffic, sum\_traffic\_prev, sum\_paid\_traffic, serp\_features, serp\_features\_count, is\_branded, is\_commercial, is\_informational, is\_local, is\_navigational, is\_transactional, words, language, keyword\_country, last\_update, status (needs date\_compared), all\_positions, entities, serp\_target\_positions\_count, volume\_desktop\_pct, volume\_mobile\_pct. Ahrefs API unit cost per row: volume, volume\_prev, keyword\_difficulty, sum\_traffic, sum\_traffic\_prev and sum\_paid\_traffic cost 10 units each, all\_positions 5, the rest 1. Defaults to best\_position, best\_position\_url, volume, keyword\_difficulty, cpc, sum\_traffic, serp\_features. |
| `filters` | array of FilterItem | No | - | Filters on the available metrics, e.g. best\_position LESS\_THAN 11 or volume GREATER\_THAN 1000 (all\_positions cannot be filtered on). 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. For regex values, escape backslashes once in the JSON string: write \b for a word boundary, not \b. |

### 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 keyword with the selected Ahrefs fields: keyword, best\_position, best\_position\_url, best\_position\_prev, best\_position\_diff, volume, keyword\_difficulty, cpc (USD), sum\_traffic, serp\_features (comma-separated), intent flags (is\_informational, is\_commercial...), words, last\_update and more.

**Fields**: `keyword`, `best_position`, `best_position_url`, `volume`, `keyword_difficulty`, `cpc`, `sum_traffic`, `serp_features`

**Example**:

```json theme={"dark"}
[
  {
    "keyword": "backlink checker",
    "best_position": 1,
    "best_position_url": "https://ahrefs.com/backlink-checker",
    "volume": 3860000,
    "keyword_difficulty": 79,
    "cpc": 3.2
  }
]
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.