Repository navigation
Live events
This article explains part of Radio 2.0 in plain words. It is not normative: where it differs from the specification, the specification is right.
Live events are the typed JSON messages with which a Radio 2.0 station tells players what is playing and which show is on, sent over Server-Sent Events with a polling fallback. They carry the air time of each item, so a player can show a title when the listener actually hears it.
| Defined in | Specification section 5 |
| Manifest member |
events with sse, poll, pollInterval
|
| Transport | Server-Sent Events (text/event-stream); JSON poll as fallback |
| Schema | https://radio2.org/schema/v0.2/event.schema.json |
| Size limit | 64 KiB per event |
| Status | Draft |
When the manifest has an events object, both addresses must work. events.sse is an SSE stream. events.poll answers the latest now_playing event as a JSON document. Every event is a JSON object valid against the event schema and sent as one SSE message whose event field equals the object's type and whose id field equals its id. URLs inside events may be relative and resolve against the address the event came from.
-
type: one of the types on Event types. -
id: required except onheartbeat; unique within the stream, 1 to 128 printable ASCII characters. Consumers treat it as opaque. -
sentAt: when the publisher sent the event.
item.startedAt is the air time: when the item started at the station's output, before any stream delay. A player should show an item at startedAt plus the stream's typicalDelayMs, or plus its own measured delay. Players of hls and ll-hls streams should instead match startedAt against EXT-X-PROGRAM-DATE-TIME when the playlist carries it. This is why a player can show a title when it is heard, not seconds early.
A publisher must send an SSE message or comment at least every 30 seconds. A heartbeat event is recommended, because browser EventSource clients cannot see comments. A consumer should reconnect after 60 seconds without any message. A publisher should send an SSE retry field.
A reconnecting consumer sends the last id it received in Last-Event-ID. The publisher must then either send every event after that id that it still holds, or send the current state as one now_playing. If the id is the newest, it may send nothing until the next change. A consumer must treat any now_playing as the complete current state.
events.poll returns the same object as the latest now_playing, with an ETag that changes when the event does, and answers 304 to If-None-Match. events.pollInterval (5 to 300 seconds, default 15) says how often to ask. A consumer must not poll more often than every 5 seconds. The poll address should carry a max-age of at most 5 seconds.
- A publisher must not announce items that have not started. There is no "next" in this version, because stations often must not reveal coming songs.
-
listenersis optional, and a publisher that does not show its listener count elsewhere must leave it out. - The event stream must not be cached.
{
"type": "now_playing",
"id": "k3x9-1042-1",
"sentAt": "2026-12-01T19:12:04.120Z",
"item": {
"kind": "song",
"title": "Starlight Horizon",
"artists": ["Nova Pulse"],
"startedAt": "2026-12-01T19:12:04.000Z",
"durationMs": 210000
},
"live": true,
"onAir": true,
"show": { "title": "The Chillout Lounge", "presenters": ["Alex Vance"] }
}Radio 2.0 is an open standard, MIT licensed. Documentation: radio2.org. Questions: Discussions.
Overview
The manifest
Discovery and identity
Live data
Money
Implementations and tools
- Implementations
- Reference implementation
- radio2 command line tool
- Create a manifest
- Conformance
- Stations
- Brand and badges
Project
Documentation
Community