Play a web radio station via REST API

I’m trying to extend my Volumio set-up using the REST API to remote control various bits. So far I’ve got the basics in place, but web radio is eluding me.

At the moment I’ve got toggling play/pause working via plus various other of the commands listed in the API page.

However I’m struggling a bit with web radio stations. I’ve got a few set up and working fine in my web radio via the web GUI, but I’d like to be able to remotely switch between them. I’m presuming the command I want is but I’m not sure what the relevant payload would be and how to add that to the command.

At the moment I’m sending the commands using either a simple batch file (using curl) or via a Python3 script. It’s working fine for the toggle commands, but can someone give me an example of what the correct command for replaceAndPlay would be (or if there’s a better way of doing this)?

It may not be what you want but…If I remember correctly (I’ll need to check…) I have saved playlists with the web radio and call the playlist via REST API.

Thanks. That’s an interesting workaround (which works with individual playlists for each station).

I’d still be interested to know if it’s possible with replaceAndPlay, so know what the actual command would be.


as i am playing with remote control right now, i got it working
KEY_COMPOSE 1 curl -i --header "Content-Type: application/json" localhost:3000/api/v1/replaceAndPlay --data '{"service": "webradio", "type": "webradio", "title": "Bayern3", "uri": ""}'

Just replace the KEY… with your desired Key and change the uri to your favorite radio station.


@AxLED - thanks :smiley:

The playlist route actually worked better, as I can also use the next/previous keys on the remote to switch between stations, rather than going the original route I was thinking to have preset “favourite” keys for each individual station.

But I’ll certainly make a note of your method too for future use in case I do want to go that way for specific stations in the future. It’s all working nicely though, routing stuff via Home Assistant and using some Ikea Tradfri remotes to control my Volumio Pi’s.