Skip to main content

Analytics API

The Analytics API (v2) gives you read access to the same data you see in nanoStream Analytics: viewer experience, playback start success and errors, ingest health, concurrent viewers, traffic usage, geography, alerts and AI Live Captions usage. Use it to feed your own dashboards, reports and monitoring. Every query returns data for your own organisation only.

Value
Base URLhttps://metrics-api.nanostream.cloud
Path prefix/v2/...
Auth headerx-access-token: <JWT>
Interactive referencehttps://api.nanostream.cloud/docs/analytics/v2/
OpenAPI spechttps://api.nanostream.cloud/docs/analytics/v2/openapi_v2.json
note

The old base URL metrics.nanocosmos.de/api/v2/... no longer works. Use metrics-api.nanostream.cloud/v2/....

Authenticate​

The Analytics API has no API key of its own. It accepts a JWT in the x-access-token header. You get one in two ways.

Mint a token from your organisation API key with metrics in its audience. It can live up to 365 days, and one token with "aud": ["bintu","metrics"] also works for the REST API.

curl -X POST https://token.nanostream.cloud/bintu/token \
-H "X-BINTU-APIKEY: $BINTU_API_KEY" \
-H "content-type: application/json" \
-d '{ "exp": 1790261651, "aud": ["metrics"], "iss": "<READ_ONLY_USER_ID>" }'

Use this for services, CI jobs and dashboards. See APIs & SDKs overview for all fields.

Option 2: sign in with your Analytics login​

Your Analytics login is your nanoStream Dashboard login (one shared user database). POST /authenticate returns a token that is valid for 24 hours. The lifetime is fixed: expiry fields in the request are ignored.

curl -X POST "https://metrics-api.nanostream.cloud/authenticate" \
-H "content-type: application/json" \
-d '{ "email": "<EMAIL>", "password": "<PASSWORD>" }'
warning

Use a read-only user for API access. Never put a password or token into client-side code, logs or support tickets.

Your first query​

Concurrent viewers for one day, hourly:

curl -s "https://metrics-api.nanostream.cloud/v2/viewers/concurrent/timeseries?from=2026-11-01T00:00:00&to=2026-11-02T00:00:00&interval=hour" \
-H "x-access-token: $NANO_API_TOKEN"

Buffering ratio for two streams, as CSV:

curl -s "https://metrics-api.nanostream.cloud/v2/h5live/bufferingratio/streams/timeseries?from=2026-11-01T00:00:00&to=2026-11-02T00:00:00&interval=hour&streams=abcde-11111&streams=abcde-22222&format=csv" \
-H "x-access-token: $NANO_API_TOKEN"

Common parameters​

