Check Stats
Retrieve uptime statistics for a specific check.
Endpoint
GET /v1/public/checks/{id}/statsPath Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The unique check identifier |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
from | string or number | 90 days ago | Start of the window (single-range mode). ISO 8601 or a Unix timestamp in seconds or milliseconds |
to | string or number | now | End of the window. Same formats as from |
ranges | string | - | Comma-separated predefined ranges for multi-range mode, for example 1d,7d,30d |
This endpoint supports two modes:
- Single-range mode (default): use
fromandtoto query a custom window - Multi-range mode: use
rangesto fetch statistics for several predefined windows in one request
Note:
fromis ignored whenrangesis provided.toworks in either mode and sets the end of the window.
Lookback Limit
Single-range statistics never look back more than 90 days from now. If you omit from, or pass a from older than that, the window starts 90 days ago.
Response (Single-Range Mode)
{
"data": {
"totalChecks": 25920,
"onlineChecks": 25901,
"offlineChecks": 19,
"uptimePercentage": 99.93,
"totalDurationMs": 7776000000,
"onlineDurationMs": 7770556800,
"offlineDurationMs": 5443200,
"responseSampleCount": 25901,
"avgResponseTime": 245.37,
"minResponseTime": 120,
"maxResponseTime": 890
}
}Response Fields
The same fields are returned in single-range mode and for each range in multi-range mode.
| Field | Type | Description |
|---|---|---|
totalChecks | number | Number of check results in the window |
onlineChecks | number | Results with status online |
offlineChecks | number | Confirmed offline results, excluding results recorded during maintenance |
uptimePercentage | number | Time-weighted uptime: onlineDurationMs / totalDurationMs * 100. 0 when there is no data |
totalDurationMs | number | Milliseconds of the window covered by data. Coverage starts at the first result in the window, or at the start of the window if an earlier result exists |
onlineDurationMs | number | Milliseconds not spent in a confirmed outage. Degraded time and maintenance time count here |
offlineDurationMs | number | Milliseconds spent in a confirmed outage outside maintenance |
responseSampleCount | number | Results with a recorded response time above 0 |
avgResponseTime | number | Mean response time in milliseconds (not rounded). 0 when there are no samples |
minResponseTime | number | Fastest response in milliseconds. 0 when there are no samples |
maxResponseTime | number | Slowest response in milliseconds. 0 when there are no samples |
The response does not include percentiles, DNS/TLS timing breakdowns or incident metrics such as MTBF and MTTR.
Multi-Range Mode
Request statistics for multiple predefined time windows in a single API call by using the ranges query parameter. This avoids making separate requests for each time period.
Allowed Ranges
| Range | Description |
|---|---|
1h | Last 1 hour |
6h | Last 6 hours |
1d | Last 1 day |
7d | Last 7 days |
30d | Last 30 days |
60d | Last 60 days |
90d | Last 90 days |
You can request up to 5 ranges per request.
Multi-Range Response
{
"data": {
"1d": {
"totalChecks": 720,
"onlineChecks": 714,
"offlineChecks": 6,
"uptimePercentage": 97.5,
"totalDurationMs": 86400000,
"onlineDurationMs": 84240000,
"offlineDurationMs": 2160000,
"responseSampleCount": 714,
"avgResponseTime": 245.1,
"minResponseTime": 120,
"maxResponseTime": 890
},
"7d": {
"totalChecks": 5040,
"onlineChecks": 4968,
"offlineChecks": 72,
"uptimePercentage": 98.6,
"totalDurationMs": 604800000,
"onlineDurationMs": 596332800,
"offlineDurationMs": 8467200,
"responseSampleCount": 4968,
"avgResponseTime": 252.8,
"minResponseTime": 98,
"maxResponseTime": 1240
}
}
}Multi-Range Response Fields
The response is an object keyed by range name. Each entry has the same fields as the single-range response.
Each range ends at to (or now) and starts the range length before it. Ranges longer than one day (7d, 30d, 60d, 90d) are computed from daily summaries, so their start snaps to a UTC midnight and can include a few extra hours of data.
Results for requests without to may be cached for up to an hour.
Multi-Range Errors
| Status | Condition | Example |
|---|---|---|
400 | Invalid range value | {"error": "Invalid ranges: 2d. Allowed: 1h, 6h, 1d, 7d, 30d, 60d, 90d"} |
400 | More than 5 ranges | {"error": "Maximum 5 ranges per request"} |
Code Examples
Single-Range Mode
cURL
curl -H "X-Api-Key: ek_live_your_key_here" \
"https://us-central1-exit1-dev.cloudfunctions.net/publicApi/v1/public/checks/abc123/stats?from=2025-01-01T00:00:00Z&to=2025-01-31T23:59:59Z"JavaScript
const params = new URLSearchParams({
from: "2025-01-01T00:00:00Z",
to: "2025-01-31T23:59:59Z",
});
const response = await fetch(
`https://us-central1-exit1-dev.cloudfunctions.net/publicApi/v1/public/checks/abc123/stats?${params}`,
{
headers: {
"X-Api-Key": "ek_live_your_key_here",
},
}
);
const stats = await response.json();
console.log(stats.data);Python
import requests
response = requests.get(
"https://us-central1-exit1-dev.cloudfunctions.net/publicApi/v1/public/checks/abc123/stats",
headers={"X-Api-Key": "ek_live_your_key_here"},
params={
"from": "2025-01-01T00:00:00Z",
"to": "2025-01-31T23:59:59Z"
}
)
stats = response.json()
print(stats["data"])Multi-Range Mode
cURL
curl -H "X-Api-Key: ek_live_your_key_here" \
"https://us-central1-exit1-dev.cloudfunctions.net/publicApi/v1/public/checks/abc123/stats?ranges=1d,7d,30d"JavaScript
const params = new URLSearchParams({
ranges: "1d,7d,30d",
});
const response = await fetch(
`https://us-central1-exit1-dev.cloudfunctions.net/publicApi/v1/public/checks/abc123/stats?${params}`,
{
headers: {
"X-Api-Key": "ek_live_your_key_here",
},
}
);
const stats = await response.json();
// Access stats for each range
console.log(stats.data["1d"].uptimePercentage);
console.log(stats.data["7d"].uptimePercentage);
console.log(stats.data["30d"].uptimePercentage);Python
import requests
response = requests.get(
"https://us-central1-exit1-dev.cloudfunctions.net/publicApi/v1/public/checks/abc123/stats",
headers={"X-Api-Key": "ek_live_your_key_here"},
params={"ranges": "1d,7d,30d"}
)
stats = response.json()
# Access stats for each range
for range_name, range_stats in stats["data"].items():
print(f"{range_name}: {range_stats['uptimePercentage']}% uptime")