{
  "schema_version": 2,
  "id": "operate/rs/references/rest-api/requests/bdbs/stats",
  "title": "Database stats requests",
  "url": "https://redis.io/docs/latest/operate/rs/references/rest-api/requests/bdbs/stats/",
  "summary": "Database statistics requests",
  "tags": [
    "docs",
    "operate",
    "rs"
  ],
  "last_updated": "2026-01-30T12:29:26-06:00",
  "children": [
    {
      "id": "operate/rs/references/rest-api/requests/bdbs/stats/last",
      "summary": "Most recent database statistics requests",
      "title": "Latest database stats requests",
      "url": "https://redis.io/docs/latest/operate/rs/references/rest-api/requests/bdbs/stats/last/"
    }
  ],
  "page_type": "content",
  "content_hash": "9eab4f6774e68dbb5cb125dd3bb9c128287a53e41f7174367d2e9e5433e38271",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "The v1 statistics REST API endpoints are deprecated as of Redis Software version 7.22. Use the [metrics stream engine for monitoring v2](https://redis.io/docs/latest/operate/rs/monitoring/metrics_stream_engine) instead for real-time monitoring and metrics collection.\n\n\n| Method | Path | Description |\n|--------|------|-------------|\n| [GET](#get-all-bdbs-stats) | `/v1/bdbs/stats` | Get stats for all databases |\n| [GET](#get-bdbs-stats) | `/v1/bdbs/stats/{uid}` | Get stats for a specific database |"
    },
    {
      "id": "get-all-bdbs-stats",
      "title": "Get all database stats",
      "role": "content",
      "text": "[code example]\n\nGet statistics for all databases."
    },
    {
      "id": "permissions",
      "title": "Permissions",
      "role": "security",
      "text": "| Permission name | Roles |\n|-----------------|-------|\n| [view_all_bdb_stats](https://redis.io/docs/latest/operate/rs/references/rest-api/permissions#view_all_bdb_stats) | admin<br />cluster_member<br />cluster_viewer<br />db_member<br />db_viewer<br />user_manager |"
    },
    {
      "id": "get-all-request",
      "title": "Request",
      "role": "content",
      "text": "#### Example HTTP request\n\n[code example]\n\n#### Headers\n\n| Key | Value | Description |\n|-----|-------|-------------|\n| Host | cnm.cluster.fqdn | Domain name |\n| Accept | application/json | Accepted media type |\n\n#### Query parameters\n\n| Field | Type | Description |\n|-------|------|-------------|\n| interval | string | Time interval for for which we want stats: 1sec/10sec/5min/15min/1hour/12hour/1week (optional) |\n| stime | ISO_8601 | Start time from which we want the stats. Should comply with the [ISO_8601](https://en.wikipedia.org/wiki/ISO_8601) format (optional) |\n| etime | ISO_8601 | End time after which we don't want the stats. Should comply with the [ISO_8601](https://en.wikipedia.org/wiki/ISO_8601) format (optional) |"
    },
    {
      "id": "get-all-response",
      "title": "Response",
      "role": "returns",
      "text": "Returns [statistics](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/statistics) for all databases.\n\n#### Example JSON body\n\n[code example]\n\n#### Status codes {#get-all-status-codes}\n\n| Code | Description |\n|------|-------------|\n| [200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) | No error |\n| [404 Not Found](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5) | No bdbs exist |"
    },
    {
      "id": "example-requests",
      "title": "Example requests",
      "role": "example",
      "text": "#### cURL\n\n[code example]\n\n#### Python\n\n[code example]"
    },
    {
      "id": "get-bdbs-stats",
      "title": "Get database stats",
      "role": "content",
      "text": "[code example]\n\nGet statistics for a specific database."
    },
    {
      "id": "permissions-1",
      "title": "Permissions",
      "role": "security",
      "text": "| Permission name | Roles |\n|-----------------|-------|\n| [view_bdb_stats](https://redis.io/docs/latest/operate/rs/references/rest-api/permissions#view_bdb_stats) | admin<br />cluster_member<br />cluster_viewer<br />db_member<br />db_viewer<br />user_manager |"
    },
    {
      "id": "get-request",
      "title": "Request",
      "role": "content",
      "text": "#### Example HTTP request\n\n[code example]\n\n#### Headers\n\n| Key | Value | Description |\n|-----|-------|-------------|\n| Host | cnm.cluster.fqdn | Domain name |\n| Accept | application/json | Accepted media type |\n\n#### URL parameters\n\n| Field | Type | Description |\n|-------|------|-------------|\n| uid | integer | The unique ID of the BDB requested. |\n\n#### Query parameters\n\n| Field | Type | Description |\n|-------|------|-------------|\n| interval | string | Time interval for for which we want stats: 1sec/10sec/5min/15min/1hour/12hour/1week (optional) |\n| stime | ISO_8601 | Start time from which we want the stats. Should comply with the [ISO_8601](https://en.wikipedia.org/wiki/ISO_8601) format (optional) |\n| etime | ISO_8601 | End time after which we don't want the stats. Should comply with the [ISO_8601](https://en.wikipedia.org/wiki/ISO_8601) format (optional) |"
    },
    {
      "id": "get-response",
      "title": "Response",
      "role": "returns",
      "text": "Returns [statistics](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/statistics) for a specific database.\n\n#### Example JSON body\n\n[code example]\n\n#### Status codes {#get-status-codes}\n\n| Code | Description |\n|------|-------------|\n| [200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) | No error |\n| [404 Not Found](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5) | bdb does not exist |\n| [406 Not Acceptable](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7) | bdb isn't currently active |\n| [503 Service Unavailable](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.4) | bdb is in recovery state |"
    }
  ],
  "examples": [
    {
      "id": "get-all-bdbs-stats-ex0",
      "language": "sh",
      "code": "GET /v1/bdbs/stats",
      "section_id": "get-all-bdbs-stats"
    },
    {
      "id": "get-all-request-ex0",
      "language": "sh",
      "code": "GET /v1/bdbs/stats?interval=1hour&stime=2014-08-28T10:00:00Z",
      "section_id": "get-all-request"
    },
    {
      "id": "get-all-response-ex0",
      "language": "json",
      "code": "[\n  {\n    \"uid\": \"1\",\n    \"intervals\": [\n      {\n         \"interval\": \"1hour\",\n         \"stime\": \"2015-05-27T12:00:00Z\",\n         \"etime\": \"2015-05-28T12:59:59Z\",\n         \"avg_latency\": 0.0,\n         \"conns\": 0.0,\n         \"egress_bytes\": 0.0,\n         \"etime\": \"2015-05-28T00:00:00Z\",\n         \"evicted_objects\": 0.0,\n         \"expired_objects\": 0.0,\n         \"ingress_bytes\": 0.0,\n         \"instantaneous_ops_per_sec\": 0.00011973180076628352,\n         \"last_req_time\": \"1970-01-01T00:00:00Z\",\n         \"last_res_time\": \"1970-01-01T00:00:00Z\",\n         \"used_memory\": 5656299.362068966,\n         \"mem_size_lua\": 35840.0,\n         \"monitor_sessions_count\": 0.0,\n         \"no_of_keys\": 0.0,\n         \"other_req\": 0.0,\n         \"other_res\": 0.0,\n         \"read_hits\": 0.0,\n         \"read_misses\": 0.0,\n         \"read_req\": 0.0,\n         \"read_res\": 0.0,\n         \"total_connections_received\": 0.0,\n         \"total_req\": 0.0,\n         \"total_res\": 0.0,\n         \"write_hits\": 0.0,\n         \"write_misses\": 0.0,\n         \"write_req\": 0.0,\n         \"write_res\": 0.0\n      },\n      {\n         \"interval\": \"1hour\",\n         \"interval\": \"1hour\",\n         \"stime\": \"2015-05-27T13:00:00Z\",\n         \"etime\": \"2015-05-28T13:59:59Z\",\n         \"avg_latency\": 599.08,\n         \"// additional fields...\"\n      }\n    ]\n  },\n  {\n    \"uid\": \"2\",\n    \"intervals\": [\n      {\n        \"interval\": \"1hour\",\n        \"stime\": \"2015-05-27T12:00:00Z\",\n        \"etime\": \"2015-05-28T12:59:59Z\",\n        \"avg_latency\": 0.0,\n        \"// additional fields...\"\n      },\n      {\n        \"interval\": \"1hour\",\n        \"stime\": \"2015-05-27T13:00:00Z\",\n        \"etime\": \"2015-05-28T13:59:59Z\",\n\n        \"// additional fields...\"\n      }\n    ]\n  }\n]",
      "section_id": "get-all-response"
    },
    {
      "id": "example-requests-ex0",
      "language": "sh",
      "code": "$ curl -k -u \"[username]:[password]\" -X GET\n        https://[host][:port]/v1/bdbs/stats?interval=1hour",
      "section_id": "example-requests"
    },
    {
      "id": "example-requests-ex1",
      "language": "python",
      "code": "import requests\n\nurl = \"https://[host][:port]/v1/bdbs/stats?interval=1hour\"\nauth = (\"[username]\", \"[password]\")\n\nresponse = requests.request(\"GET\", url, auth=auth)\n\nprint(response.text)",
      "section_id": "example-requests"
    },
    {
      "id": "get-bdbs-stats-ex0",
      "language": "sh",
      "code": "GET /v1/bdbs/stats/{int: uid}",
      "section_id": "get-bdbs-stats"
    },
    {
      "id": "get-request-ex0",
      "language": "sh",
      "code": "GET /v1/bdbs/stats/1?interval=1hour&stime=2014-08-28T10:00:00Z",
      "section_id": "get-request"
    },
    {
      "id": "get-response-ex0",
      "language": "json",
      "code": "{\n  \"uid\": \"1\",\n  \"intervals\": [\n    {\n      \"interval\": \"1hour\",\n      \"stime\": \"2015-05-27T12:00:00Z\",\n      \"etime\": \"2015-05-28T12:59:59Z\",\n      \"avg_latency\": 0.0,\n      \"conns\": 0.0,\n      \"egress_bytes\": 0.0,\n      \"evicted_objects\": 0.0,\n      \"pubsub_channels\": 0,\n      \"pubsub_patterns\": 0,\n      \"expired_objects\": 0.0,\n      \"ingress_bytes\": 0.0,\n      \"instantaneous_ops_per_sec\": 0.00011973180076628352,\n      \"last_req_time\": \"1970-01-01T00:00:00Z\",\n      \"last_res_time\": \"1970-01-01T00:00:00Z\",\n      \"used_memory\": 5656299.362068966,\n      \"mem_size_lua\": 35840.0,\n      \"monitor_sessions_count\": 0.0,\n      \"no_of_keys\": 0.0,\n      \"other_req\": 0.0,\n      \"other_res\": 0.0,\n      \"read_hits\": 0.0,\n      \"read_misses\": 0.0,\n      \"read_req\": 0.0,\n      \"read_res\": 0.0,\n      \"total_connections_received\": 0.0,\n      \"total_req\": 0.0,\n      \"total_res\": 0.0,\n      \"write_hits\": 0.0,\n      \"write_misses\": 0.0,\n      \"write_req\": 0.0,\n      \"write_res\": 0.0\n    },\n    {\n      \"interval\": \"1hour\",\n      \"stime\": \"2015-05-27T13:00:00Z\",\n      \"etime\": \"2015-05-28T13:59:59Z\",\n      \"// additional fields...\"\n    }\n  ]\n}",
      "section_id": "get-response"
    }
  ]
}
