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

# Get top countries

> Which countries visitors came from, with orders and revenue for each.

Which countries visitors came from. Needs Store Pulse on the business's plan. Without it, the response is `403` with `BUSINESS_FEATURE_UNAVAILABLE`.

Call this from your server with a `pk_` key. See [Store data overview](https://docs.khaime.com/api-reference/store-data/overview.md) for keys, errors and how to read empty values.

## Parameters

| Name | Type | Required | Description |
| - | - | - | - |
| `range` | string | No | `today`, `7d`, `30d` or `90d`. Default `30d`. |
| `limit` | integer | No | How many rows, 1 to 50. Default 20. |

## Request

```bash theme={null}
curl -H "X-API-Key: $KHAIME_API_KEY" \
  "https://api.khaime.com/api/v1/analytics/countries?range=30d&limit=5"
```

## Response

```json theme={null}
{
  "message": "Top countries retrieved",
  "success": true,
  "status": true,
  "data": {
    "environment": "live",
    "range": "30d",
    "currency": "USD",
    "tracked": true,
    "items": [
      {
        "country_code": "NG",
        "sessions": 210,
        "visitors": 188,
        "orders": 6,
        "revenue": 41000
      }
    ]
  }
}
```

## Read it correctly

* `revenue` is in hundredths of `currency`.
* `tracked: false` with no `items` means no tracker is running. It does not mean no visitors came.


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