Speed Insights

GET /v1/applications/{uuid}/speed-insights

Real-user Core Web Vitals (RUM) for an application — the p75 of LCP, CLS, INP, FCP, and TTFB, with a good / needs-improvement / poor rating for each. Metrics are measured in real visitors' browsers; there are no cookies and no identifiers.

Speed Insights is a plan feature (the speed_insights entitlement) and is enabled per app with the speed_insights_enabled setting (see below). With it off there are no samples to return.

Query parameters

range string
The time window: 24h, 7d, 30d, or 90d. Default 7d; any other value is read as 7d.

Response (200 OK)

range string
The window the numbers cover: 24h, 7d, 30d or 90d.
total_samples int
How many real-user measurements were collected in the range, all metrics together.
metrics object
One entry per metric, always all five, keyed LCP, INP, CLS, FCP, TTFB (uppercase). LCP, INP, FCP and TTFB are in milliseconds; CLS has no unit.
metrics.*.p75 number | null
The 75th-percentile value. null when the metric has no samples in the range.
metrics.*.rating string
The p75 rated against the Core Web Vitals thresholds: good, needs-improvement or poor. Empty string when there are no samples.
metrics.*.count int
Samples of this metric in the range.
metrics.*.good, needs_improvement, poor int
How many of those samples the visitor's browser rated good, needs improvement and poor.
timeseries object
The p75 over time for the three Core Web Vitals, keyed LCP, INP, CLS. Each is a list of {name, value}, oldest first: name is the bucket (hourly YYYY-MM-DD HH:00:00 for 24h, daily YYYY-MM-DD otherwise, UTC), value that bucket's p75. Buckets with no samples are left out; a metric with none is [].

An app with no endpoint answers zero counts, null p75s and empty series.

Enabling collection

Turn Speed Insights on for an app by sending speed_insights_enabled: true to PUT /v1/applications/{uuid}. Enabling requires the speed_insights entitlement (a 403 otherwise); disabling is always allowed.

Once enabled, the edge serves the collector at GET /_ngris/speed-insights/script.js on the app's own domain and accepts the browser beacon at POST /_ngris/vitals. It auto-injects the collector into served HTML for static apps and fullstack static front-ends — nothing to add by hand. For backend-rendered (dynamic managed-backend) HTML, the edge does not rewrite the response body, so add the one line yourself before </body>:

<script src="/_ngris/speed-insights/script.js" defer></script>

Errors

403
The plan lacks the speed_insights entitlement (on read, or when enabling the setting), or application hosting, or there is no active account.
404
Unknown application.
Request
curl "https://api.ngris.com/v1/applications/019be838-d261-7d9b-9499-71995a3a91c6/speed-insights?range=7d" \ -H "X-API-KEY: <your_api_key>"
Response — 200 OK
{ "range": "7d", "total_samples": 5218, "metrics": { "LCP": { "p75": 1840, "rating": "good", "count": 1218, "good": 1002, "needs_improvement": 160, "poor": 56 }, "INP": { "p75": 210, "rating": "needs-improvement", "count": 904, "good": 620, "needs_improvement": 230, "poor": 54 }, "CLS": { "p75": 0.06, "rating": "good", "count": 1120, "good": 1040, "needs_improvement": 62, "poor": 18 }, "FCP": { "p75": 1210, "rating": "good", "count": 988, "good": 870, "needs_improvement": 90, "poor": 28 }, "TTFB": { "p75": 620, "rating": "good", "count": 988, "good": 900, "needs_improvement": 70, "poor": 18 } }, "timeseries": { "LCP": [ { "name": "2026-09-14", "value": 1790 }, { "name": "2026-09-15", "value": 1880 } ], "INP": [ { "name": "2026-09-14", "value": 205 }, { "name": "2026-09-15", "value": 216 } ], "CLS": [ { "name": "2026-09-14", "value": 0.05 }, { "name": "2026-09-15", "value": 0.07 } ] } }
Enable it — PUT /v1/applications/{uuid}
curl -X PUT "https://api.ngris.com/v1/applications/019be838-d261-7d9b-9499-71995a3a91c6" \ -H "X-API-KEY: <your_api_key>" \ -H "Content-Type: application/json" \ -d '{ "speed_insights_enabled": true }'
Was this helpful?
On this page
Speed Insights
Was this helpful?