# Get session analytics

`GET https://api.parklio.com/v2/sessions/analytics`

Returns parking analytics data based on the provided filters.

---

### Metrics (`metric` filter)

| Metric | Description |
|--------|-------------|
| `entry_count` |  The total number of vehicles that entered over a given period |
| `exit_count` | The total number of vehicles that exited over a given period |
| `peak_entry_time` | The hour of the day (0–23) with the highest number of vehicle entries |
| `peak_exit_time` | The hour of the day (0–23) with the highest number of vehicle exits |

---

### Scopes (`scope` filter)

| Scope | Description | ID filter |
|-------|-------------|-----------|
| `lot` | Aggregates data per parking lot | `lot_ids` |
| `zone` | Aggregates data per zone within a lot | `zone_ids` |
| *(none)* | No scope provided — returns a single aggregated result across all matched entities | — |

---

### Intervals (`interval` filter)

| Interval | Description | Response shape |
|----------|-------------|----------------|
| *(none)* | No interval — returns a single cumulative value | `number` |
| `hour` | Breaks data down by hour of the day | `number[]` with 24 values (index 0 = midnight, 23 = 11PM) |
| `day` | Breaks data down by day of the week | `number[]` with 7 values (index 0 = Sunday, 6 = Saturday) |
| `month` | Breaks data down by month of the year | `number[]` with 12 values (index 0 = January, 11 = December) |

---

> **Note:** `peak_entry_time and peak_exit_time` does not support intervals — it always returns a single `number | null` value regardless of the `interval` filter.

**Auth:** `Authorization: Bearer <token>`

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `filter` | string[] | yes | Filter as `field:rule:value`, for example `lot_id:eq:7`. Repeat `filter` to combine filters; all must match. See [Filtering](/api/conventions#filtering). |

## Responses

### 200 — Returns analytics data based on the provided filters.

```json
[
  null
]
```

