Beyond the web player, CloudRadio provides a JavaScript widget for showing live stream info on your site, a schedule widget for your upcoming shows, a poll widget for your on-air polls, 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 station or radio in Studio
- Go to Widgets & Links in the sidebar
- On an AutoDJ station, open the Website Widgets tab and copy the script tag from step 1, Add this script once to your website. On a hosted radio, 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_status | On Air or Off Air |
stream_info_live_source | Studio, Guest DJ or DJ while a DJ is on air, empty otherwise (CloudRadio One only) |
stream_info_songhistory | Recent song history |
The text elements above receive plain text, so they inherit your page's fonts and colors. Recent song history is the exception: it renders a formatted list with cover art.
Styling the On Air Status
The status element also gets a data-state attribute, set to on or off. Use it to style each state from your own stylesheet:
#stream_info_status[data-state="on"] {
color: #16a34a;
font-weight: 600;
}
#stream_info_status[data-state="on"]::before {
content: "";
display: inline-block;
width: .5em;
height: .5em;
margin-right: .45em;
border-radius: 50%;
background: currentColor;
}
An older element,
stream_info_source, shows the raw connection state instead. It still works, so existing pages keep running, but its wording varies by station type. Usestream_info_statuson new pages.
Live vs Automated
CloudRadio One stations also report which input is on air, so you can show a live indicator only while a DJ is broadcasting. The status element gains a data-source attribute (live, relay, or automated) and, while a DJ is on air, data-source-name (studio, guest or dj). A stream_info_live_source element displays the input name as text. See Live Source Indicator for the attributes, CSS examples, and the matching API fields.
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
The app calls this the Recent tracks widget. 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.
Schedule Widget
The schedule widget shows your station's upcoming shows and DJs on your own website. It is a small page you place with an <iframe>, and it reads the same events as your Schedule page, so it changes when you edit your schedule. It is available on CloudRadio One stations.
Add the Schedule to Your Website
- Open your station in Studio
- Go to Widgets & Links in the sidebar and open the Website Widgets tab
- Under Schedule widget, pick the options you want. The Live preview shows the real widget with your schedule and changes as you pick
- Click Copy under Embed code
- Paste the code into your website's HTML where the schedule should appear
The code looks like this:
<iframe
src="https://embed.clrd.net/schedule/your-station-slug?theme=dark"
title="Your Station schedule"
width="100%" height="600" style="border:0;max-width:100%" loading="lazy"
></iframe>
The schedule widget does not need the JavaScript widget's script tag. Your options are saved in the code itself, not in Studio: to change the style later, pick the new options and paste the new code over the old one.
Widget Options
| Option | What it does |
|---|---|
| Theme | Light, or Dark for dark websites |
| Corners | Rounded, Top rounded (square bottom corners, for a widget that sits on top of other content) or Square |
| Show artwork | A square beside each show: the playlist image of a playlist show (see Add a playlist image), otherwise an icon for the type of show: music, live DJ or relay |
| Accent colour | The colour of the header bar, the selected day and the on-air row. The default is CloudRadio blue |
| Show header | The header bar at the top. Turn it off for a page that already names your station |
| Header text | The text on the right of the header, up to 40 characters. Empty shows Schedule. On a narrow widget, long header text is shortened to fit |
| Show station name and Show station logo | Your station name and logo on the left of the header. The logo is the one in Profile & Branding |
| Automatic header text colour | On, the header text is white or black, whichever is easier to read on the accent colour. Off, pick your own Header text colour |
| Width | Auto (100%) fills the space on your page and shrinks with it on phones. Fixed sets a width in pixels, from 240 to 1600 |
| Height (px) | The height of the frame, from 240 to 2000 pixels. A longer day scrolls inside the frame, under the header and day tabs |
What the Schedule Shows
- A header bar with your station logo and name, and your header text
- A row of tabs for the next 7 days (for example Mon over 9 Nov, or 9 alone on a widget narrower than 360 pixels), starting today, with a dot on today. The widget opens on today; a listener clicks a tab to see that day's shows, and a day with nothing on it says Nothing scheduled
- The day's name and your station's time zone (for example Toronto time). Start and end times follow the Timezone setting in Settings
- The event name in bold. An event without a name shows its playlist's or relay's name, and a Live DJ event without a name shows the DJ's on-air name (or their account name, then their login username), so name any event you don't want listed that way
- Under a named Live DJ event, the DJ's name in lighter text. A DJ who is no longer on your station is never named
- The show scheduled at this moment is highlighted with a pulsing On air dot, and the next one has an Up next label. The marker follows your schedule, not what your stream is actually playing. The dot does not pulse for visitors who turned off animations on their device
Paused events and background programming are left out. Shows that have already ended today drop off the list. The page refreshes every 5 minutes and stays on the day the listener picked, so the On air marker moves without a reload of your website.
Older Embed Codes
Embed codes copied before the options form keep working. Their ?theme=dark, ?accent= and ?header=0 options are the same as Theme, Accent colour and Show header, and the widget shows the new layout. They keep the height they were copied with (480 pixels) until you paste a new code.
Poll Widget
The poll widget puts your on-air poll on your own website, so listeners can vote without opening a player. It shows the poll you run from Live DJ > Polls, with the same question, answers and results as your players and station page. It is available on CloudRadio One stations.
Add the Poll to Your Website
- Open your station in Studio
- Go to Widgets & Links in the sidebar and open the Website Widgets tab (or click Add the poll to your website on the Polls tab of Live DJ)
- Under Poll widget, pick a Theme (Light or Dark) and an Accent colour. The accent colours the selected answer, the Vote button and the listener's own result
- Click Copy under Embed code
- Paste the code into your website's HTML where the poll should appear, for example under your player or in a sidebar
The code is one script tag:
<script src="https://public.cloudrad.io/embed/poll/your-station-slug/widget.js?theme=dark" async></script>
It does not need the JavaScript widget's script tag. Like the schedule widget, your options are saved in the code itself: to change them, paste the new code over the old one.
When the Poll Shows
- No poll running: the widget shows nothing and takes no space on your page.
- A poll opens: it appears within about 30 seconds, sized to fit the poll. Listeners already looking at the poll see votes come in live.
- The poll closes: the final results stay for 10 minutes, then the widget hides itself again.
The Live preview in Studio shows the real widget while a poll runs. While none runs, it shows a sample poll so you can pick the theme and accent at any time: switch between Open poll and Closed with results to see both states. Only you see the sample; your site still shows nothing. Votes are off in the preview, so you can't vote by accident.
Voting
Listeners vote right on your page, one vote per listener per poll, with the same rules as your players and station page: the vote count stays hidden under 5 votes, and a poll set to hide results shows them only once it closes. In the poll report and the CSV export, these votes count as Website widget.
Song Requests
While song requests are on, the Website Widgets tab has a Song requests section. It is available on CloudRadio One and Custom stations.
- Request page is a link to a request page we host for you, made for phones. Click the copy button and share it anywhere. The Settings tab of Song requests has the same link.
- Website widget puts the same request box on your own website. Pick a Theme (Light or Dark) and an Accent color, check the Preview, then click Copy under Embed code and paste the code where the box should appear. It does not need the JavaScript widget's script tag.
When requests are off, the section is hidden and the widget hides itself on your website. See Share the request page for the details.
Shout-out Widget
The Website Widgets tab also has a Shout-out widget section, with the code for a widget where listeners record a voice message for your station: see Shout-outs.
Listen Links
CloudRadio generates playlist files that open your stream in desktop media players like Winamp, VLC, or Windows Media Player. You'll find all available links with copy buttons on your radio's Widgets & Links page under Direct Listen Links.
The URL format is:
https://embed.clrd.net/api/your-subdomain/listen.pls
Supported Formats
| Format | File | Used by |
|---|---|---|
| PLS | listen.pls | Winamp, foobar2000, VLC |
| M3U | listen.m3u | VLC and most media players |
| ASX | listen.asx | Windows Media Player (classic hosting only) |
| RAM | listen.ram | RealPlayer (classic hosting only) |
| QTL | listen.qtl | QuickTime (classic hosting only) |
Browsers do not play these playlist files inline. They download them and hand them off to the system media player. Use the web player for in-browser listening.
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.pls
AutoDJ Listen Links
On CloudRadio One stations, Direct Listen Links starts with an ICY Stream card: the station's stream address itself, in HTTPS and HTTP, with copy buttons. It doesn't change when you rename the station. Use it in apps, smart speakers and directories that want a stream URL rather than a playlist file, and in any player that needs song titles in the stream (ICY metadata). Use the HTTP address only for older devices that can't play HTTPS.
The playlist files use the station slug and come as PLS and M3U:
https://embed.clrd.net/api/your-station-slug/listen.pls
https://embed.clrd.net/api/your-station-slug/listen.m3u
Add 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.pls">
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.json
This 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=10
The API supports CORS and can be called from any domain. Responses are cached for 5 seconds.