Beyond the web player, CloudRadio provides a JavaScript widget for showing live stream info on your site, and downloadable listen links for desktop media players. You’ll find ready-to-copy code snippets in your radio’s Widgets & Links page in Studio.
JavaScript Widget
The JavaScript widget updates HTML elements on your page with live stream metadata. It doesn’t render a player UI, so you can build your own display and style it however you like.
Get the Code
- Open your radio in Studio
- Go to Widgets & Links in the sidebar
- Copy the script tag from the top of the page
The script tag looks like this:
<script src="https://public.cloudrad.io/your-subdomain/streaminfo.js"></script>Your subdomain is already filled in. Just paste it into your website’s HTML.
Then add elements with the following IDs wherever you want the data to appear. Each widget card on the Widgets & Links page shows a live preview and a copy button for the corresponding HTML snippet.
| Element ID | Data displayed |
|---|---|
stream_info_song | Current song title and artist |
stream_info_title | Station name |
stream_info_bitrate | Stream bitrate |
stream_info_listeners | Current listener count |
stream_info_source | Stream source URL |
stream_info_songhistory | Recent song history |
Example
<p>Now playing: <span id="stream_info_song">Loading...</span></p>
<p>Listeners: <span id="stream_info_listeners"></span></p>The widget polls for updates every 10 seconds. You only need to include the elements you want. Any missing IDs are ignored.
Song History
For the song history element, add a data-count attribute to control how many entries to display:
<div id="stream_info_songhistory" data-count="5"></div>Values from 1 to 100 are supported. If omitted, the default count is used.
Listen Links
CloudRadio generates playlist files that open your stream in desktop media players like Winamp, VLC, or iTunes. You’ll find all available links with copy buttons on your radio’s Widgets & Links page under Direct Links.
The URL format is:
https://embed.clrd.net/api/your-subdomain/listen.m3uSupported Formats
| Format | File | Used by |
|---|---|---|
| M3U | listen.m3u | Most media players, VLC |
| PLS | listen.pls | Winamp, foobar2000 |
| ASX | listen.asx | Windows Media Player |
| RAM | listen.ram | RealPlayer |
| QTL | listen.qtl | QuickTime |
Link to a Specific Mount Point
If your radio has multiple mount points, specify the mount in the URL:
https://embed.clrd.net/api/your-subdomain/mountname/listen.m3uAutoDJ Listen Links
For AutoDJ stations, the URL uses the station slug:
https://embed.clrd.net/api/autodj/your-station-slug/listen.m3uAdd to Your Website
Copy the listen link from your radio’s Widgets & Links page and use it as a download link:
<a href="https://embed.clrd.net/api/your-subdomain/listen.m3u">
Open in media player
</a>Stream Info API
For advanced integrations, you can query stream metadata directly as JSON:
GET https://embed.clrd.net/api/your-subdomain/info.jsonThis returns current song title, artist, listener count, bitrate, and song history.
Optional Parameters
| Parameter | Description |
|---|---|
history_format=json | Returns structured history with cover art URLs |
history_count=10 | Number of history entries (1 to 100) |
Example:
https://embed.clrd.net/api/your-subdomain/info.json?history_format=json&history_count=10The API supports CORS and can be called from any domain. Responses are cached for 5 seconds.