Skip to Content
API ReferenceCheck Stats

Check Stats

Retrieve uptime statistics for a specific check.

Endpoint

GET /v1/public/checks/{id}/stats

Path Parameters

ParameterTypeDescription
idstringThe unique check identifier

Query Parameters

ParameterTypeDefaultDescription
fromstring or number90 days agoStart of the window (single-range mode). ISO 8601 or a Unix timestamp in seconds or milliseconds
tostring or numbernowEnd of the window. Same formats as from
rangesstring-Comma-separated predefined ranges for multi-range mode, for example 1d,7d,30d

This endpoint supports two modes:

  • Single-range mode (default): use from and to to query a custom window
  • Multi-range mode: use ranges to fetch statistics for several predefined windows in one request

Note: from is ignored when ranges is provided. to works 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.

FieldTypeDescription
totalChecksnumberNumber of check results in the window
onlineChecksnumberResults with status online
offlineChecksnumberConfirmed offline results, excluding results recorded during maintenance
uptimePercentagenumberTime-weighted uptime: onlineDurationMs / totalDurationMs * 100. 0 when there is no data
totalDurationMsnumberMilliseconds 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
onlineDurationMsnumberMilliseconds not spent in a confirmed outage. Degraded time and maintenance time count here
offlineDurationMsnumberMilliseconds spent in a confirmed outage outside maintenance
responseSampleCountnumberResults with a recorded response time above 0
avgResponseTimenumberMean response time in milliseconds (not rounded). 0 when there are no samples
minResponseTimenumberFastest response in milliseconds. 0 when there are no samples
maxResponseTimenumberSlowest 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

RangeDescription
1hLast 1 hour
6hLast 6 hours
1dLast 1 day
7dLast 7 days
30dLast 30 days
60dLast 60 days
90dLast 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

StatusConditionExample
400Invalid range value{"error": "Invalid ranges: 2d. Allowed: 1h, 6h, 1d, 7d, 30d, 60d, 90d"}
400More 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")
Last updated on