---
title: "Get Warehouse Statistics"
method: GET
path: "/management/v1/warehouse/{warehouse_id}/statistics"
tags: ["warehouse"]
---

# Get Warehouse Statistics

`GET /management/v1/warehouse/{warehouse_id}/statistics`

## Request

- Base URL: `https://localhost`
- URL: `https://localhost/management/v1/warehouse/{warehouse_id}/statistics`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/lakekeeper/apis/lakekeeper-management-api/docs/management/v1/warehouse/:warehouse_id/statistics/get.ts> (a function with typed inputs; its response is checked against the schema)

Retrieves statistical data about a warehouse's usage and resources over time.
Statistics are aggregated hourly when changes occur.

We lazily create a new statistics entry every hour, in between hours, the existing entry is
being updated. If there's a change at `created_at + 1 hour`, a new entry is created.
If there's been no change, no new entry is created, meaning there may be gaps.

Example:
- 00:16:32: warehouse created:
    - `timestamp: 01:00:00, created_at: 00:16:32, updated_at: null, 0 tables, 0 views`
- 00:30:00: table created:
    - `timestamp: 01:00:00, created_at: 00:16:32, updated_at: 00:30:00, 1 table, 0 views`
- 00:45:00: view created:
    - `timestamp: 01:00:00, created_at: 00:16:32, updated_at: 00:45:00, 1 table, 1 view`
- 01:00:36: table deleted:
    - `timestamp: 02:00:00, created_at: 01:00:36, updated_at: null, 0 tables, 1 view`
    - `timestamp: 01:00:00, created_at: 00:16:32, updated_at: 00:45:00, 1 table, 1 view`

## Path parameters

- `warehouse_id` string, uuid, required

## Query parameters

- `page_token` string
- `page_size` integer, nullable

## Response `200`

Warehouse statistics

- WarehouseStatisticsResponse
  - `next-page-token` string, nullable: Next page token
  - `stats` WarehouseStatistics[], required: Ordered list of warehouse statistics.
    - `number-of-tables` integer, required: Number of tables in the warehouse.
    - `number-of-views` integer, required: Number of views in the warehouse.
    - `timestamp` string, date-time, required: Timestamp of when these statistics are valid until We lazily create a new statistics entry every hour, in between hours, the existing entry is being updated. If there's a change at `created_at` + 1 hour, a new entry is created. If there's no change, no new entry is created.
    - `updated-at` string, date-time, required: Timestamp of when these statistics were last updated
  - `warehouse-ident` string, uuid, required: ID of the warehouse for which the stats were collected.

## Other responses

- `4XX`

---

[API](https://skmtc.dev/lakekeeper/apis/lakekeeper-management-api.md) - [All operations](https://skmtc.dev/lakekeeper/apis/lakekeeper-management-api/llms.txt) - [OpenAPI document](https://skmtc.dev/lakekeeper/apis/lakekeeper-management-api/revisions/c5cb9a12a98c?raw)
