# Statistics

You can read residential traffic and request data in three places: the dashboard, the REST API, and per-response headers.

## Dashboard

**Dashboard → Residential → Statistics** shows:

* **Traffic over time** — bytes per minute / hour / day, stacked by sub-user
* **Top destinations** — domains by traffic and request count
* **Top countries** — exit IP geos used
* **Error breakdown** — by HTTP status and `X-Helodata-Error-Code`
* **Session count** — concurrent sticky sessions
* **Concurrency** — peak parallel connections

Filter by sub-user, by date range, and by tag (if you set `X-Helodata-Tag` on requests — see below).

Data refreshes every minute. Granularity downsamples after 14 days (1-min → 5-min) and 90 days (5-min → 1-hour).

## REST API

For programmatic access — useful for billing pipelines, custom dashboards, and alerting.

### Get aggregate traffic

```bash
curl -H "Authorization: Bearer API_KEY" \
     "https://api.helodata.com/v1/residential/traffic?from=2026-05-01&to=2026-05-28&group_by=subuser"
```

Response:

```json
{
  "from": "2026-05-01T00:00:00Z",
  "to":   "2026-05-28T00:00:00Z",
  "rows": [
    { "subuser": "s1a2b3c4d5e", "bytes_in": 12345678, "bytes_out": 9876543, "requests": 4210 },
    { "subuser": "s9z8y7x6w5v", "bytes_in": 222345,   "bytes_out": 134567,  "requests": 88 }
  ]
}
```

`group_by` accepts `subuser`, `region`, `asn`, `tag`, or `day`.

### Get per-request log (sample)

For debugging only — costs API quota. Returns the last 1,000 sampled requests.

```bash
curl -H "Authorization: Bearer API_KEY" \
     "https://api.helodata.com/v1/residential/requests?subuser=s1a2b3c4d5e&limit=100"
```

Each entry includes status, exit IP, geo, ASN, bytes, and your tag.

Full schema: [Traffic & usage](/api-reference/traffic.md).

## Per-response headers

Every successful request includes these usage hints:

```
X-Helodata-Bytes-In: 1248
X-Helodata-Bytes-Out: 38745
X-Helodata-Exit-IP: 198.51.100.42
X-Helodata-Exit-Geo: us/ca/la
X-Helodata-Exit-ASN: 7922
X-Helodata-Request-Id: req_01HX2K3PQ4M5
```

Use `X-Helodata-Request-Id` when contacting support — we can pull the full request record from it.

## Tagging requests

To slice analytics by your own categories (campaign, customer, job), send a `X-Helodata-Tag` request header (max 64 chars, `[a-z0-9_-]`):

```bash
curl -x http://helo_s1a2b3c4d5e-type-res-region-us:PASSWORD@gate.helodata.io:7777 \
     -H "X-Helodata-Tag: campaign-acme-q2" \
     https://example.com
```

Tags appear in dashboard filters and as a `group_by` value in the traffic API.

## Billing reconciliation

Bandwidth shown in the dashboard is what you're billed for. To reconcile against your own logs:

1. Pull the traffic API at day granularity for the billing period.
2. Sum `bytes_in + bytes_out` across sub-users.
3. Match against the invoice line on **Billing → Invoices**.

Discrepancies > 1% are rare; if you see one, open a support ticket with the `X-Helodata-Request-Id` range and we'll investigate.

## Alerts

Set up usage alerts under **Dashboard → Alerts**:

* Daily traffic exceeds X GB
* Error rate exceeds Y% over Z minutes
* Sub-user concurrency near plan limit

Alerts deliver via email and optional Slack webhook.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.helodata.com/products/overview/statistics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
