← NONSTOPVOD

Developers

Loading the API reference…

Public status endpoints

Two small endpoints for your own bots, overlays and pause screens. No account, no key.

Your channel's public id

Both endpoints are named by your channel's public id: 32 lowercase hex digits, never your Twitch login. It exists before your first pause and never changes. Copy a ready made address from the dashboard under Settings, Advanced: the "Last frame" row holds the image address and the "Live status" row holds the websocket address. The dashboard may show the image address on cdn.nonstopvod.com instead of nonstopvod.com; both addresses answer. In the examples below it appears as YOUR_ID.

Live status websocket

The address:

wss://nonstopvod.com/api/v1/events/public-live/YOUR_ID

It is off until you switch it on in Settings, Advanced, "Live status". While it is off, or for an unknown id, the connection is closed right away with code 4404.

On connect, and again every time something changes, the server sends one text message with exactly these two fields and nothing else:

{"main": "live", "replay": "playing"}
  • main is "live" while your own Twitch channel is live, otherwise "offline". It is refreshed about every 30 seconds, so it can trail Twitch by up to half a minute or so.
  • replay is "playing" while your 24/7 replay channel is streaming, and "paused" while it is stopped or stepping aside because you are live.

The server sends a websocket ping every 30 seconds; browsers and common libraries answer it on their own. Anything your client sends is ignored. Use the last message you received as the current state.

If the socket is refused, it is closed right after connecting with one of these codes:

  • 4404: not found. The id is wrong, the live status is off, or your 24/7 replay channel is not connected. All reasons look the same. Do not retry until you have checked Settings. A 4404 on a socket that was already open is final too: the status was switched off, the replay channel was disconnected or the account is being deleted. It is not a drop.
  • 4429: too many connections, at most 5 per address, or too many connects from one address within a minute (every connect counts, shared with the GET below). A channel holds up to 100 and the server 200 in total; when one is full, a newcomer from an address holding fewer takes the oldest socket of the address holding the most, which is then closed with 4429. Wait a minute before retrying.
  • 1011: the server could not look the channel up. Retry after a few seconds.

An open socket is closed with 1001 after one hour. Reconnect right away; you get the current state on connect.

In a browser:

const ws = new WebSocket("wss://nonstopvod.com/api/v1/events/public-live/YOUR_ID");
ws.onmessage = (event) => {
    const state = JSON.parse(event.data);
    console.log(state.main, state.replay);
};

In Node 22 or newer, with a reconnect after a drop (wait longer after 4429, stop after 4404):

const url = "wss://nonstopvod.com/api/v1/events/public-live/YOUR_ID";
function connect() {
    const ws = new WebSocket(url);
    ws.onmessage = (event) => console.log(JSON.parse(event.data));
    ws.onclose = (event) => {
        if (event.code === 4404) return console.error("live status is off or the id is wrong");
        setTimeout(connect, event.code === 4429 ? 60000 : 5000);
    };
}
connect();

Live status GET

The same two fields for a tool that would rather poll:

GET https://nonstopvod.com/api/v1/public/live/YOUR_ID

{"main": "offline", "replay": "paused"}

It answers 404 in the same cases the websocket closes with 4404, and 429 past 60 uncached reads a minute per address (cached answers do not count; websocket connects share the same budget). The answer is cached for 5 seconds and allows requests from any website. Poll at most every 10 to 15 seconds; a faster poll only returns the same cached answer. If you can, use the websocket instead.

curl https://nonstopvod.com/api/v1/public/live/YOUR_ID

Last frame image

https://nonstopvod.com/lastframe/YOUR_ID.jpg

The last picture your stream showed before it paused or stopped, as a full size JPEG, without any overlays. It is replaced each time your stream pauses or stops, so use it for a pause screen or a "back soon" image. Find the address in Settings, Advanced, "Last frame". It answers 404 until the first image exists, and while your 24/7 replay channel is not connected.

Browsers and OBS may keep a copy for up to 30 seconds. To always fetch the newest picture, add a changing value to the address, such as ?t=1767225600, and change it whenever you reload.

<img src="https://nonstopvod.com/lastframe/YOUR_ID.jpg?t=1767225600" alt="Last frame" />