Articles on: EverestCast

API DOCUMENTATION EVERESTCAST

This section shows how to use the API of our Everestcast Server to obtain information about the state of the air and other data on your site. Using our API you can build your own scripts and modules for your radio site.

As a result of the request to the API, the data in the JSON / JSONP format will be displayed.

The API call is made to the address <your panel address on the server> / api / <parameters>, for example:  https://ec1.yesstreaming.net:8080/api/djs/?limit=1.

Currently implemented API to the following resources:

Server / Server - getting information about servers created in the control panel
Channel / Channel - information about server channels (list, bitrate and other data)
History / History - the history of the ether
DJ / DJ - information about DJ radio
For each of the resources, you can request a list of them, for example:

/ api / servers / - getting a list of servers
/ api / channels / - list of all channels
/ api / djs / - get a list of DJs
/ api / history / - history of air

Server response format



{
"meta": {
"limit": <number of objects per page>,
"next": <uri to get the next page>,
"offset": <starting from which element you need to give data>,
"previous": <uri to get the previous page>,
"total_count": <total number of items>
},
"objects": [
<object 1>,
<object 2>,
...
<object n>
]
}


You can change the number of objects in the query and set the sampling limits by manipulating the limit and offset parameters.

For example:

/ api / djs /? limit = 1 - get only one (first) DJ
/ api / history /? limit = 1 - the current song on the air (the first in the history of the air)

Request Filtering



Filtering parameters are passed as GET request parameters.

Filters are needed in order to select not all objects, but specific ones, for example, a list of only active DJs. The following filters are available for objects:

Server - no filters
Channel - [server <server id>]
History - [server <server id>]
DJ - [server <server id> | active <0 | 1> | connected <0 | 1> | on_air <0 | 1>] where:
active - is the DJ turned on (can it connect to the air)
connected - is the dj connected at the moment
on_air - if equal to 1, then the DJ is connected, active and is now on the air.
Filtering examples:

/ api / djs /? limit = 1? server = 1 & on_air = 1 - get data about DJ on air on server 1
/ api / channels /? server = 1 - get a list of server channels 1
/ api / history /? server = 1 & limit = 1 - the current song on server 1

API example


In this simple example, we will request every 5 seconds the name of the current track on the radio and display it on the page.
<html>
<body>
<div id = "track"> </ div>

<script src = "https://code.jquery.com/jquery-2.2.4.min.js"> </ script>
<script>
$ (document) .ready (function () {
function updateTrack () {
$ .ajax ({
// Additionally, two parameters are passed.
// callback & format to get data
// in JSONP format. This will overcome the CORS constraint.
url: "https://ec1.yesstreaming.net:8080/api/history/?server=1&limit=1&callback=callback&format=jsonp",
jsonp: "callback",
dataType: "jsonp",
method: "GET",
success: function (response) {
var trackTitlte = response.objects [0] .metadata;
$ ("# track"). text (trackTitlte);
}
});
}
updateTrack ();
setInterval (updateTrack, 5 * 1000);
});
</ script>
</ body>
</ html>






*If there is any question or issue please contact yesstreaming.com Ticket Support Team

Updated on: 06/09/2023

Was this article helpful?

Share your feedback

Cancel

Thank you!