Skip to content

Public API

Nyan Streaming provides a read-only public API for retrieving server status and an organization’s streaming status and viewer counts. You can use it for live displays on your own site, external aggregation of viewer counts, integration with monitoring tools, and more.

  • Base URL: https://api.nyst.live/api/v1
  • All responses are JSON.
  • The current public API is read-only (retrieving streaming status and viewer counts).

/status and /viewers require an API key. Issue one from Settings › API Keys in the dashboard, and send it as a Bearer token in the Authorization header.

Authorization: Bearer <YOUR_API_KEY>
  • API keys are strings that begin with nyst_live_.
  • The key is only shown when it is issued. Copy it on the spot (it will not be shown again).
  • You can optionally set an expiration on a key. You can revoke keys you no longer need from the dashboard.
  • /health and /openapi.json do not require authentication.

/status and /viewers are limited to a default of 100 requests per hour across the entire organization (administrators can raise this).

  • Each response includes X-RateLimit-Limit / X-RateLimit-Remaining / X-RateLimit-Reset headers so you can check the remaining allowance.
  • Exceeding the limit returns 429 (with a Retry-After header).
  • /health is not subject to rate limiting.

We distribute a machine-readable OpenAPI 3.1 specification. You can load it into Swagger, Postman, and similar tools.

https://api.nyst.live/api/v1/openapi.json

On success:

{
"success": true,
"data": { ... },
"request_id": "req_…"
}

On failure:

{
"success": false,
"error": { "code": "", "message": "" },
"request_id": "req_…"
}

GET /health — Server Status (No Authentication Required)

Section titled “GET /health — Server Status (No Authentication Required)”

Returns the online status of all delivery nodes.

Terminal window
curl https://api.nyst.live/api/v1/health
{
"success": true,
"data": {
"all_servers_online": true,
"online_servers": 1,
"offline_servers": 0,
"total_servers": 1,
"servers": [
{
"id": "node-1",
"label": "tokyo-1",
"region": "ap-northeast-1",
"status": "active",
"online": true
}
]
}
}

GET /status — Viewer Counts Across All of an Organization’s Streams (API Key Required)

Section titled “GET /status — Viewer Counts Across All of an Organization’s Streams (API Key Required)”

Returns all stream keys and their current viewer counts for the organization the API key belongs to.

Terminal window
curl https://api.nyst.live/api/v1/status \
-H "Authorization: Bearer $NYST_API_KEY"
{
"success": true,
"data": {
"organization_id": "org_…",
"total_streams": 2,
"total_viewers": 134,
"streams": [
{
"stream_key_id": "",
"stream_id": "",
"name": "Main",
"status": "active",
"viewer_count": 120
}
]
}
}

GET /viewers/{streamkey} — Viewer Count for a Specific Stream (API Key Required)

Section titled “GET /viewers/{streamkey} — Viewer Count for a Specific Stream (API Key Required)”

Returns the viewer count for the specified stream (stream_id or the stream key id), with a per-node breakdown.

Terminal window
curl https://api.nyst.live/api/v1/viewers/STREAM_ID \
-H "Authorization: Bearer $NYST_API_KEY"
{
"success": true,
"data": {
"organization_id": "org_…",
"stream": {
"stream_key_id": "",
"stream_id": "",
"name": "Main",
"status": "active"
},
"viewer_count": 120,
"node_viewers": [
{
"node_id": "node-1",
"label": "tokyo-1",
"region": "ap-northeast-1",
"viewer_count": 120
}
],
"total_node_viewers": 120
}
}
HTTPcodeMeaning
401UNAUTHORIZEDNo API key was provided
401API_KEY_INVALIDThe API key is invalid or has been revoked
401API_KEY_EXPIREDThe API key has expired
404NOT_FOUNDThe specified stream was not found in the organization
429RATE_LIMIT_EXCEEDEDThe rate limit was exceeded (see Retry-After)