---
title: "Get aggregated traffic data for a given time period."
method: GET
path: "/api/admin/metrics/traffic"
tags: ["Metrics"]
---

# Get aggregated traffic data for a given time period.

`GET /api/admin/metrics/traffic`

**Enterprise feature**

Gets traffic usage data for the selected period, either aggregated by day or by month.

## Query parameters

- `grouping` 'daily' | 'monthly', required
- `from` string, date, required
- `to` string, date, required

## Response `200`

trafficUsageDataSegmentedCombinedSchema

- TrafficUsageDataSegmentedCombinedSchema — Contains the recorded data usage for each API path, segmented by day/month and type of traffic
  - `grouping` 'monthly' | 'daily', required — Whether the data is aggregated by month or by day.
  - `dateRange` object, required — The date range there is data for. The range is inclusive and goes from the start of the `from` date to the end of the `to` date
    - `from` string, date, required — The start of the dateRange
    - `to` string, date, required — The end of the dateRange
  - `apiData` object[], required — Contains the recorded daily/monthly data usage for each API path
    - `apiPath` string, required — The API path
    - `dataPoints` object[], required — The recorded data points for the API path
      - `period` string, required — The date of the data point. Formatted as a full date (e.g. 2023-04-01) if the data is aggregated by day or as a month (e.g. 2023-04) if the data is aggregated by month.
      - `trafficTypes` object[], required — The recorded traffic types for the data point
        - `group` string, required — The type of traffic
        - `count` integer, required — The number of requests

---

[API](https://skmtc.net/unleash/apis/unleash-api-3.md) · [All operations](https://skmtc.net/unleash/apis/unleash-api-3/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/unleash/unleash-api-3/versions/b2c3116e633e/schema)
