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

# Links

> Per-link performance — clicks, visitors, conversions and revenue for each tracking link.

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

`GET /api/v1/links` — per-link performance for a time window, sorted 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="limit" type="integer" default="100">
  Maximum links to return (max 500).
</ParamField>

## Response

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

<ResponseField name="links" type="array">
  One row per link, sorted by revenue descending: `slug`, `channel`, `destination`, `clicks`,
  `visitors`, `conversions`, `revenue`.
</ResponseField>

<ResponseExample>
  ```json Response theme={null}
  {
    "window": { "from": "2026-06-21T00:00:00.000Z", "to": "2026-07-21T00:00:00.000Z" },
    "links": [
      {
        "slug": "spring-newsletter",
        "channel": "newsletter",
        "destination": "https://yourapp.com/pricing",
        "clicks": 412,
        "visitors": 388,
        "conversions": 21,
        "revenue": 1890.0
      }
    ]
  }
  ```
</ResponseExample>
