Compare Traffic Metrics

GET /v1/traffic/metrics/compare

Side-by-side comparison of multiple endpoints over a single time window. Returns one metric block per endpoint — useful for comparing the volume/error/latency profile of several endpoints at once. Same metric set as /traffic/metrics for each endpoint.

Requires the traffic-inspector read permission on the active account.

Query parameters

endpoint_ids string (uuid, repeatable) Req
One or more endpoint UUIDs to compare. Repeat the parameter (endpoint_ids=a&endpoint_ids=b). At least one is required.
time_range string
Window length applied to every endpoint. One of 5m, 1h, 24h, 7d, 30d, 90d. Defaults to 24h.

Response (200 OK)

<endpoint_id> object
A map keyed by each requested endpoint UUID. Each value is the full metric block from /traffic/metrics for that endpoint over the window. Endpoints that error during aggregation are omitted from the map.

Errors

400 Bad Request
No endpoint_ids supplied, or invalid time_range.
401 Unauthorized
Missing auth.
403 Forbidden
No active account, not a member, or missing the traffic-inspector read permission.
Request — compare two endpoints over 24h
curl "https://api.ngris.com/v1/traffic/metrics/compare?\ endpoint_ids=abc-...&endpoint_ids=def-...&time_range=24h" \ -H "X-API-KEY: <your_api_key>"
Python
from ngris import Ngris client = Ngris(api_key="<your_api_key>") r = client._get_raw("/traffic/metrics/compare", params={ "endpoint_ids": ["abc-...", "def-..."], "time_range": "24h", }) for uuid, m in r.items(): print(f"{uuid}: {m['total_requests']} req err={m['error_rate']:.2f}%")
Response — 200 OK
{ "abc-...": { "total_requests": 100000, "error_rate": 0.05, "p99_response_time": 250, "total_bandwidth": 4444444 }, "def-...": { "total_requests": 130000, "error_rate": 0.05, "p99_response_time": 237, "total_bandwidth": 6120044 } }
Iris