curl --request GET \
--url https://api.upstash.com/v2/redis/stats/{id} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.upstash.com/v2/redis/stats/{id}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.upstash.com/v2/redis/stats/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.upstash.com/v2/redis/stats/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.upstash.com/v2/redis/stats/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.upstash.com/v2/redis/stats/{id}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upstash.com/v2/redis/stats/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"monitor_count": {
"x": "2023-05-22 10:59:23.426 +0000 UTC",
"y": 320
},
"daily_net_commands": 7,
"daily_read_requests": 7,
"daily_write_requests": 0,
"connection_count": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"keyspace": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"throughput": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"diskusage": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"latency_p50": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"latencymean": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"latency_99": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"read_latency_p50": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"read_latency_mean": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"read_latency_99": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"write_latency_p50": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"write_latency_mean": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"write_latency_99": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"hits": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"misses": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"read": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"write": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"dailyrequests": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
},
{
"x": "2025-09-04 15:12:52.76649148 +0000 UTC",
"y": 7
}
],
"days": [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday"
],
"dailybilling": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
},
{
"x": "2025-09-04 15:12:52.76649148 +0000 UTC",
"y": 1.333
}
],
"dailybandwidth": 50444740913,
"bandwidths": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
},
{
"x": "2025-09-04 15:12:52.76649148 +0000 UTC",
"y": 7
}
],
"total_monthly_bandwidth": 7,
"total_monthly_requests": 7,
"total_monthly_read_requests": 7,
"total_monthly_write_requests": 0,
"total_monthly_script_requests": 0,
"queue_optimized": false,
"total_monthly_storage": 0,
"current_storage": 0,
"total_monthly_billing": 222.33902763855485,
"rest_conn_count": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"latency_p90": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"command_latency_p50": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"command_latency_99": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"wait_latency_99": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"disk_load_latency_99": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"disk_loads": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"lua_latency_p50": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"lua_latency_99": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"lua_scripts": [
{
"sha": "<string>",
"script_name": "<string>",
"count": 123,
"failures": 123,
"timeouts": 123,
"memory_limits": 123,
"command_count": 123,
"avg_duration_ns": 123,
"max_duration_ns": 123,
"avg_lua_duration_ns": 123,
"avg_command_duration_ns": 123,
"avg_allocated_bytes": 123,
"max_allocated_bytes": 123
}
],
"lua_script_count": 123,
"slow_commands": [
{
"command": "EVALSHA",
"count": 123,
"max_ms": 123
}
],
"acl_user_logins": [
{
"username": "<string>",
"logins": 123
}
],
"command_counts": [
{
"metric_identifier": "EXISTS",
"data_points": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
]
}
]
}Get Database Stats
This endpoint gets detailed stats of a database.
curl --request GET \
--url https://api.upstash.com/v2/redis/stats/{id} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.upstash.com/v2/redis/stats/{id}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.upstash.com/v2/redis/stats/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.upstash.com/v2/redis/stats/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.upstash.com/v2/redis/stats/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.upstash.com/v2/redis/stats/{id}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upstash.com/v2/redis/stats/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"monitor_count": {
"x": "2023-05-22 10:59:23.426 +0000 UTC",
"y": 320
},
"daily_net_commands": 7,
"daily_read_requests": 7,
"daily_write_requests": 0,
"connection_count": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"keyspace": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"throughput": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"diskusage": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"latency_p50": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"latencymean": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"latency_99": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"read_latency_p50": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"read_latency_mean": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"read_latency_99": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"write_latency_p50": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"write_latency_mean": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"write_latency_99": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"hits": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"misses": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"read": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"write": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"dailyrequests": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
},
{
"x": "2025-09-04 15:12:52.76649148 +0000 UTC",
"y": 7
}
],
"days": [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday"
],
"dailybilling": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
},
{
"x": "2025-09-04 15:12:52.76649148 +0000 UTC",
"y": 1.333
}
],
"dailybandwidth": 50444740913,
"bandwidths": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
},
{
"x": "2025-09-04 15:12:52.76649148 +0000 UTC",
"y": 7
}
],
"total_monthly_bandwidth": 7,
"total_monthly_requests": 7,
"total_monthly_read_requests": 7,
"total_monthly_write_requests": 0,
"total_monthly_script_requests": 0,
"queue_optimized": false,
"total_monthly_storage": 0,
"current_storage": 0,
"total_monthly_billing": 222.33902763855485,
"rest_conn_count": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"latency_p90": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"command_latency_p50": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"command_latency_99": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"wait_latency_99": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"disk_load_latency_99": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"disk_loads": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"lua_latency_p50": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"lua_latency_99": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
],
"lua_scripts": [
{
"sha": "<string>",
"script_name": "<string>",
"count": 123,
"failures": 123,
"timeouts": 123,
"memory_limits": 123,
"command_count": 123,
"avg_duration_ns": 123,
"max_duration_ns": 123,
"avg_lua_duration_ns": 123,
"avg_command_duration_ns": 123,
"avg_allocated_bytes": 123,
"max_allocated_bytes": 123
}
],
"lua_script_count": 123,
"slow_commands": [
{
"command": "EVALSHA",
"count": 123,
"max_ms": 123
}
],
"acl_user_logins": [
{
"username": "<string>",
"logins": 123
}
],
"command_counts": [
{
"metric_identifier": "EXISTS",
"data_points": [
{
"x": "2025-08-31 15:12:52.799480932 +0000 UTC",
"y": 0
}
]
}
]
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Path Parameters
The ID of the database
Query Parameters
Period the time series cover: 1h, 3h, 12h, 1d, 3d, 7d or 30d. Defaults to 1h. 30d is only available for databases on a Pro plan or with the Production Pack.
Response
Database stats retrieved successfully
Monitor count
Show child attributes
Show child attributes
Total number of commands executed today
7
Total number of read requests executed today
7
Total number of write requests executed today
0
Connection count over time
Show child attributes
Show child attributes
[ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 } ]
Total number of keys in the database over time
Show child attributes
Show child attributes
[ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 } ]
Throughput on database connections over time
Show child attributes
Show child attributes
[ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 } ]
Disk usage over time
Show child attributes
Show child attributes
[ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 } ]
Median (p50) latency over time
Show child attributes
Show child attributes
[ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 } ]
Deprecated alias of latency_p50, kept for older clients. Carries the median, not the mean.
Show child attributes
Show child attributes
[ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 } ]
99th percentile latency over time
Show child attributes
Show child attributes
[ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 } ]
Median (p50) read latency over time
Show child attributes
Show child attributes
[ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 } ]
Deprecated alias of read_latency_p50, kept for older clients. Carries the median, not the mean.
Show child attributes
Show child attributes
[ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 } ]
99th percentile read latency over time
Show child attributes
Show child attributes
[ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 } ]
Median (p50) write latency over time
Show child attributes
Show child attributes
[ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 } ]
Deprecated alias of write_latency_p50, kept for older clients. Carries the median, not the mean.
Show child attributes
Show child attributes
[ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 } ]
99th percentile write latency over time
Show child attributes
Show child attributes
[ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 } ]
Cache hits over time
Show child attributes
Show child attributes
[ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 } ]
Cache misses over time
Show child attributes
Show child attributes
[ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 } ]
Read requests over time
Show child attributes
Show child attributes
[ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 } ]
Write requests over time
Show child attributes
Show child attributes
[ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 } ]
Daily requests over time
Show child attributes
Show child attributes
[ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 }, { "x": "2025-09-04 15:12:52.76649148 +0000 UTC", "y": 7 } ]
Days of the week for measurement
[ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday" ]
Daily billing amounts over time
Show child attributes
Show child attributes
[ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 }, { "x": "2025-09-04 15:12:52.76649148 +0000 UTC", "y": 1.333 } ]
Total daily bandwidth usage in bytes
50444740913
Bandwidth usage over time
Show child attributes
Show child attributes
[ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 }, { "x": "2025-09-04 15:12:52.76649148 +0000 UTC", "y": 7 } ]
Total bandwidth used in current month (bytes)
7
Total requests in current month
7
Total read requests in current month
7
Total write requests in current month
0
Deprecated, always 0. Use daily_script_commands from the Prometheus integration
0
Whether queue optimization is enabled for the database
false
Total storage used in current month (bytes)
0
Current storage used (bytes)
0
Total cost in current month
222.33902763855485
Open REST connections over time
Show child attributes
Show child attributes
[ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 } ]
Overall 90th percentile latency over time, Pro and Production Pack only
Show child attributes
Show child attributes
[ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 } ]
Median time the engine spent executing commands, Pro and Production Pack only
Show child attributes
Show child attributes
[ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 } ]
99th percentile time the engine spent executing commands, Pro and Production Pack only
Show child attributes
Show child attributes
[ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 } ]
99th percentile time commands waited for the execution lock, Pro and Production Pack only
Show child attributes
Show child attributes
[ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 } ]
99th percentile time to load a key from disk, Pro and Production Pack only
Show child attributes
Show child attributes
[ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 } ]
Keys loaded from disk per ten-minute window, Pro and Production Pack only
Show child attributes
Show child attributes
[ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 } ]
Median Lua script latency over time, Pro and Production Pack only
Show child attributes
Show child attributes
[ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 } ]
99th percentile Lua script latency over time, Pro and Production Pack only
Show child attributes
Show child attributes
[ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 } ]
Most executed Lua scripts since midnight UTC, Pro and Production Pack only
Show child attributes
Show child attributes
Number of distinct Lua scripts run since midnight UTC, Pro and Production Pack only
Commands that exceeded the slow threshold today, Pro and Production Pack only
Show child attributes
Show child attributes
Logins per ACL user today, Pro and Production Pack only
Show child attributes
Show child attributes
Command-specific counts over time
Show child attributes
Show child attributes
[ { "metric_identifier": "EXISTS", "data_points": [ { "x": "2025-08-31 15:12:52.799480932 +0000 UTC", "y": 0 } ] } ]
Was this page helpful?