Icecast provides extensive run time statistics. Both in the form of active connection numbers and cumulative counters (since server startup or respectively source connection startup).
Icecast comes with a basic, XHTML web interface. It exposes a basic set of server statistics that should
fulfil basic user needs. If so desired the files in web-root can be customized to contain more or less
information (see section on raw XML data below).
We strongly discourage attempts to scrape data from the web interface as we do not consider this an
API and will change it, even completely, between versions!
The preferred ways are custom XSLT, JSON and raw XML.
Since version 2.4.0 Icecast includes a basic JSON API (/status-json.xsl
) based on a xml2json template by Doeke Zanstra
(see xml2json.xslt
). It exposes the same set of server statistics that are available through the web interface and
should fulfil basic user needs. The intention is to not break backwards compatibility of this interface in the future,
still we recommend to design robust software that can deal with possible changes like addition or removal of variables.
Also note that not all variables are available all the time and availability may change at runtime due to stream type, etc.
Icecast uses the very powerful libXSLT engine to transform its internal raw statistical data into custom tailored interfaces. Many people have written custom XSLT code that produces e.g. plain text “now playing”, XSPF, VCLT, munin interface data, etc.
This section contains information about the raw XML server statistics data available inside Icecast. An example stats XML tree will be shown and each element will be described. The following example stats tree will be used:
<icestats>
<admin>icemaster@localhost</admin>
<client_connections>649</client_connections>
<clients>2</clients>
<connections>907</connections>
<file_connections>379</file_connections>
<host>localhost</host>
<listener_connections>90</listener_connections>
<listeners>0</listeners>
<location>Earth</location>
<server_id>Icecast 2.5</server_id>
<source_client_connections>164</source_client_connections>
<source_relay_connections>0</source_relay_connections>
<source_total_connections>164</source_total_connections>
<sources>2</sources>
<stats>0</stats>
<stats_connections>0</stats_connections>
<source mount="/audio.ogg">
<title>All that she wants</title>
<artist>Ace of Base</artist>
<audio_bitrate>499821</audio_bitrate>
<audio_channels>2</audio_channels>
<audio_info>samplerate=44100;quality=10%2e0;channels=2</audio_info>
<audio_samplerate>44100</audio_samplerate>
<channels>2</channels>
<genre>various</genre>
<ice-bitrate>499</ice-bitrate>
<listener_peak>0</listener_peak>
<listeners>0</listeners>
<listenurl>http://localhost:8000/audio</listenurl>
<max_listeners>unlimited</max_listeners>
<public>1</public>
<quality>10.0</quality>
<samplerate>44100</samplerate>
<server_description>Teststream</server_description>
<server_name>Great audio stream</server_name>
<server_type>application/ogg</server_type>
<server_url>http://example.org/</server_url>
<slow_listeners>0</slow_listeners>
<source_ip>192.0.2.21</source_ip>
<subtype>Vorbis</subtype>
<total_bytes_read>3372153</total_bytes_read>
<total_bytes_sent>0</total_bytes_sent>
<user_agent>LadioCast/0.10.5 libshout/2.3.1</user_agent>
</source>
<source mount="/video.ogg">
<audio_bitrate>276000</audio_bitrate>
<audio_channels>6</audio_channels>
<audio_samplerate>48000</audio_samplerate>
<frame_rate>25.00</frame_rate>
<frame_size>720 x 576</frame_size>
<genre>various</genre>
<ice-bitrate>276</ice-bitrate>
<listener_peak>0</listener_peak>
<listeners>0</listeners>
<listenurl>http://localhost:8000/video</listenurl>
<max_listeners>unlimited</max_listeners>
<public>0</public>
<server_description>Unspecified description</server_description>
<server_name>Unspecified name</server_name>
<server_type>video/ogg</server_type>
<slow_listeners>0</slow_listeners>
<source_ip>192.0.2.21</source_ip>
<subtype>Vorbis/Theora</subtype>
<title>ERAGON</title>
<total_bytes_read>37136</total_bytes_read>
<total_bytes_sent>0</total_bytes_sent>
<user_agent>Lavf/55.20.0</user_agent>
<video_bitrate>200000</video_bitrate>
<video_quality>0</video_quality>
</source>
</icestats>
server_start_iso8601
instead.Please note that the statistics are valid within the scope of the current source connection.
A reconnect or disconnection will reset those.
samplerate=44100;quality=10%2e0;channels=2
(LadioCast)ice-bitrate=128;ice-channels=2;ice-samplerate=44100
(Butt)/
.<server>
.stream_start_iso8601
instead.Additional data can be accessed through the admin interface, as every page of the admin interface has an XML equivalent.