> For the complete documentation index, see [llms.txt](https://docs.ipdunar.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ipdunar.com/products/overview/statistics.md).

# 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-IPdunar-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-IPdunar-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.ipdunar.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.ipdunar.com/v1/residential/requests?subuser=s1a2b3c4d5e&limit=100"
```

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

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

## Per-response headers

Every successful request includes these usage hints:

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

Use `X-IPdunar-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-IPdunar-Tag` request header (max 64 chars, `[a-z0-9_-]`):

```bash
curl -x http://ipdunar_s1a2b3c4d5e-type-res-region-us:PASSWORD@gate.ipdunar.com:7777 \
     -H "X-IPdunar-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-IPdunar-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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ipdunar.com/products/overview/statistics.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
