Public API
Public API
Section titled “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).
Authentication
Section titled “Authentication”/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.
/healthand/openapi.jsondo not require authentication.
Rate Limits
Section titled “Rate Limits”/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-Resetheaders so you can check the remaining allowance. - Exceeding the limit returns
429(with aRetry-Afterheader). /healthis not subject to rate limiting.
OpenAPI Specification
Section titled “OpenAPI Specification”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.jsonResponse Format
Section titled “Response Format”On success:
{ "success": true, "data": { ... }, "request_id": "req_…"}On failure:
{ "success": false, "error": { "code": "…", "message": "…" }, "request_id": "req_…"}Endpoints
Section titled “Endpoints”GET /health — Server Status (No Authentication Required)
Section titled “GET /health — Server Status (No Authentication Required)”Returns the online status of all delivery nodes.
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.
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.
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 }}Main Errors
Section titled “Main Errors”| HTTP | code | Meaning |
|---|---|---|
| 401 | UNAUTHORIZED | No API key was provided |
| 401 | API_KEY_INVALID | The API key is invalid or has been revoked |
| 401 | API_KEY_EXPIRED | The API key has expired |
| 404 | NOT_FOUND | The specified stream was not found in the organization |
| 429 | RATE_LIMIT_EXCEEDED | The rate limit was exceeded (see Retry-After) |