---
title: "Get aggregated metrics by time bucket"
method: GET
path: "/projects/{project_id}/aggregated-buckets"
tags: ["Events"]
---

# Get aggregated metrics by time bucket

`GET /projects/{project_id}/aggregated-buckets`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/projects/{project_id}/aggregated-buckets`
- Auth: HTTP bearer

## Path parameters

- `project_id` integer, required

## Query parameters

- `start_date` string, required
- `end_date` string, required
- `environment_id` integer
- `deployment_id` integer
- `aggregation_level` string
- `bucket_size` string

## Response `200`

Successfully retrieved aggregated buckets

- AggregatedBucketsResponse
  - `aggregation_level` string, required
  - `bucket_size` string, required
  - `items` AggregatedBucketItem[], required
    - `count` integer, required
    - `timestamp` string, required
  - `total` integer, required

## Other responses

- `400`: Invalid range, or a bucket size that would return too many points
- `401`: Unauthorized
- `500`: Internal server error

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
