Table of Contents
Here’s some way to get Shoutcast station list.
Attention
The way to get station list written in here is the ways I detected from Shoutcast.com javascript code. So it is not supported by Shoutcast.com, I think.
Station Format
First, let’s confirm station data structure. Response from Shoutcast is in the following JSON format.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
[ { "ID" : 1234567, "Name" : "XYZ STATION", "Format" : "audio/aacp", "Bitrate" : 48, "Genre" : "Punk", "CurrentTrack" : "Over My Shoulder", "Listeners" : 3, "IsRadionomy" : false, "IceUrl" : null, "IsPlaying" : false } ] |
There are 10 attributes. The most important attribute is “ID”. The station url can be generated in the following format.
1 |
'http://yp.shoutcast.com/sbin/tunein-station.pls?id=' + stationId |
“IsPlaying” attribute shows whether we can hear it now. Yes, of course it is important.
Get Station List in a Genre
You can get station list of a specific genre by http post request as follows.
1 |
curl -F "genrename=GENRENAME" http://www.shoutcast.com/Home/BrowseByGenre |
Send post request to shoutcast with the following parameter.
- genrename
Search Stations by Keyword
1 |
curl -F "query=KEYWORD" http://www.shoutcast.com/Search/UpdateSearch |
Send post request to shoutcast with the following parameter.
- query
Search Stations by Detailed Condition
1 |
curl -F "genre=GENRE" -F "station=STATION" -F "type=TYPE" -F "artist=ARTIST" -F "song=SONG" http://www.shoutcast.com/Search/UpdateAdvancedSearch |
Send request to shoutcast with the following parameters.
- genre
- station
- type
- artist
- song
If you don’t use some parameter, set the parameter empty, like -F "genre="
.
The above request examples use http url, but https url also works.