The Radio app provides a REST API to control playback and query information.
If authentication is enabled in the app settings, you must include the pairing code in your requests:
X-Remote-Key: YOUR_CODE?token=YOUR_CODE (fallback for images and WebSockets)/api/statusReturns current playback status. Recommended for initial state only; use WebSockets for real-time updates.
{
"isPlaying": true,
"playWhenReady": true,
"playbackState": 3,
"currentStationUuid": "fc080549-...",
"metadata": "Artist - Title",
"starred": true
}
/api/updatesWebSocket endpoint for real-time status updates. Pushes status objects whenever state or metadata changes.
const token = '123456'; // From app settings
const socket = new WebSocket('ws://' + location.host + '/api/updates?token=' + token);
socket.onmessage = (event) => {
const status = JSON.parse(event.data);
console.log('Update received:', status);
};
/api/stationsReturns all stations in collection.
[
{
"uuid": "fc080549-...",
"name": "Station Name",
"hasImage": true,
"starred": true
}
]
/api/image/{uuid}Returns the image for a specific station. Supports HTTP caching via ETag and If-None-Match.
/api/configReturns the app version.
{ "version": "15.1" }
/api/play/{uuid}Starts playback of a specific station.
{ "status": "ok" }
/api/pausePauses current playback.
{ "status": "ok" }
/api/resumeResumes current playback.
{ "status": "ok" }
/api/nextPlays the next station.
{ "status": "ok" }
/api/prevPlays the previous station.
{ "status": "ok" }