# Data links (CSV and JSON)

URL: https://countvue.com/docs/portal/data-links
Applies to: CountVue Portal

> Get a report's data at a permanent secret address as CSV or JSON for Excel, Google Sheets, Power BI, Looker Studio and your own scripts.

A **data link** is a permanent address that returns a report's data: the same period, cameras, lines, filters and interval as the report on the dashboard. Use it to load counts into a spreadsheet or a BI tool that refreshes by itself.

## Turn a data link on

1. In the report's menu choose **Data link…**.
2. Turn it on. You get two addresses:
   - `https://app.countvue.com/data/<key>.json`
   - `https://app.countvue.com/data/<key>.csv`
3. Optionally require a **token**: then requests must send `Authorization: Bearer <token>`. The token is shown once, when it is made; copy it then.
4. Press **Done**.

## Formats

**CSV** has a header row with the report's columns and one row per interval. It is UTF-8 with a byte order mark, so Excel opens it with the right characters.

**JSON** looks like this:

```json
{
  "report": {"id": 12, "title": "Entrance", "type": "events"},
  "timezone": "Europe/Berlin",
  "period": {"from": "2026-11-17", "to": "2026-11-23"},
  "step": "1h",
  "generated": "2026-11-24T08:03:30+01:00",
  "columns": ["time", "In", "Out"],
  "rows": [
    {"time": "2026-11-17T08:00:00+01:00", "In": 41, "Out": 12}
  ]
}
```

- Times are RFC 3339 with the location's offset.
- A report with several periods has `periods` per series instead of `period`, and each series has its own time column.
- A heatmap is JSON only: `{"heatmap": {"x_cells", "y_cells", "hours", "cells"}}`.
- Live counters have no data link; use a report of a period, such as *Today*.

## Freshness and limits

The data are refreshed when new data come in, every 15 minutes. A link answers at most 60 requests a minute.

## Use it in tools

| Tool | How |
|---|---|
| Excel | Data → From Web, paste the CSV address |
| Google Sheets | `=IMPORTDATA("https://app.countvue.com/data/<key>.csv")` |
| Power BI | Get data → Web, the CSV or JSON address (add the Authorization header in Advanced if you use a token) |
| Scripts | `curl -H "Authorization: Bearer <token>" https://app.countvue.com/data/<key>.json` |

## Keep it secret

Anyone with the address gets the data (unless you also require a token). If it got out, make a **new address**: the old one stops at once.

For a full programmatic interface, see [REST API](https://countvue.com/docs/reference/api).
