---
title: "Statistics"
method: GET
path: "/v2/databases/{db_id}/statistics"
tags: ["Database (v2)"]
---

# Statistics

`GET /v2/databases/{db_id}/statistics`

## Request

- Base URL: `https://api.bunny.net/database`
- URL: `https://api.bunny.net/database/v2/databases/{db_id}/statistics`
- Auth: one of:
  - API key in header `Authorization`
  - API key in header `AccessKey`
- TypeScript: <https://skmtc.dev/bunny/apis/bunny-database-backend-api/docs/v2/databases/:db_id/statistics/get.ts> (a function with typed inputs; its response is checked against the schema)

Get the associated stats for a Database.

The buckets are return by the starting hour.

## Path parameters

- `db_id` string, required: [DatabaseId] is a `db_<ulid>`

## Query parameters

- `from` string, date-time, required
- `to` string, date-time, required

## Response `200`

- StatsDatabaseV2Response
  - `row_read_count` SingleRegionChart, required
    - `unit` 'NoUnit' | 'milliseconds' | 'megabyte', required
    - `data` Datapoint[], required
      - unknown[]
        - unknown
    - `diff` number, double, nullable: The difference between the result from the time window, will be between -1 and 1
  - `row_write_count` SingleRegionChart, required
    - `unit` 'NoUnit' | 'milliseconds' | 'megabyte', required
    - `data` Datapoint[], required
      - unknown[]
        - unknown
    - `diff` number, double, nullable: The difference between the result from the time window, will be between -1 and 1
  - `delegated_write_requests` SingleRegionChart, required
    - `unit` 'NoUnit' | 'milliseconds' | 'megabyte', required
    - `data` Datapoint[], required
      - unknown[]
        - unknown
    - `diff` number, double, nullable: The difference between the result from the time window, will be between -1 and 1
  - `storage` SingleRegionChart, required
    - `unit` 'NoUnit' | 'milliseconds' | 'megabyte', required
    - `data` Datapoint[], required
      - unknown[]
        - unknown
    - `diff` number, double, nullable: The difference between the result from the time window, will be between -1 and 1
  - `latency` LatencySingleRegionChart, required
    - `unit` 'NoUnit' | 'milliseconds' | 'megabyte', required
    - `data` object, required
  - `query_count` SingleRegionChart, required
    - `unit` 'NoUnit' | 'milliseconds' | 'megabyte', required
    - `data` Datapoint[], required
      - unknown[]
        - unknown
    - `diff` number, double, nullable: The difference between the result from the time window, will be between -1 and 1

## Other responses

- `4XX`: A default error response for most API errors.
- `5XX`: A default error response for most API errors.

---

[API](https://skmtc.dev/bunny/apis/bunny-database-backend-api.md) - [All operations](https://skmtc.dev/bunny/apis/bunny-database-backend-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bunny/apis/bunny-database-backend-api/revisions/f3bb69bad6b6?raw)
