radio2

module
v0.2.4-draft Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2026 License: MIT

README

Radio 2.0

CI Go Reference OpenSSF Scorecard Latest release

Radio 2.0 station manifest (working draft 0.2)

Radio 2.0 lives at radio2.org.

Radio 2.0 is a small open standard for live internet radio. A station publishes one JSON file, the manifest, that says who it is, how to hear it, where its live "now playing" events and schedule are, how to reach the studio and how listeners can support it. Players and directories find the manifest from a stream URL or a homepage, check that the station publishes it, and keep following the station by a permanent guid when its stream hosts, ports or formats change.

It sits next to what radio already uses. ICY metadata and Icecast or SHOUTcast streams keep working unchanged; the manifest adds identity, richer metadata, timing and discovery.

Read it on the site

The website renders everything in this repository with a table of contents, linked headings and highlighted examples, and adds guides that are not in the repository files.

If you want to Start here
Get the idea in two minutes Home, then the FAQ
Publish a manifest for your station Guide for publishers: write it, serve it, make it discoverable
Build one without writing JSON by hand Create a manifest (runs the reference validator in your browser)
Read manifests in a player or directory Guide for players: find it, read it, live information
Read the full standard Specification and its conformance checklist
Look up a schema or an example Schemas, examples
See what changed between drafts Changes
Help shape the draft Contributing

What is here

Path What it is On the site
SPECIFICATION.md The specification, version 0.2.4-draft. Specification
schema/ JSON Schemas (2020-12) for the manifest, live events and the schedule document. Schemas
examples/ Manifests (minimal; FM + HD + web; DAB+ only; internet only), a schedule and one file per event type. All validate against the schemas; their guids are for documentation only. Examples
appendix/directory-storage.md One way a directory may store the manifests it reads (not part of the standard). Directory storage
CHANGES-FROM-DRAFT.md What changed from the earlier 1.1.0 draft, and why. Changes
site/ Source of the website at https://radio2.org, built from this repository. radio2.org
CONTRIBUTING.md, LICENSE How to propose changes; MIT licence. Contributing
CODE_OF_CONDUCT.md, SECURITY.md, SUPPORT.md Community rules, how to report a vulnerability, where to ask questions.

Reference implementation

A Go library and command line tool live at the root of this repository (module github.com/Tend-Stack/radio2, pure Go, no cgo). There are no SDKs in other languages yet.

Package What it does
manifest Types for the manifest, events and schedule; strict Parse, ParseEvent, ParseSchedule (and ParseLenient for consumers that must ignore unknown members); Validate* against the embedded JSON Schemas plus rules a schema cannot express (unique stream ids, split sums, https and the development-host exemptions, schedule order, time zones); Normalize (one default stream, defaults, security tier).
discover Finds a manifest from a homepage (HTML link, then the well-known address) or a stream URL (HTTP Link header, never reading the stream body; icy-url as a fallback), applies the section 4 verification rule, and enforces the section 10.2 limits (10 s, 256 KiB, 5 redirects, no downgrade to http, development addresses refused unless configured).
cmd/radio2 radio2 validate <file|url> and radio2 discover <homepage-or-stream-url>. Exit codes: 0 pass, 1 fail, 2 usage or network error.
schema The JSON Schemas, embedded with go:embed.
Install
go install github.com/Tend-Stack/radio2/cmd/radio2@latest
radio2 version
# radio2 v0.2.4-draft (spec 0.2)

Or download a prebuilt binary for Linux, macOS or Windows from Releases. Each release lists SHA256SUMS and carries build provenance; verify an archive with gh attestation verify <archive> --repo Tend-Stack/radio2.

Conformance: all examples must pass and every file in testdata/invalid/ must fail for the reason in its name; discovery is tested against local httptest servers. Run go test -race ./....

rep := manifest.Validate(data, manifest.Options{})
if !rep.OK() {
	for _, p := range rep.Errors() {
		fmt.Println(p) // "/streams/1/id: stream id "main" is used more than once [unique-id]"
	}
}
res, err := discover.New(discover.Config{}).Discover(ctx, "https://radio.example.org/")
// res.ManifestURL, res.Verified

In one minute

  • One format: JSON, with a published schema (section 2, schemas).
  • Discovery: /.well-known/radio-manifest.json, an HTML <link rel="alternate" type="application/radio-manifest+json">, and a Link: <...>; rel="radio-manifest" header on stream responses, so a player that only has a stream URL can find the station (section 3).
  • Ownership: a manifest counts only when the station's homepage origin serves or links it; locked stops directories from moving a station automatically (section 4).
  • Live events: Server-Sent Events with typed events (now_playing, show_change, live_start, live_end, schedule_change, value_change), ids for resume, a heartbeat, a poll fallback with the same JSON, and air times so players show a title when the listener hears it (section 5).
  • Support: a value block in the shape of Podcasting 2.0 <podcast:value>, paid wallet to wallet. Nobody in between holds money (section 8).
  • Visual radio: optional fields only in this version (section 9).

How it relates to Podcasting 2.0 liveItem

podcast:liveItem Radio 2.0 manifest
Unit A live episode inside a podcast RSS feed, with pending, live or ended status A station that is on continuously
Format RSS/XML JSON
What is playing Not covered Typed live events with air times
Finding it Through the feed From a stream URL or homepage
Support podcast:value The same model in JSON, plus live overrides until the next item

The two work together: a station that also publishes a podcast feed can announce special broadcasts there with liveItem, and its manifest describes the station itself.

Status

This is a working draft. Nothing is stable, and nothing here has been registered with IANA yet (see section 11 of the specification).

  • Community: questions and ideas go to Discussions; the wiki lists implementations.
  • Home: radio2.org hosts the specification, and the schemas at their $id addresses (https://radio2.org/schema/v0.2/).
  • Reference implementation: the Go library and radio2 command line tool described above are in this repository; there are no packaged releases or SDKs in other languages yet. Publisher support in TendCast (radio automation software by TEND STACK LLC) and reader support in a station directory are planned.

Licence

MIT. See LICENSE.

Directories

Path Synopsis
cmd
radio2 command
Command radio2 validates Radio 2.0 documents and discovers station manifests.
Command radio2 validates Radio 2.0 documents and discovers station manifests.
Package discover finds a station's manifest from a homepage or a stream URL (SPECIFICATION.md section 3) and applies the verification rule of section 4.3, with the fetching limits of section 10.2.
Package discover finds a station's manifest from a homepage or a stream URL (SPECIFICATION.md section 3) and applies the verification rule of section 4.3, with the fetching limits of section 10.2.
Package manifest implements the Radio 2.0 station manifest, live events and schedule document (SPECIFICATION.md sections 2, 5, 6, 7, 8 and 10), including the over-the-air description of section 2.6.
Package manifest implements the Radio 2.0 station manifest, live events and schedule document (SPECIFICATION.md sections 2, 5, 6, 7, 8 and 10), including the over-the-air description of section 2.6.
Package schema embeds the Radio 2.0 JSON Schemas so that Go programs can validate documents without reading files at run time.
Package schema embeds the Radio 2.0 JSON Schemas so that Go programs can validate documents without reading files at run time.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL