Per-Endpoint Traffic Metrics

GET /v1/traffic/endpoints/{id}/metrics

Summary traffic metrics for a single endpoint (tunnel) plus an hourly time series. Scoped to the active account. Note this route uses its own response shape — it is not the same object as /traffic/metrics.

Path parameters

id int64 Req
Numeric tunnel ID. A non-numeric value returns 400.

Query parameters

hours int
Look-back window in hours. Default 24, max 168 (7 days).

Response (200 OK)

endpoint_id int64
The tunnel ID (echo).
hours int
Resolved look-back window (echo).
total_requests, total_bytes number
Request count and total response bytes over the window.
avg_response_time number
Mean response time (ms).
error_rate number
Percentage (0–100) of requests with a 4xx/5xx status.
hourly_data array
Hourly buckets. Each: {hour, requests, bytes, avg_response_time}. hour is a YYYY-MM-DD HH:00:00 string.

Errors

400 Bad Request
Non-numeric endpoint ID.
401 Unauthorized
Missing auth.
404 Not Found
Endpoint doesn't exist or doesn't belong to your active account.
Request
curl "https://api.ngris.com/v1/traffic/endpoints/12/metrics?hours=24" \ -H "X-API-KEY: <your_api_key>"
Python
from ngris import Ngris client = Ngris(api_key="<your_api_key>") m = client._get_raw("/traffic/endpoints/12/metrics") print(f"{m['total_requests']} req, err={m['error_rate']:.2f}%")
Response — 200 OK
{ "endpoint_id": 12, "hours": 24, "total_requests": 12340, "total_bytes": 7654321, "avg_response_time": 22.4, "error_rate": 1.11, "hourly_data": [ {"hour": "2026-04-29 11:00:00", "requests": 540, "bytes": 334221, "avg_response_time": 19.8}, {"hour": "2026-04-29 12:00:00", "requests": 612, "bytes": 401120, "avg_response_time": 21.3} ] }
Iris