Get chain metrics series
https://api.triport.io/v1/chains/ethereum-mainnet/metrics/series?window=1hReturns a time-bucketed series of latency and block-height samples for a single chain, suitable for charting recent health.
This endpoint returns a downsampled time series of observability metrics for a
single chain, intended for drawing sparklines and trend charts of recent health.
Unlike GET /v1/chains/{id}/metrics, which gives a
single point-in-time snapshot, the series endpoint returns one bucket per fixed
interval across the requested time window.
Each point carries the request-latency percentiles (p50, p95) and the
observed block height for that bucket. Metrics are pure observability data and
are not sensitive, so this endpoint requires no authentication and is served
to anonymous callers.
The width of each bucket is fixed per window and returned in bucket_sec. With
the default window=1h, buckets are 5 minutes (bucket_sec: 300), so a response
contains roughly 12–13 points. Any bucket with no underlying sample reports its
metric fields as JSON null (not 0) — always check != null before
rendering, because a genuine 0 latency or block is meaningful.
Parameters
Path parameters
idstringrequiredsolana-mainnet, ethereum-mainnet, polygon-mainnet). See GET /v1/chains.Query parametersobjectwindowstringoptional1h, 6h, 24h, 7d. Defaults to 1h. The bucket width scales with the window and is reported in the response as bucket_sec.Response
Response fields
| Field | Type | Description |
|---|---|---|
window | string | Echoes the effective window (1h, 6h, 24h, or 7d). |
bucket_sec | number | Width of each bucket in seconds (e.g. 300 for the 1h window). |
points | array | Ordered list of ChainSeriesPoint objects, oldest first. |
points[].ts | string | Bucket start time as an ISO-8601 / RFC 3339 UTC timestamp. |
points[].p50 | number | null | Median request latency for the bucket, in milliseconds. null if no sample. |
points[].p95 | number | null | 95th-percentile request latency for the bucket, in milliseconds. null if no sample. |
points[].block | number | null | Observed block height at the bucket. null if no sample. |
Errors
| Code | Meaning | When it happens |
|---|---|---|
404 | chain_not_found | The id does not match any chain in the registry. |
400 | invalid_window | window is present but not one of 1h, 6h, 24h, 7d. |
See Errors for the full error envelope.
Examples
JavaScript (fetch)
const res = await fetch(
"https://api.triport.io/v1/chains/ethereum-mainnet/metrics/series?window=1h"
);
if (!res.ok) throw new Error(`http_${res.status}`);
const series = await res.json();
for (const p of series.points) {
// skip empty buckets — null is distinct from a real 0
if (p.p50 != null) console.log(p.ts, `${p.p50}ms`, `block ${p.block}`);
}TypeScript SDK (@triport/sdk)
import { Triport } from "@triport/sdk";
const triport = new Triport({ apiKey: process.env.TRIPORT_API_KEY });
const series = await triport.chains.metricsSeries("ethereum-mainnet", {
window: "1h",
});
console.log(series.window, series.bucket_sec, series.points.length);Python (triport-sdk)
import os
from triport import Triport
client = Triport(api_key=os.environ["TRIPORT_API_KEY"])
series = client.chains.metrics_series("ethereum-mainnet", window="1h")
for point in series.points:
if point.p50 is not None:
print(point.ts, f"{point.p50}ms", f"block {point.block}")Notes
- Empty buckets: gaps in upstream observability surface as points with
p50,p95, andblockall set tonull. Render these as gaps in a chart rather than zeros. - Bucket count: the default
1hwindow yields about 12–13 five-minute buckets. Wider windows return a coarserbucket_secso the point count stays bounded. - Related: for the current snapshot use
GET /v1/chains/{id}/metrics; for a live push of status and metric ticks subscribe to theGET /v1/chains/eventsSSE stream.