Appearance
GET API v1 Resources
GET nowplaying
Returns a collection of the most recent tracks played on the radiostation indicated by the station_id parameter.
Resource URL
https://api.theradiohub.com/1/GET/nowplaying.json
Parameters
Parameter | Required | Description |
---|---|---|
api_key | Required | The API key provided to the developer or created in the Radio Hub Admin-Dashboard |
station_id | Required | The ID of the radiostation for which to return results for. |
count | Optional, default = 100 | Specifies the number of tracks to try and retrieve, up to a maximum of 100. The value of count is best thought of as a limit to the number of tracks to return because the maximum available number of tracks in the database could be less. |
since_id | Optional | Returns results with an ID greater than (more recent than) the specified ID. |
user_id | Optional | The ID of the user currently viewing the application. If we detect that the user liked the returned track, the likedByUser value in the response-data will be 1 |
minimal_data | Optional, default = 0 | If set to 1, the returned track-objects will contain only the basic track information: 'trackid', 'artist', 'title', 'likes', 'playtime' |
Example Request
GET https://api.theradiohub.com/1/GET/nowplaying.json?api_key=[YOUR_API_KEY]&station_id=1&count=5
Example Callback
json
[{
"generated_at": 1371490821,
"status": "success",
"station_id": 1,
"station_name": "Hits Radio FM",
"developer_id": 24,
"count": 5,
"refresh_url": "https://api.theradiohub.com/1/GET/nowplaying.json?api_key=[YOUR_API_KEY]&station_id=1&count=5",
"next_results_url": "https://api.theradiohub.com/1/GET/nowplaying.json?api_key=[YOUR_API_KEY]&station_id=1since_id=85",
"since_id": 85,
"tracks": {
"0": [{
"id": 80,
"artist": 314,
"artistName": "Robbie Williams",
"title": "Candy",
"likes": 215,
"youtube_id": "gtOV7bp-gys",
"coverart_url": "http://25.media.tumblr.com/tumblr_mdukt9rJoI1rj7xj3o1_500.jpg",
"spotify_url": "https://play.spotify.com/track/6cskzfZWgrgd8hv74fHd9o",
"itunes_url": "https://itunes.apple.com/nl/album/candy-single/id558817147",
"playedtime": 1371490752,
"likedByUser": 0
}],
"1": [{ /* the same layout as above */ }],
"2": [{ /* the same layout as above */ }],
"3": [{ /* the same layout as above */ }],
"4": [{ /* the same layout as above */ }]
}
}]
GET dabimages
Returns all DAB/DRM images now available.
Resource URL
https://api.theradiohub.com/1/GET/dabimages.json
Parameters
Parameter | Required | Description |
---|---|---|
api_key | Required | The API key provided to the developer or created in the Radio Hub Admin-Dashboard |
station_id | Required | The ID of the radiostation for which to return results for. |
Example Request
GET https://api.theradiohub.com/1/GET/dabimages.json?api_key=[YOUR_API_KEY]&station_id=1
Example Callback
json
[{
"generated_at": 1371490821,
"status": "success",
"station_id": 1,
"station_name": "Hits Radio FM",
"developer_id": 24,
"count": 5,
"refresh_url": "https://api.theradiohub.com/1/GET/dabimages.json?api_key=[YOUR_API_KEY]&station_id=1",
"images": {
"0": [{
"name": "multi80",
"image": "[base64 encoded JPG image]",
"image_created": "1576069775", // creation time of this iteration of the multi80 image
"play_start": "1576069845", // start time of track displayed on this card, if present
"track": "Orphans", // title of track displayed on this card, if present
"artist": "Coldplay" // artist of track displayed on this card, if present
}],
"1": [{ /* the same layout as above */ }],
"2": [{ /* the same layout as above */ }],
"3": [{ /* the same layout as above */ }],
"4": [{ /* the same layout as above */ }]
},
"sequence": [ // desired sequence of display, as set in Manage Panel
"multi80",
"multi92",
"weather",
"traffic",
"nowplaying",
"multi92",
"weather",
"traffic",
"multi94"
],
"interval": 15 // desired interval in seconds, as set in Manage Panel
}]
GET commercials
Return next available commercial block.
Resource URL
https://api.theradiohub.com/1/GET/commercials.json
Parameters
Parameter | Required | Description |
---|---|---|
api_key | Required | The API key provided to the developer or created in the Radio Hub Admin-Dashboard |
station_id | Required | The ID of the radiostation for which to return results for. |
Example Request
GET https://api.theradiohub.com/1/GET/commercials.json?api_key=[YOUR_API_KEY]&station_id=1
Example Callback
json
[{
"generated_at": 1371490821,
"status": "success",
"station_id": 1,
"station_name": "Hits Radio FM",
"developer_id": 24,
"count": 5,
"refresh_url": "https://api.theradiohub.com/1/GET/commercials.json?api_key=[YOUR_API_KEY]&station_id=1",
"commercial_block_audio": "https://cdn.theradiohub.com/commercials/31232122_2242343.mp3",
"commercial_block_id": 2443
}]
GET hdradioimages
Returns a collection of HD Radio images now available.
Resource URL
https://api.theradiohub.com/1/GET/hdradioimages.json
Parameters
api_key (Required) The API key provided to the developer or created in the Radio Hub Admin-Dashboard
station_id (Required) The ID of the radiostation for which to return results for.
type (Required) Either 'nowplaying' for only now playing images or 'all' for all images
Example Request
GET https://api.theradiohub.com/1/GET/hdradioimages.json?api_key=[YOUR_API_KEY]&station_id=1
Example Callback
json
[{
"generated_at": 1371490821,
"status": "success",
"station_id": 1,
"station_name": "Hits Radio FM",
"developer_id": 24,
"count": 5,
"refresh_url": "https://api.theradiohub.com/1/GET/hdradioimages.json?api_key=[YOUR_API_KEY]&station_id=1",
"images": {
"0": [{
"name": 80,
"image": "[base64 encoded JPG image]"
}],
"1": [{ /* the same layout as above */ }],
"2": [{ /* the same layout as above */ }],
"3": [{ /* the same layout as above */ }],
"4": [{ /* the same layout as above */ }]
}
}]
GET tracks
Returns by default trackinfo for the first 100 tracks from a radiostations' database, sorted alphabetically. This method can only return up to 999 tracks and they can also be sorted based on the number of likes.
Resource URL
https://api.theradiohub.com/1/GET/tracks.json
Parameters
api_key (Required) The API key provided to the developer or created in the Radio Hub Admin-Dashboard
station_id (Required) The ID of the radiostation for which to return results for.
count (Optional, default = 100) Specifies the number of tracks to try and retrieve, up to a maximum of 999. The value of count is best thought of as a limit to the number of tracks to return because the maximum available number of tracks in the database could be less.
since_id (Optional) Returns results with an ID greater than (more recent than) the specified ID.
user_id (Optional) The ID of the user currently viewing the application. If we detect that the user liked the returned track, the likedByUser value in the response-data will be 1
sort (Optional, default = 'alphabetical_asc') Defines the sorting order of the tracks in the database before returning them. Tracks can be sorted by alphabet on the title. Values: 'alphabetical_asc', 'alphabetical_desc'
minimal_data (Optional, default = 0) If set to 1, the returned track-objects will contain only the basic track information: 'trackid', 'artist', 'title', 'likes', 'lastplayed'
search (Optional) Search parameter (minimal 2 characters)
tracks (Optional) Track-id list to get information from (comma separated). IDs need to be the external software IDs.
Example Request
GET https://api.theradiohub.com/1/GET/tracks.json?api_key=[YOUR_API_KEY]&station_id=1&count=5&sort=alphabet_asc
Example Callback
json
[{
"generated_at": 1371490821,
"status": "success",
"station_id": 1,
"station_name": "Hits Radio FM",
"developer_id": 24,
"count": 100,
"refresh_url": "https://api.theradiohub.com/1/GET/tracks.json?api_key=[YOUR_API_KEY]&station_id=1&count=5&sort=alphabet_asc",
"next_results_url": "https://api.theradiohub.com/1/GET/tracks.json?api_key=[YOUR_API_KEY]&station_id=1since_id=2439&sort=alphabet_asc",
"since_id": 2439,
"tracks": {
"0": [{
"id": 2439,
"artist": "Robbie Williams",
"artist_id": 314,
"title": "Candy",
"likes": 2115,
"youtube_id": "gtOV7bp-gys",
"coverart_url": "http://25.media.tumblr.com/tumblr_mdukt9rJoI1rj7xj3o1_500.jpg",
"spotify_url": "https://play.spotify.com/track/6cskzfZWgrgd8hv74fHd9o",
"itunes_url": "https://itunes.apple.com/nl/album/candy-single/id558817147",
"lastplayed": 1371490752,
"firstplayed": 137145165,
"likedByUser": 0
}],
"1": [{ /* the same layout as above */ }],
"2": [{ /* the same layout as above */ }],
"3": [{ /* the same layout as above */ }],
"4": [{ /* the same layout as above */ }]
/* etc */
}
}]
GET likes
Returns more detailed information about the people who liked a specific track on the radiostation indicated by the station_id parameter. This method can also tell if the user who liked the indicated track is a Facebook friend of the user indicated by the user_facebook_id parameter.
Resource URL
https://api.theradiohub.com/1/GET/likes.json
Parameters
api_key (Required) The API key provided to the developer or created in the Radio Hub Admin-Dashboard
station_id (Required) The ID of the radiostation for which to return results for.
track_id (Required) The ID of the track to get more like-information for.
user_id (Optional) The ID of the user currently viewing the application. If we detect that the user who liked a track is friends on Facebook with the current user, the friends-value will be returned as '1', else it will be '0'. If no ID is provided 'null' will be returned as value for the friends response-data.
likes_from (Optional) Returns likes with a timestamp greater than (more recent than) the specified timestamp. Useful if you want to display and count only this month's likes. Example Value:
1738100000
likes_to (Optional) Returns likes with a timestamp smaller than (older than) the specified timestamp. Useful if you want to limit the displaying of likes to a certain time and date. Example Value:
1738100000
Example Request
GET https://api.theradiohub.com/1/GET/likes.json?api_key=[YOUR_API_KEY]&station_id=1&track_id=2439&likes_from=1371478229
Example Callback
json
[{
"generated_at": 1371490821,
"status": "success",
"station_id": 1,
"station_name": "Hits Radio FM",
"developer_id": 24,
"count": 2115,
"refresh_url": "https://api.theradiohub.com/1/GET/likes.json?api_key=[YOUR_API_KEY]&station_id=1&count=5&track_id=2439&likes_from=1371478229",
"likes_from": 1371478229,
"likes_to": 1371490752,
"track_artist": "Robbie Williams",
"track_title": "Candy",
"track_id": 2439,
"likes": {
"0": [{
"facebook_id": 1445972521,
"name": "Duncan Krebbers",
"location": "Rotterdam, Netherlands",
"birthday": "28-03-1990",
"friends": null
}],
"1": [{ /* the same layout as above */ }],
"2": [{ /* the same layout as above */ }],
"3": [{ /* the same layout as above */ }],
"4": [{ /* the same layout as above */ }]
/* etc */
}
}]
GET charts
Returns the most played, most liked or newest tracks for the radiostation indicated by the station_id parameter. By adding the chart_from and chart_to parameters to the request it is possible to only retrieve tracks for a specific period.
Resource URL
https://api.theradiohub.com/1/GET/charts.json
Parameters
api_key (Required) The API key provided to the developer or created in the Radio Hub Admin-Dashboard
station_id (Required) The ID of the radiostation for which to return results for.
type (Required) The type of chart that will be returned. Values: 'most_played', 'most_liked', 'newest_tracks'
count (Optional, default = 50) Specifies the number of tracks to try and retrieve, up to a maximum of 999. The value of count is best thought of as a limit to the number of tracks to return because the maximum available number of tracks in the database could be less.
chart_from (Optional) Calculates chart-data based on plays, likes or first-play-date with a timestamp greater than (more recent than) the specified timestamp. Useful if you want to display and count only this month's charts. Example Value:
1738100000
chart_to (Optional) Calculates chart-data based on plays, likes or first-play-date with a timestamp smaller than (older than) the specified timestamp. Useful if you want to limit the displaying of charts to a certain time and date. Example Value:
1738100000
user_id (Optional) The ID of the user currently viewing the application. If we detect that the user liked the returned track, the likedByUser value in the response-data will be 1
minimal_data (Optional, default = 0) If set to 1, the returned track-objects will contain only the basic track information: 'trackid', 'artist', 'title', 'likes', 'lastplayed'
Example Request
GET https://api.theradiohub.com/1/GET/charts.json?api_key=[YOUR_API_KEY]&station_id=1&type=most_liked&count=40
Example Callback
json
[{
"generated_at": 1371490821,
"status": "success",
"station_id": 1,
"station_name": "Hits Radio FM",
"developer_id": 24,
"count": 40,
"refresh_url": "https://api.theradiohub.com/1/GET/charts.json?api_key=[YOUR_API_KEY]&station_id=1&type=most_liked&count=40",
"tracks": {
"0": [{
"id": 2439,
"artist": "Robbie Williams",
"artist_id": 314,
"title": "Candy",
"likes": 2115,
"youtube_id": "gtOV7bp-gys",
"coverart_url": "http://25.media.tumblr.com/tumblr_mdukt9rJoI1rj7xj3o1_500.jpg",
"spotify_url": "https://play.spotify.com/track/6cskzfZWgrgd8hv74fHd9o",
"itunes_url": "https://itunes.apple.com/nl/album/candy-single/id558817147",
"lastplayed": 1371490752,
"firstplayed": 137145165,
"likedByUser": 1
}],
"1": [{
"id": 2441,
"artist": "David Guetta",
"artist_id": 279,
"title": "She Wolf",
"likes": 1953,
"youtube_id": "PVzljDmoPVs",
"coverart_url": "http://deejay.de/pics/xl/9/2/106092.jpg",
"spotify_url": "https://play.spotify.com/track/56fwHfJaBpaauvFJrnwk2L",
"itunes_url": "https://itunes.apple.com/nl/album/she-wolf-falling-to-pieces/id591996323",
"lastplayed": 1371501253,
"firstplayed": 137122320,
"likedByUser": 0
}],
"2": [{ /* the same layout as above */ }],
"3": [{ /* the same layout as above */ }],
"4": [{ /* the same layout as above */ }]
/* etc */
}
}]
GET userlikes
Returns likes tracks for the user and radiostation indicated by the parameters.
Resource URL
https://api.theradiohub.com/1/GET/userlikes.json
Parameters
api_key (Required) The API key provided to the developer or created in the Radio Hub Admin-Dashboard
station_id (Required, optional if venue_id is given) The ID of the radiostation for which to return results for.
user_id (Optional) The ID of the user currently viewing the application. This can be either a Facebook user ID or a The Radio Hub user ID.
venue_id (Optional) The ID of the venue. This returns likes for all users checked in to this location in the last 24 hours.
minimal_data (Optional, default = 0) If set to 1, the returned track-objects will contain only the basic track information: 'trackid', 'artist', 'title', 'likes', 'lastplayed'
Example Request
GET https://api.theradiohub.com/1/GET/userlikes.json?api_key=[YOUR_API_KEY]&station_id=1&user_id=1
Example Callback
json
[{
"generated_at": 1371490821,
"status": "success",
"station_id": 1,
"station_name": "Hits Radio FM",
"developer_id": 24,
"count": 40,
"refresh_url": "https://api.theradiohub.com/1/GET/userlikes.json?api_key=[YOUR_API_KEY]&station_id=1&user_id=1",
"tracks": {
"0": [{
"id": 2439,
"artist": "Robbie Williams",
"artist_id": 314,
"title": "Candy",
"likes": 2115,
"youtube_id": "gtOV7bp-gys",
"coverart_url": "http://25.media.tumblr.com/tumblr_mdukt9rJoI1rj7xj3o1_500.jpg",
"spotify_url": "https://play.spotify.com/track/6cskzfZWgrgd8hv74fHd9o",
"itunes_url": "https://itunes.apple.com/nl/album/candy-single/id558817147",
"lastplayed": 1371490752,
"firstplayed": 137145165
}],
"1": [{
"id": 2441,
"artist": "David Guetta",
"artist_id": 279,
"title": "She Wolf",
"likes": 1953,
"youtube_id": "PVzljDmoPVs",
"coverart_url": "http://deejay.de/pics/xl/9/2/106092.jpg",
"spotify_url": "https://play.spotify.com/track/56fwHfJaBpaauvFJrnwk2L",
"itunes_url": "https://itunes.apple.com/nl/album/she-wolf-falling-to-pieces/id591996323",
"lastplayed": 1371501253,
"firstplayed": 137122320
}],
"2": [{ /* the same layout as above */ }],
"3": [{ /* the same layout as above */ }],
"4": [{ /* the same layout as above */ }]
/* etc */
}
}]
GET artist
Returns information about the artist indicated by the artist_id parameter. Information can contain newsitems, a photo, a link and/or a biography.
Resource URL
https://api.theradiohub.com/1/GET/artist.json
Parameters
api_key (Required) The API key provided to the developer or created in the Radio Hub Admin-Dashboard
artist_id (Required) The ID of the artist of which more information should be returned.
lang (Optional, default = en) The language of the requested artist information. If the information is not available in the language requested, the default language will be returned.
Example Request
GET https://api.theradiohub.com/1/GET/artist.json?api_key=[YOUR_API_KEY]&artist_id=279&lang=en
Example Callback
json
[{
"generated_at": 1371490821,
"status": "success",
"lang": "en",
"developer_id": 24,
"artist": {
"id": 279,
"name": "David Guetta",
"picture": "http://www.david-guetta.nl/images/david-guetta3.jpg",
"url": "http://www.davidguetta.com/",
"info": "As one of the most in demand producers on the planet, David Guetta is poised to take electronic music out of the confines of the global underground, where he reigns as the No. 1 House DJ. Joining hands and forces with some of the biggest names on the urban scene, while introducing some undiscovered talents, another level beckons. Already a multi-platinum selling artist in Europe, with three chart-topping albums to his name to date (Just a Little More Love 2002; Guetta Blaster, 2004; Pop Life, 2007), his signature sound of quirky, electro, house and dirty pop, is igniting across the rest of the world, where it was kept a club-land secret. Until now. EMI Music will release Guetta’s much-awaited 4th album late August. It features guest vocals from Kelly Rowland, Will.I.Am, Novel and long time hit-maker Chris Willis, of course. Plus there are others too hot to mention yet. Guetta has also produced the forthcoming single by the Black Eyed Peas “I Got A Feeling”."
}
}]
GET station
Returns information and settings from the station in The Radio Hub. Information like, genre, country, Facebook ID, streamlinks, color-settings and custom text-strings will be returned.
Resource URL
https://api.theradiohub.com/1/GET/station.json
Parameters
api_key (Required) The API key provided to the developer or created in the Radio Hub Admin-Dashboard
station_id (Required) The ID of the radiostation for which to return results for.
lat|lng (Optional) Display radiostations in a certain area
range (Optional, only in combination with lat|lng) Display radiostations in a certain max range in km from the given lat/lng. Default: 50
order (Optional, only in combination with lat|lng) Order area stations by 'distance' or 'popularity'. Default: distance
Example Request (in area)
GET https://api.theradiohub.com/1/GET/station.json?api_key=[YOUR_API_KEY]&lat=59.4116233&lng=5.2705069&range=10
Example Callback (in area)
json
[{
"generated_at": 1371490821,
"status": "success",
"developer_id": 24,
"stations": [
{
"station_id": "53",
"station_name": "Radio Haugaland",
...
},
{
"station_id": "64",
"station_name": "Haugaland Gull",
...
},
{
"station_id": "77",
"station_name": "Haugaland Hits",
...
}
]
}]
Example Request
GET https://api.theradiohub.com/1/GET/station.json?api_key=[YOUR_API_KEY]&station_id=32
Example Callback
json
[{
"generated_at": 1371490821,
"status": "success",
"station_id": 32,
"station_name": "Hitradio World",
"refresh_url": "https://api.theradiohub.com/1/GET/station.json?api_key=[YOUR_API_KEY]&station_id=32",
"developer_id": 24,
"station": {
"facebook_id": 279,
"lang": "nl",
"genre": "Dance",
"software_type": "Dalet",
"streamlink_hq": "",
"streamlink_lq": "",
"streamlink_backup": "",
"streamlink_rss": "",
"weather_unit": "c",
"newsfeed_url": "",
"color1": {},
"color2": {}
}
}]
GET dns
Returns Digital Broadcast DNS (DBDNS) connection/receiver information for a certain radio station or a range of stations. Either a station ID or a location is required.
Resource URL
https://api.theradiohub.com/1/GET/dns.json
Parameters
station_id (Optional) Radio station ID
location (Optional) Country or city (eg. US, Norway or Paris)
Example Request
GET https://api.theradiohub.com/1/GET/dns.json?station_id=53
Example Callback
json
[{
"generated_at": 1371490821,
"status": "success",
"stations": {
"0": [{
"id": "53",
"name": "HitRadio",
"country": "Norway",
"city": "Oslo",
"lang": "nl",
"genre": "Dance",
"streamlink_hq": "",
"streamlink_lq": "",
"streamlink_backup": "",
"ecc": "",
"eid": "",
"sid": "",
"scids": "",
"rds_pi": ""
}]
}
}]
GET news
Get the radiostation's news messages.
Resource URL
https://api.theradiohub.com/1/GET/news.json
Parameters
api_key (Required) The API key provided to the developer or created in the Radio Hub Admin-Dashboard
station_id (Required) The ID of the radiostation for which to return results for.
mobile_only (Optional, true or false, default = false) Retrieve only mobile news, specifically for mobile apps
rss (Optional, 1 or 0, default = 0) Retrieve RSS items also
count (Optional, default = 5) Specifies the number of stories to try and retrieve, up to a maximum of 999. The value of count is best thought of as a limit to the number of stories to return because the maximum available number of stories in the database could be less.
Example Request
GET https://api.theradiohub.com/1/GET/news.json?api_key=[YOUR_API_KEY]&station_id=32
Example Callback
json
[{
"generated_at": 1371490821,
"status": "success",
"station_id": 1,
"station_name": "Hits Radio FM",
"developer_id": 24,
"count": 40,
"refresh_url": "https://api.theradiohub.com/1/GET/news.json?api_key=[YOUR_API_KEY]&station_id=32",
"stories": {
"0": [{
"id": 2439,
"title": "This story happened",
"url": "http://newsstoryurl.com/",
"text": "Fusce diam leo, placerat ut rut ....",
"image": "http://www.consciouslyenlightened.com/wp-content/uploads/2015/03/breaking-news-3.jpg",
"channels": "WEB,DRM"
}],
"1": [{
"id": 2441,
"title": "This story happened",
"url": "http://newsstoryurl.com/",
"text": "Fusce diam leo, placerat ut rut ....",
"image": "http://www.consciouslyenlightened.com/wp-content/uploads/2015/03/breaking-news-3.jpg",
"channels": "WEB,DRM,DAB"
}],
"2": [{ /* the same layout as above */ }],
"3": [{ /* the same layout as above */ }],
"4": [{ /* the same layout as above */ }]
/* etc */
}
}]
GET epg
Get the radiostation's programming for today.
Resource URL
https://api.theradiohub.com/1/GET/epg.json
Parameters
api_key (Required) The API key provided to the developer or created in the Radio Hub Admin-Dashboard
station_id (Required) The ID of the radiostation for which to return results for.
count (Optional, default = 5) Specifies the number of programs to try and retrieve, up to a maximum of 999. The value of count is best thought of as a limit to the number of stories to return because the maximum available number of programs in the database could be less.
Example Request
GET https://api.theradiohub.com/1/GET/epg.json?api_key=[YOUR_API_KEY]&station_id=32
Example Callback
json
[{
"generated_at": 1371490821,
"status": "success",
"station_id": 1,
"station_name": "Hits Radio FM",
"developer_id": 24,
"count": 40,
"refresh_url": "https://api.theradiohub.com/1/GET/epg.json?api_key=[YOUR_API_KEY]&station_id=32",
"programs": {
"2016-03-22T00:00:00": {
"id": "683",
"name": "Program 1",
"day": "tue",
"starttime": "00:00",
"endtime": "03:00",
"image": "53_1440413005_program1.jpg",
"hdradio_image": "",
"dj": "DJ",
"radiostation": "32"
},
"2016-03-22T03:00:00": {
"id": "426",
"name": "Program 2",
"day": "tue",
"starttime": "03:00",
"endtime": "05:00",
"image": "53_1402220745_default.jpg",
"hdradio_image": "",
"dj": "DJ",
"radiostation": "32"
},
"2016-03-22T06:00:00": [{ /* the same layout as above */ }]
/* etc */
}
}]
GET stores
Get the radiostation's stores and deals.
Resource URL
https://api.theradiohub.com/1/GET/stores.json
Parameters
api_key (Required) The API key provided to the developer or created in the Radio Hub Admin-Dashboard
station_id (Required) The ID of the radiostation for which to return results for.
count (Optional, default = 5) Specifies the number of stories to try and retrieve, up to a maximum of 999. The value of count is best thought of as a limit to the number of stories to return because the maximum available number of stories in the database could be less.
Example Request
GET https://api.theradiohub.com/1/GET/stores.json?api_key=[YOUR_API_KEY]&station_id=32
Example Callback
json
[{
"generated_at": 1371490821,
"status": "success",
"station_id": 1,
"station_name": "Hits Radio FM",
"developer_id": 24,
"count": 40,
"refresh_url": "https://api.theradiohub.com/1/GET/stores.json?api_key=[YOUR_API_KEY]&station_id=32",
"stores": {
"0": [{
"id": 2439,
"name": "Sample Store",
"deals": {
"0": [{
"id": 334,
"name": "Deal Name"
}]
}
}],
"1": [{ /* the same layout as above */ }],
"2": [{ /* the same layout as above */ }],
"3": [{ /* the same layout as above */ }]
/* etc */
}
}]
GET locations
Get nearby locations.
Resource URL
https://api.theradiohub.com/1/GET/locations.json
Parameters
api_key (Required) The API key provided to the developer or created in the Radio Hub Admin-Dashboard
lat (Optional) Latitude (eg. 52.449223)
lng (Optional) Longitude (eg. 6.449223)
Example Request
GET https://api.theradiohub.com/1/GET/locations.json?api_key=[YOUR_API_KEY]&lat=52.44922&lng=6.449223
Example Callback
json
[{
"generated_at": 1371490821,
"status": "success",
"developer_id": 24,
"count": 40,
"refresh_url": "https://api.theradiohub.com/1/GET/locations.json?api_key=[YOUR_API_KEY]&lat=52.44922&lng=6.449223",
"locations": {
"0": [{
"id": 2439,
"name": "Sample Location",
"address": "Streetname 123, City",
"lat": "52.335",
"lng": "6.2000"
}],
"1": [{ /* the same layout as above */ }],
"2": [{ /* the same layout as above */ }],
"3": [{ /* the same layout as above */ }]
/* etc */
}
}]
GET login
Returns either true or false for a radiostation's login data.
Resource URL
https://api.theradiohub.com/1/GET/login.json
Parameters
user_email (Required) User's e-mail address.
user_pass (Required) User's password.
Example Request
GET https://api.theradiohub.com/1/GET/login.json?user_email=[USER_EMAIL]user_pass=[USER_PASS]
Example Callback
json
[{
"generated_at": 1371490821,
"status": "success",
"login": {
"login_correct": true
}
}]
GET userlogin
Returns either true or false for a user's login data.
Resource URL
https://api.theradiohub.com/1/GET/userlogin.json
Parameters
user_email (Required) User's e-mail address.
user_pass (Required) User's password.
Example Request
GET https://api.theradiohub.com/1/GET/userlogin.json?user_email=[USER_EMAIL]user_pass=[USER_PASS]
Example Callback
json
[{
"generated_at": 1371490821,
"status": "success",
"login": {
"login_correct": true,
"user_id": 34
}
}]
GET license
Returns either true or false for a user's API key and license type.
Resource URL
https://api.theradiohub.com/1/GET/license.json
Parameters
station_id (Required) User's station id.
api_key (Required) User's api key.
type (Required) License type (i.e. 'dab').
Example Request
GET https://api.theradiohub.com/1/GET/license.json?station_id=[STATION_id]&api_key=[API_KEY]&type=[LICENSE_TYPE]
Example Callback
json
[{
"generated_at": 1371490821,
"status": "success",
"dab_license": true
}]
GET weather
Information about how to get accurate weather data for the location of the current user or the radiostation.
Disclaimer
We do not handle weather-queries ourself. This API specification is just to help you receive weather data in the same way we do, but there are many other ways to do this. For receiving weather data, we make use of the Yahoo Weather API. We are in no ways responsible for the outcome or errors of your requests to this API. This is just to get you started!
API information
The Yahoo Weather API needs to be called twice: once in order to receive a "woeid". This is the Yahoo ID of the location you've requested. When you have a woeid, you can create actual weather requests. The woeid can be saved and stays the same forever for each individual location. So this call needs to be made only once per location. The official documentation for the API can be found at the More information about the callback result can be found on the Yahoo Weather API Documentation.
WOEID Retrieval
Parameters
locationname (Required) The city and optional the country name for which weather data will be retrieved. urlencode this value before inserting it into the string.
Request url Replace [locationname] in the url, leave the quotes in place.
http://query.yahooapis.com/v1/public/yql?q=select*from%20geo.places%20where%20text="[locationname]"&format=json
Example Request
GET http://query.yahooapis.com/v1/public/yql?q=select*from%20geo.places%20where%20text="Rotterdam"&format=json
Callback Handling
You will receive one or a couple of matched places in a json-callback. From this data you will need to extract the woeid. Be sure to check if the returned location is the same as the one you've requested. The woeid and name of the returned location can be found in the following order. If the name of the result doesn't match the requested location, itterate through all returned results to find a match. Woeid: "callback" -> "results" -> "0" -> "woeid" Name: "callback" -> "results" -> "0" -> "name".
Weather Retrieval
Parameters
woeid (Required) The woeid as retrieved in the first section of this topic.
Request url Replace [woeid] in the url, leave the quotes in place.
http://query.yahooapis.com/v1/public/yql?q=select%20item%20from%20weather.forecast%20where%20woeid%3D"[woeid]"&format=json
Example Request
GET http://query.yahooapis.com/v1/public/yql?q=select%20item%20from%20weather.forecast%20where%20woeid%3D%222346383%22&format=json
Callback Handling
You will receive a json-object containing the weather-data for your specified location. More information about the callback result can be found on the Yahoo Weather Developer page.
Temperature conversion
By default Yahoo Weather will return temperatures in Fahrenheit. You can add extra parameters to the query to retreive data in Celsius, but you can also choose to convert temperatures to Celcius on your own server. For converting Fahrenheit to Celcius you will need to make this calculation: ([Temperature in Fahrenheit] - 32) * 1.8