> ## 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 Metrics By Country

> Break down a domain or URL's organic and paid search metrics by country from Ahrefs Site Explorer: keywords, top-3 keywords, traffic, traffic value, paid keywords, paid pages, paid traffic and cost

Break down a domain or URL's organic and paid search metrics by country from Ahrefs Site Explorer: keywords, top-3 keywords, traffic, traffic value, paid keywords, paid pages, paid traffic and cost. Traffic and cost fields cost 10 units per country row.

| | |
| - | - |
| **App** | Ahrefs |
| **Operation ID** | `ahrefs_get_metrics_by_country` |
| **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 break down by country (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). |
| `date` | string | No | - | Report date in YYYY-MM-DD format. Defaults to today (latest data). |
| `metrics` | array of string or SelectableOption | No | - | Metrics to return per country (country is always included). Available: org\_keywords, org\_keywords\_1\_3, org\_traffic, org\_cost (USD), paid\_keywords, paid\_pages, paid\_traffic, paid\_cost (USD). Ahrefs API unit cost per row: org\_traffic, org\_cost, paid\_traffic and paid\_cost cost 10 units each, the rest 1. Defaults to all of them. |
| `limit` | integer | No | - | Maximum number of countries to return, ordered by organic traffic. Leave empty for all countries with data. |

### SelectableOption

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

## Output

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

Returns one row per country with country plus the selected fields: org\_keywords, org\_keywords\_1\_3, org\_traffic, org\_cost (USD), paid\_keywords, paid\_pages, paid\_traffic, paid\_cost (USD).

**Fields**: `country`, `org_keywords`, `org_keywords_1_3`, `org_traffic`, `org_cost`, `paid_keywords`, `paid_pages`, `paid_traffic`, `paid_cost`

**Example**:

```json theme={"dark"}
[
  {
    "country": "US",
    "org_keywords": 24739,
    "org_keywords_1_3": 9835,
    "org_traffic": 5168733,
    "org_cost": 7384141.91,
    "paid_keywords": 53
  }
]
```


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