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 (ISO 8601)24 hours agoStart date for statistics (single-range mode)
tostring (ISO 8601)nowEnd date for statistics
rangesstring—Comma-separated predefined ranges for multi-range mode (e.g. 1d,7d,30d)

This endpoint supports two modes:

  • Single-range mode (default) — Use from and to to query a custom date range
  • Multi-range mode — Use ranges to fetch statistics for multiple predefined time windows in a single request

Note: The from parameter is ignored when ranges is provided. The to parameter can be used with either mode to set the end date.

Response (Single-Range Mode)

{ "data": { "checkId": "abc123", "period": { "from": "2025-01-14T14:30:00Z", "to": "2025-01-15T14:30:00Z" }, "uptime": { "percentage": 99.95, "totalChecks": 720, "successfulChecks": 719, "failedChecks": 1 }, "responseTime": { "average": 245, "min": 120, "max": 890, "p50": 230, "p90": 410, "p95": 550, "p99": 820 }, "timing": { "dns": { "average": 12, "p95": 25 }, "connect": { "average": 25, "p95": 45 }, "tls": { "average": 45, "p95": 80 }, "ttfb": { "average": 150, "p95": 350 } }, "incidents": { "count": 1, "totalDowntime": 300, "mtbf": 86100, "mttr": 300 } } }

Response Fields

Uptime

FieldDescription
percentageUptime percentage over the period
totalChecksTotal number of check executions
successfulChecksNumber of successful checks
failedChecksNumber of failed checks

Response Time (in milliseconds)

FieldDescription
averageMean response time
minFastest response
maxSlowest response
p5050th percentile (median)
p9090th percentile
p9595th percentile
p9999th percentile

Timing Breakdown (in milliseconds)

FieldDescription
dnsDNS resolution time
connectTCP connection time
tlsTLS handshake time
ttfbTime to first byte

Incidents

FieldDescription
countNumber of downtime incidents
totalDowntimeTotal downtime in seconds
mtbfMean time between failures in seconds
mttrMean time to recovery in seconds

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, "minResponseTime": 120, "maxResponseTime": 890 }, "7d": { "totalChecks": 5040, "onlineChecks": 4968, "offlineChecks": 72, "uptimePercentage": 98.6, "totalDurationMs": 604800000, "onlineDurationMs": 596332800, "offlineDurationMs": 8467200, "responseSampleCount": 4968, "avgResponseTime": 252, "minResponseTime": 98, "maxResponseTime": 1240 } } }

Multi-Range Response Fields

The response is a dictionary keyed by range name. Each entry contains:

FieldDescription
totalChecksTotal number of check executions in the range
onlineChecksNumber of successful checks
offlineChecksNumber of failed checks
uptimePercentageUptime percentage calculated from continuous duration
totalDurationMsTotal time span of the range in milliseconds
onlineDurationMsTotal online duration in milliseconds
offlineDurationMsTotal offline duration in milliseconds
responseSampleCountNumber of checks with valid response time data
avgResponseTimeAverage response time in milliseconds
minResponseTimeMinimum response time in milliseconds
maxResponseTimeMaximum response time in milliseconds

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