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
}
],
"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_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_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,
"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
}
],
"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_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_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,
"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
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
}
]
Average latency over time
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
}
]
Average read latency over time
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
}
]
Average write latency over time
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
Total script requests in current month
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
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?