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

# Channels

> Channel performance — clicks, visitors, conversions and revenue — ranked by revenue, with optional lifetime value.

<RequestExample>
  ```bash cURL theme={null}
  curl "https://app.trackrev.io/api/v1/channels?days=30&ltv=1" \
    -H "Authorization: Bearer <your secret key>"
  ```
</RequestExample>

`GET /api/v1/channels` — channel performance for a time window, ranked by revenue.

**Scope:** secret key (`lk_`).

## Query parameters

<ParamField query="days" type="integer" default="30">
  Last N days ending now (1–365). Alternative to `from`/`to`.
</ParamField>

<ParamField query="from" type="string (ISO 8601)">
  Start of an explicit window `[from, to)`.
</ParamField>

<ParamField query="to" type="string (ISO 8601)">
  End of the window; defaults to now.
</ParamField>

<ParamField query="ltv" type="boolean">
  Set `ltv=1` to merge all-time lifetime value per channel into each row (adds an `ltv` field).
</ParamField>

## Response

<ResponseField name="window" type="object">
  The resolved `{ from, to }` window.
</ResponseField>

<ResponseField name="channels" type="array">
  One row per channel, sorted by revenue descending. Each row: `channel`, `clicks`, `visitors`,
  `conversions`, `revenue`, and `ltv` (when `ltv=1`).
</ResponseField>

<ResponseExample>
  ```json Response theme={null}
  {
    "window": { "from": "2026-06-21T00:00:00.000Z", "to": "2026-07-21T00:00:00.000Z" },
    "channels": [
      {
        "channel": "newsletter",
        "clicks": 1204,
        "visitors": 980,
        "conversions": 47,
        "revenue": 4231.5,
        "ltv": 9120.0
      },
      {
        "channel": "twitter",
        "clicks": 860,
        "visitors": 731,
        "conversions": 18,
        "revenue": 1620.0,
        "ltv": 3040.0
      }
    ]
  }
  ```
</ResponseExample>
