Checks
GET
/api/v1/checksReads availability records, daily points, and the matching Agent online series for one target. Suitable for SLA grids, latency lines, and failure timelines.
Query parameters
| Parameter | Required | Default | Range | Purpose |
|---|---|---|---|---|
target_id | yes | — | valid public target ID | target |
hours | no | 72 | 1–720 | history window, max 30 days |
limit | no | 864 | cap 12000, deployment-adjustable 100–20000 | max check points |
bash
curl -fsSL 'https://YOUR-API/api/v1/checks?target_id=vps-a&hours=72&limit=864'Response structure
json
{
"ok": true,
"source": "d1-check-buckets",
"checks": [],
"daily_points": [],
"agent_series": []
}| Field | Purpose |
|---|---|
checks[] | Cloudflare check points in the window, newest first |
daily_points[] | daily display data computed from buckets |
agent_series[] | the Agent's online history; not Cloudflare checks |
source | current history storage source |
A missing target_id returns HTTP 400. Nonexistent, disabled, or address-hidden targets may return empty history; judge from the Status target list and privacy fields, and do not fall back to the Admin API.
Charting advice
- Copy and sort by
checked_atascending for line charts. - Do not fake
0 msforok = falsepoints. - On zoom reset, restore the actual first/last timestamps.
- With fewer than two points, show a single-point state instead of a stretched trend.
- Use separate legends and labels for Cloudflare checks vs
agent_series.
Caching
Normalized target_id, hours, and limit form the cache key. Default cache is ~60 s, adjustable 0-300 s; responses carry X-NIE-SLA-Cache: hit|miss and retain X-NStatus-Cache during v1. Do not add meaningless parameters to bypass caching.