ParameterDescription
from, toTime range in UTC, for example 2026-11-01T00:00:00. from rounds down and to rounds up to the minute.
intervalRequired on timeseries routes, for example hour
streamsFilter by stream name. Repeat for several streams.
tagsFilter by stream tag. Repeat for several tags.
countriesFilter by country
eventsFilter by event ID (from the player's metrics.eventId)
format=csvReturn CSV instead of JSON (most routes)
info

streams, countries and events combine with OR. tags combine with AND: two tags return only streams that carry both. An empty intersection returns error 101010.

Route groups​

GroupRoutesWhat you get
Viewer experience (WebSocket/MSE playback)/v2/h5live/...Playtime, buffering ratio, latency, startup time, error codes, stop reasons, views and playtime per browser and OS
Viewer experience (MOQ playback)/v2/moq/...The same metrics for playback over MOQ (Media over QUIC)
Playback start success/v2/playback/start/success/...Successful Playback Start Ratio (SPSR) per stream, tag, country, with breakdowns
Playback start errors/v2/playback/start/errors/...Playback start errors (PSE) with the same breakdowns
Concurrent viewers/v2/viewers/concurrent/timeseriesConcurrent viewers over time
Ingest monitoring/v2/monitoring/ingest/...Audio/video bitrate, SRT metrics, latest RTMP metrics, max frame delay, stream time ratio
Playout monitoring/v2/monitoring/playout/...Buffering ratio, error codes, startup time
Alerts/v2/alerting/ingestCurrent and past ingest alerts with recommended actions
Usage/v2/usage/...Traffic (bytes) over time, last month, ingest/playout breakdowns
World map/v2/world/...Usage, playtime, latency, buffering, ABR metrics, playouts and ingests per country
Webcaster/v2/webrtc/...nanoStream Webcaster ingest bitrate, browsers and OS
AI Live Captions/v2/captions/usage/...Caption uptime per stream and over time, source and target languages

The interactive reference lists every route with its parameters and response schema. Some routes require a higher plan and return 403 (105002) on lower plans; a few are only available in the Analytics dashboard (105003).

note

Since API version 2.36.0, /v2/h5live/* covers WebSocket/MSE playback only. Playback over MOQ is reported under /v2/moq/*. Add both together for a total.

MOQ routes​

RouteReturns
/v2/moq/views/os, /v2/moq/views/browserViews by OS / browser
/v2/moq/playtime/os, /v2/moq/playtime/browserPlaying time by OS / browser
/v2/moq/playtime/timeseries, /v2/moq/playtime/streams/timeseriesPlaying time (all / one stream)
/v2/moq/latency/timeseries, /v2/moq/latency/streams/timeseriesLatency (all / one stream)
/v2/moq/startuptime/timeseries, /v2/moq/startuptime/streams/timeseriesStartup time (all / one stream)
/v2/moq/bufferingratio/timeseries, /v2/moq/bufferingratio/streams/timeseriesBuffering ratio (all / one stream)
/v2/moq/errorcodes/timeseriesError codes
/v2/moq/stopReasons/timeseriesStop reasons

Playback start success (SPSR) and errors (PSE)​

SPSR is the share of playback starts that do not end with an error within the first 30 seconds. Errors after a pause or a later restart are not counted. Values are calculated per minute with a 5-minute delay.

Breakdown terms include browser, browser version, referrer, OS, OS version, player version, city, IP, initial ABR profile, media playback API and fast start.

A typical investigation:

  1. Get the SPSR timeseries: /v2/playback/start/success/ratio/timeseries?from=…&to=…&interval=hour
  2. Narrow the time range and check countries: /v2/playback/start/success/ratio/world?from=…&to=…
  3. Break errors down for one country by IP: /v2/playback/start/errors/countries/ip?from=…&to=…&countries=AM

Read results correctly​

  • HTTP 200 doesn't mean there is data. Check the body status: 1000 OK, 2000 no data, 2001 no alerts.
  • Base units. Bytes come back in bytes, playtime and caption uptime in seconds. The dashboard converts to GB and hours.
  • Usage is booked when a session stops. A running stream contributes nothing until it ends. Sum a usage timeseries over a range; don't read one bucket as throughput.
  • Concurrent viewers arrive about 3 minutes late. A zero in the last few minutes fills in later.
  • Player metrics need the player's metrics config. Playtime, latency, startup time and buffering only exist for players that report metrics. See Player configuration reference.
  • Top lists are capped at 1,000 and not exact over long ranges. Filter by streams for exact figures.
  • Long ranges are rejected per route with 400 / 101004. The error body names the limit. Split the range and sum the results.
  • World-map usage is slightly lower than the usage timeseries, because traffic without a resolvable country is left out.

Rate limit​

1 request per second, with bursts of up to 30 requests per second processed immediately. Above that you get HTTP 502 (Bad Gateway) or 504 (Gateway Timeout).

Error codes​

Request errors​

CodeNameHTTPMeaning
101001Endpoint not found404Wrong path. Requests go to https://metrics-api.nanostream.cloud/v2/<route>.
101002Param required400A required parameter is missing
101003Wrong data type400A value has an unexpected type
101004Invalid value400A parameter failed validation, for example an unknown country or invalid time range
101005Too many params400The route limits the number of streams or tags
101006Invalid request body400Unknown or wrong body structure
101007Missing props request body422Required body properties missing
101008General request body issue403For example a stream name not in your organisation
101009Invalid header403A header doesn't follow the request scheme
101010Tag stream intersection issue404The combined tag filter matches no stream

Authentication errors​

CodeNameHTTP
102001User not found404
102002Invalid user credentials401
102011Organisation not found404
102012Organisation is not enabled403
102021API key not found404

Filter errors​

CodeNameHTTP
103001Stream not found404
103002Tag not found404
103003Country not found404

Processing and access errors​

CodeNameHTTPMeaning
104XXXInternal error500Server-side problem. Retry later; contact support if it persists.
105001Access denied403No access to the requested content
105002Access level too low403Your plan or user role doesn't include this route
105003Analytics dashboard only403The route isn't available via API
105011X-ACCESS-TOKEN error401Token invalid or malformed
105012X-ACCESS-TOKEN missing401Add the x-access-token header

Next steps​

tip

Try it in the Builder Hub: open nanoStream Analytics to see these metrics for your own streams. Start for Free