> ## 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 traffic sources

> Where visitors came from, with orders and revenue for each channel.

Where visitors came from, such as direct, search, social, email and referrals. 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`. |

## Request

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

## Response

```json theme={null}
{
  "message": "Traffic sources retrieved",
  "success": true,
  "status": true,
  "data": {
    "environment": "live",
    "range": "30d",
    "currency": "USD",
    "tracked": true,
    "items": [
      {
        "channel": "direct",
        "sessions": 320,
        "visitors": 290,
        "reached_checkout": 40,
        "orders": 9,
        "revenue": 72000
      }
    ]
  }
}
```

## 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.