---
title: "Get Database Stats"
method: GET
path: "/redis/stats/{id}"
tags: ["redis"]
---

# Get Database Stats

`GET /redis/stats/{id}`

## Request

- Base URL: `https://api.upstash.com/v2`
- URL: `https://api.upstash.com/v2/redis/stats/{id}`
- Auth: HTTP basic
- TypeScript: <https://skmtc.dev/upstash/apis/developer-api-upstash/docs/redis/stats/:id/get.ts> (a function with typed inputs; its response is checked against the schema)

This endpoint gets detailed stats of a database.

## Path parameters

- `id` string, required

## Query parameters

- `period` string

## Response `200`

Database stats retrieved successfully

- DatabaseStats
  - `monitor_count` TimeSeriesData
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `daily_net_commands` integer: Total number of commands executed today
  - `daily_read_requests` integer: Total number of read requests executed today
  - `daily_write_requests` integer: Total number of write requests executed today
  - `connection_count` TimeSeriesData[]: Connection count over time
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `keyspace` TimeSeriesData[]: Total number of keys in the database over time
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `throughput` TimeSeriesData[]: Throughput on database connections over time
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `diskusage` TimeSeriesData[]: Disk usage over time
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `latency_p50` TimeSeriesData[]: Median (p50) latency over time
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `latencymean` TimeSeriesData[]: Deprecated alias of latency_p50, kept for older clients. Carries the median, not the mean.
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `latency_99` TimeSeriesData[]: 99th percentile latency over time
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `read_latency_p50` TimeSeriesData[]: Median (p50) read latency over time
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `read_latency_mean` TimeSeriesData[]: Deprecated alias of read_latency_p50, kept for older clients. Carries the median, not the mean.
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `read_latency_99` TimeSeriesData[]: 99th percentile read latency over time
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `write_latency_p50` TimeSeriesData[]: Median (p50) write latency over time
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `write_latency_mean` TimeSeriesData[]: Deprecated alias of write_latency_p50, kept for older clients. Carries the median, not the mean.
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `write_latency_99` TimeSeriesData[]: 99th percentile write latency over time
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `hits` TimeSeriesData[]: Cache hits over time
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `misses` TimeSeriesData[]: Cache misses over time
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `read` TimeSeriesData[]: Read requests over time
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `write` TimeSeriesData[]: Write requests over time
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `dailyrequests` TimeSeriesData[]: Daily requests over time
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `days` string[]: Days of the week for measurement
  - `dailybilling` TimeSeriesData[]: Daily billing amounts over time
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `dailybandwidth` integer: Total daily bandwidth usage in bytes
  - `bandwidths` TimeSeriesData[]: Bandwidth usage over time
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `total_monthly_bandwidth` integer: Total bandwidth used in current month (bytes)
  - `total_monthly_requests` integer: Total requests in current month
  - `total_monthly_read_requests` integer: Total read requests in current month
  - `total_monthly_write_requests` integer: Total write requests in current month
  - `total_monthly_script_requests` integer: Deprecated, always 0. Use daily_script_commands from the Prometheus integration
  - `queue_optimized` boolean: Whether queue optimization is enabled for the database
  - `total_monthly_storage` integer: Total storage used in current month (bytes)
  - `current_storage` integer: Current storage used (bytes)
  - `total_monthly_billing` number, float: Total cost in current month
  - `rest_conn_count` TimeSeriesData[]: Open REST connections over time
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `latency_p90` TimeSeriesData[]: Overall 90th percentile latency over time, Pro and Production Pack only
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `command_latency_p50` TimeSeriesData[]: Median time the engine spent executing commands, Pro and Production Pack only
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `command_latency_99` TimeSeriesData[]: 99th percentile time the engine spent executing commands, Pro and Production Pack only
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `wait_latency_99` TimeSeriesData[]: 99th percentile time commands waited for the execution lock, Pro and Production Pack only
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `disk_load_latency_99` TimeSeriesData[]: 99th percentile time to load a key from disk, Pro and Production Pack only
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `disk_loads` TimeSeriesData[]: Keys loaded from disk per ten-minute window, Pro and Production Pack only
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `lua_latency_p50` TimeSeriesData[]: Median Lua script latency over time, Pro and Production Pack only
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `lua_latency_99` TimeSeriesData[]: 99th percentile Lua script latency over time, Pro and Production Pack only
    - `x` string, required: Timestamp when measurement was taken
    - `y` number, required: The measured value
  - `lua_scripts` LuaScriptStat[]: Most executed Lua scripts since midnight UTC, Pro and Production Pack only
    - `sha` string
    - `script_name` string
    - `count` number: Executions today
    - `failures` number
    - `timeouts` number
    - `memory_limits` number
    - `command_count` number: Redis commands the script ran
    - `avg_duration_ns` number
    - `max_duration_ns` number
    - `avg_lua_duration_ns` number
    - `avg_command_duration_ns` number
    - `avg_allocated_bytes` number
    - `max_allocated_bytes` number
  - `lua_script_count` number: Number of distinct Lua scripts run since midnight UTC, Pro and Production Pack only
  - `slow_commands` SlowCommandStat[]: Commands that exceeded the slow threshold today, Pro and Production Pack only
    - `command` string
    - `count` number: Executions today over the slow threshold
    - `max_ms` number: Slowest execution today in milliseconds
  - `acl_user_logins` object[]: Logins per ACL user today, Pro and Production Pack only
    - `username` string
    - `logins` number
  - `command_counts` CommandCount[]: Command-specific counts over time
    - `metric_identifier` string: Command name or metric identifier
    - `data_points` TimeSeriesData[]: Data points for the given command
      - `x` string, required: Timestamp when measurement was taken
      - `y` number, required: The measured value

## Changes

- **2026-10-16** `b1dc731a4680`: 18 info
  - added the new optional `query` request parameter `period`
  - added the optional property `acl_user_logins` to the response with the `200` status
  - added the optional property `command_latency_99` to the response with the `200` status
  - added the optional property `command_latency_p50` to the response with the `200` status
  - …14 more

[Operation history](https://skmtc.dev/upstash/apis/developer-api-upstash/changes/redis/stats/:id/get.md)

---

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