Skip to main content

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

monitorId
string
required
Monitor schedule ID
dateFrom
string
required
Start date (ISO 8601 or YYYY-MM-DD)
dateTo
string
required
End date (ISO 8601 or YYYY-MM-DD)
granularity
string
Data granularity: 5m, 15m, 1h, 6h, 1d. Default: 1h

Response

dataPoints
array
Time series data points
summary
object
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

id
string
Unique incident identifier
startedAt
string
When the incident began
resolvedAt
string | null
When the incident was resolved (null if ongoing)
durationMs
number
Incident duration in milliseconds
status
string
ongoing or resolved
firstError
string
First error message recorded
checksAffected
number
Number of failed checks during incident
regions
array
Probe regions that detected the incident

Build docs developers (and LLMs) love