Kwiktec online radio station API

Introduction
Kwiktec¬†online radion station features a public HTTP API that allows you to retrieve JSON-encoded information about a station and what’s currently playing.
To invoke an API, make an HTTP request to:
http://my-Kwiktec-station/api/live-info
Live Info API
live-info
Note: The live-info-v2 API below is slightly easier to use. We recommend using that API instead.
The current (as of 2.5.1) live-info API provides the user with a JSON encoded object containing track, show, and station data in the following format:
{
“env”: “”,
“schedulerTime”: “”,
“previous”: {
“name”: “”,
“starts”: “”,
“ends”: “”
},
“current”: null,
“next”: {
},
“currentShow”: [
{
“start_timestamp”: “”,
“end_timestamp”: “”,
“name”: “”,
“description”: “”,
“id”: 0,
“instance_id”: 0,
“instance_description”: “”,
“record”: 0,
“url”: “”,
“image_path”: “”,
“starts”: “”,
“ends”: “”
}
],
“nextShow”: [
{
}
],
“timezone”: “”,
“timezoneOffset”: “”,
“Kwiktec_API_VERSION”: “”
}

This format supports the following parameters:
type
api/live-info?type=endofday – provides information on shows until the end of the current day, in the station timezone
api/live-info?type=interval – default; provides information for a 48 hour interval from the current time
limit
api/live-info?limit=n – limits the number of shows returned by the request. The defaults is 5
callback
api/live-info?callback=myFunction – passes a user-defined function as JSONP padding to call on the JSON response

live-info-v2
Changes to live-info (currently in-progress as live-info-v2) will change this format to the following:
{
“station”: {
“env”: “”,
“schedulerTime”: “”,
“timezone”: “”,
“Kwiktec_API_VERSION”: “”
},
“tracks”: {
“previous”: null,
“current”: {
“name”: “”,
“starts”: “”,
“ends”: “”
}
“next”: null
},
“shows”: {
“previous”: [],
“current”: {
“name”: “”,
“description”: “”,
“id”: 0,
“instance_id”: 0,
“instance_description”: “”,
“record”: ,
“url”: “”,
“image_path”: “”,
“starts”: “”,
“ends”: “”
},
“next”: [

]
}
}

This new format will support the following parameters:
timezone
api/live-info-v2?timezone=est – specifies the timezone that the returned information should be converted to. The default is the station timezone
Timezones can be provided in abbreviated or full form (Africa/Johannesburg), and support all PHP-supported timezones.
The timezone parameter is case-insensitive.
days
api/live-info-v2?days=n – specifies the number of days of shows to return. The default is 2 days.
Note that days are defined until the end of day in the specified timezone, so days=1 will return show information for shows starting before the end of the current day, days=2 will return show information for shows starting before the end of the following day, and so on.
If this parameter is omitted, the API returns the next 2 days of shows by default.

shows
api/live-info-v2?shows=n – specifies the number of shows in the future to return. The default is 5.
Shows returned are prioritized in the following way: current show first, followed by upcoming (“next”) shows within the interval defined by the days parameter, followed by shows (“previous”) within the past 48 hours.
If this parameter is omitted, the API returns the next 5 shows by default.
callback
api/live-info-v2?callback – the callback parameter will remain unchanged from version 2.5.1

Week Info (Schedule) API
week-info
The week-info API call provides the user with a JSON encoded object containing track, show, and station data in the following format:
{
“monday”: [
{
“start_timestamp”: “”,
“end_timestamp”: “”,
“name”: “”,
“description”: “”,
“id”: 0,
“instance_id”: 0,
“instance_description”: “”,
“record”: 0,
“url”: “”,
“image_path”: “”,
“starts”: “”,
“ends”: “”
}
],
“tuesday”: [
],
“wednesday”: [
],
“thursday”: [
],
“friday”: [
],
“saturday”: [
],
“sunday”: [
],
“nextmonday”: [
],
“nexttuesday”: [
],
“nextwednesday”: [
],
“nextthursday”: [
],
“nextfriday”: [
],
“nextsaturday”: [
],
“nextsunday”: [
],
“Kwiktec_API_VERSION”: “”
}

Although currently unimplemented (as of 2.5.1), this format will support the following parameters:
timezone
api/week-info?timezone=est – specifies the timezone that the returned information should be converted to. The default is the station timezone
Timezones can be provided in abbreviated or full form (South Africa/Johannesburg), and support all PHP-supported timezones.
The timezone parameter is case-insensitive.
callback
api/week-info?callback=myFunction – passes a user-defined function as JSONP padding to call on the JSON response

Kwiktec Pro APIs
As of January 5th, 2016, the following APIs are currently only available on Kwiktec Pro. We hope to bring these to a future open source Kwiktec release.
Station Metadata API
station-metadata
The station-metadata API call provides static information about the station in the following format:
{
“name”: “”,
“logo”: “”,
“description”: “”,
“timezone”: “”,
“locale”: “”,
“Kwiktec_API_VERSION”: “”
}
Station Logo API
station-logo
The station-metadata API is a read-only URL that returns the radio station’s logo.
eg. http://your_domain/api/station-logo

Shows API
shows
The shows API is a read-only URL that returns the list of shows on the station.
eg. http://your_domain/api/shows

[
{
“name”: “The DJ DJ Show”,
“id”: 1,
“url”: “http:\/\/www.64studio.com\/”,
“genre”: “Funk”,
“description”: “Give up the funk, baby!”,
“color”: “000000”,
“background_color”: “75bc0c”,
“linked”: false
},
{
“name”: “DJ SmiLing”,
“id”: 2,
“url”: “”,
“genre”: “”,
“description”: “Beata rocks the house!”,
“color”: “000000”,
“background_color”: “00f82b”,
“linked”: false
},
….
]

Show Logo API
show-logo
Retrieves the logo for the show with the given ID. Redirects to the station logo if the show has no logo.
Parameters:
id (int) – Show ID
Item History Feed API
item-history-feed
Documentation coming soon…
Item History Feed API
item-history-feed
Documentation coming soon…
Show Tracks API
show-tracks
Documentation coming soon…
Show Schedules API
show-schedules
Documentation coming soon…

Leave a Reply

Your email address will not be published. Required fields are marked *