TriportRPC

Get chain metrics series

GEThttps://api.triport.io/v1/chains/ethereum-mainnet/metrics/series?window=1h

Returns a time-bucketed series of latency and block-height samples for a single chain, suitable for charting recent health.

Solana | Ethereum | Polygon (any chain in the registry)

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

idstringrequired
Chain identifier from the registry (e.g. solana-mainnet, ethereum-mainnet, polygon-mainnet). See GET /v1/chains.
Query parametersobject
windowstringoptional
Time span of the series. One of 1h, 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

FieldTypeDescription
windowstringEchoes the effective window (1h, 6h, 24h, or 7d).
bucket_secnumberWidth of each bucket in seconds (e.g. 300 for the 1h window).
pointsarrayOrdered list of ChainSeriesPoint objects, oldest first.
points[].tsstringBucket start time as an ISO-8601 / RFC 3339 UTC timestamp.
points[].p50number | nullMedian request latency for the bucket, in milliseconds. null if no sample.
points[].p95number | null95th-percentile request latency for the bucket, in milliseconds. null if no sample.
points[].blocknumber | nullObserved block height at the bucket. null if no sample.

Errors

CodeMeaningWhen it happens
404chain_not_foundThe id does not match any chain in the registry.
400invalid_windowwindow 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, and block all set to null. Render these as gaps in a chart rather than zeros.
  • Bucket count: the default 1h window yields about 12–13 five-minute buckets. Wider windows return a coarser bucket_sec so 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 the GET /v1/chains/events SSE stream.