Get Uptime History
Returns historical uptime data for a monitor within a date range.
curl -X POST https://api.databuddy.cc/uptime/history \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"monitorId": "sched_abc123",
"dateFrom": "2024-02-01",
"dateTo": "2024-03-01",
"granularity": "1h"
}'
Request Body
Start date (ISO 8601 or YYYY-MM-DD)
End date (ISO 8601 or YYYY-MM-DD)
Data granularity: 5m, 15m, 1h, 6h, 1d. Default: 1h
Response
Summary statistics for the period
Example Response
{
"dataPoints": [
{
"timestamp": "2024-02-01T00:00:00Z",
"status": "up",
"uptimePercent": 100.0,
"avgTtfbMs": 234,
"avgTotalMs": 301,
"checks": 12,
"failures": 0
},
{
"timestamp": "2024-02-01T01:00:00Z",
"status": "up",
"uptimePercent": 100.0,
"avgTtfbMs": 241,
"avgTotalMs": 315,
"checks": 12,
"failures": 0
}
],
"summary": {
"totalChecks": 8640,
"totalFailures": 3,
"uptimePercent": 99.97,
"avgTtfbMs": 245,
"avgTotalMs": 312,
"maxTtfbMs": 1234,
"minTtfbMs": 189,
"incidents": 1
}
}
Get Incidents
Returns a list of downtime incidents:
curl -X POST https://api.databuddy.cc/uptime/incidents \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"monitorId": "sched_abc123",
"dateFrom": "2024-02-01",
"dateTo": "2024-03-01"
}'
Response
{
"incidents": [
{
"id": "inc_xyz789",
"startedAt": "2024-02-15T14:23:00Z",
"resolvedAt": "2024-02-15T14:28:00Z",
"durationMs": 300000,
"status": "resolved",
"firstError": "Connection timeout",
"checksAffected": 5,
"regions": ["us-west", "us-east"]
}
]
}
Incident Details
Unique incident identifier
When the incident was resolved (null if ongoing)
Incident duration in milliseconds
First error message recorded
Number of failed checks during incident
Probe regions that detected the incident