Skip to main content
API referenceHealth

Health Trends Bulk

Last updated

GET
/api/v1/health/trends

Fetch compact 7d/30d daily uptime and latency trends for all subnets (computed live from the store). ?window=7d|30d returns just that window and narrows the underlying scan to it rather than reading the widest one and discarding the rest; ?limit/?offset page the subnets array within each window. All three are optional and omitting them returns every window and every subnet, which is what this route served before it had them. subnet_count always spans every subnet the window measured, not the page, so a paging caller keeps the denominator it is ranking against.

Query Parameters

window?string

Trailing lookback window the response is computed over, ending at the most recent data point rather than at today. Accepts 7d, 30d. A longer window is not a superset of a shorter one -- rankings and rates are recomputed over the whole window, not summed.

Value in

  • "7d"
  • "30d"
limit?integer

Maximum number of rows to return in one page (at most 512). A larger value, or a non-positive one, is rejected with 400 invalid_query -- so a short page means the result set is exhausted, not that the server quietly capped you (#9916). Omitted, every matching row is returned.

Range1 <= value <= 512
offset?integer

Number of rows to skip before the page begins. Correct only in combination with the page size the response actually returned -- prefer cursor for anything beyond the first few pages, since a row inserted mid-scan shifts every later offset.

Range0 <= value
Default0

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/health/trends"
{  "data": {    "observed_at": "2026-06-01T00:00:00.000Z",    "schema_version": 1,    "source": "live-cron-prober",    "windows": {      "example": {        "days": 1,        "granularity": "1d",        "subnet_count": 1,        "subnets": [          {            "avg_latency_ms": 120,            "latency_sample_count": 120,            "netuid": 7,            "points": [              {                "avg_latency_ms": 120,                "date": "2026-06-01",                "latency_sample_count": 120,                "samples": 1,                "uptime_ratio": 0.9966              }            ],            "samples": 1,            "uptime_ratio": 0.9966          }        ]      }    }  },  "meta": {    "artifact_path": "example",    "cache": "short",    "contract_version": "2026-06-29.1",    "generated_at": "2026-06-01T00:00:00.000Z",    "pagination": {      "collection": "example",      "cursor": 1,      "limit": 1,      "next_cursor": 1,      "order": "asc",      "returned": 1,      "sort": "example",      "total": 1    },    "published_at": "2026-06-01T00:00:00.000Z",    "source": "live-cron-prober",    "stale_contract": {      "built_under": "example",      "live": "example"    }  },  "ok": true,  "schema_version": 1}