---
title: "Get Traffic"
method: GET
path: "/v1/apps/{app_id}/traffic"
tags: ["Metrics"]
---

# Get Traffic

`GET /v1/apps/{app_id}/traffic`

Get API traffic data for an app. Grouped by hour or by day. With pagination. Traffic to endpoints that have been excluded in the dashboard is excluded here as well.

## Path parameters

- `app_id` integer, required — App ID

## Query parameters

- `app_env_id` integer, nullable — Filter to environment ID, if provided.
- `consumer_id` integer, nullable — Filter to consumer ID, if provided.
- `start` string, date-time, nullable — Start date and time in ISO 8601 format. Defaults to 24 hours ago if `interval` is "hour", or 30 days ago if `interval` is "day". Will be rounded down to the beginning of the interval (hour or day).
- `end` string, date-time, nullable — End date and time in ISO 8601 format. Defaults to now.
- `interval` 'hour' | 'day', nullable — Whether to group by day or by hour.
- `timezone` string, nullable — Timezone to use for intervals and to interpret `start` and `end` if given without offset. Defaults to UTC.
- `limit` integer — Maximum number of records to return per page
- `next_token` string, nullable — Token to fetch the next page of records, as returned by a previous request.

## Response `200`

Successful Response

- GetTrafficResponse
  - `data` TrafficItem[], required — List of traffic data.
    - `period_start` string, date-time, required — Start of the period in ISO 8601 format with timezone offset.
    - `period_end` string, date-time, required — End of the period in ISO 8601 format with timezone offset.
    - `requests` integer, required — Number of requests.
    - `bytes_received` integer, required — Number of bytes received.
    - `bytes_sent` integer, required — Number of bytes sent.
  - `has_more` boolean, required — Whether there are more records to fetch.
  - `next_token` string, nullable, required — Token to fetch the next page of records, if there are more.

## Other responses

- `404` — App Not Found
- `422` — Validation Error

---

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