---
title: "Get Session Counts"
method: GET
path: "/v3/sessions/counts"
tags: ["Sessions"]
---

# Get Session Counts

`GET /v3/sessions/counts`

Returns aggregated counts of sessions grouped by the specified fields.
Useful for building dashboards and understanding traffic distribution.

## Query parameters

- `scope` 'workspace' | 'demo'
- `start_time` string, date-time, required
- `end_time` string, date-time, required
- `fields` string, required
- `query` string
- `size` integer

## Response `200`

OK - request successful.

- SessionCountsResponse
  - `items` SessionCountItem[] — Aggregated count items.
    - `label` string — The value of the aggregated field.
    - `count` integer — Number of sessions for this value.
    - `children` SessionCountItem[] — Nested aggregation results for multi-field queries.
  - `total` integer — Total number of sessions matching the query.
  - `request_metadata` object
    - `start_time` string
    - `end_time` string
    - `query` string
    - `fields` string[]

## Other responses

- `400` — Bad request - request syntax is invalid for the specified endpoint. Verify request syntax and try again.
- `401` — Unauthorized. Please check your API key.
- `403` — Forbidden - request is not authorized due to an invalid API key or plan limitations. If due to plan limitations, contact sales@greynoise.io to upgrade your plan and unlock full results.
- `429` — Too many requests. You've hit the rate-limit.
- `500` — Unexpected error

---

[API](https://skmtc.dev/greynoise/apis/greynoise-api.md) · [All operations](https://skmtc.dev/greynoise/apis/greynoise-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/greynoise/greynoise-api/revisions/30942574656d/schema)
