Getting now playing info in external site
  • Hello all,

    Is there a way to get information about the title currently playing using the json API?

    I want to display the name of the currently playing title in another website.


    P.S. Absolutely loving the product guys, fabulous work..

    Post edited by Fergal Moran at 2012-06-18 07:09:17
  • 9 Comments sorted by
  • Oi oi oi!

    here is what I use and it works perfectly:

    Currently this script has the following features:

    • Get the basic information of a given Icecast mount point
    • Server status: ON AIR or OFF AIR
    • Get extra information of the current song using‘s API:
    • Album art image in different size
    • Introduction and links of the current song, album and artist
    • Buy links on Amazon, iTunes and 7digital
    • Track list of the current album
    • Album list of the current artist
    • Cache album art images to local server
    • Get lyric of the current song using's API
    • Store all paly records to local history files for future using
    • Cache all the variables above to a local file, so no need to fetch API everytime the client send a request until the current song has changed. Fetching remote API too frequesntly will result in baning
    • Options to enable or disable certain feature(for cutting down the time the script need to process)
    • Auto refresh the now playing section(div) every several second in a HTML page

    I use it for my site:
    Listen to Ness Radio LIVE
  • "
    icecast only shows the name of the programme currently playing"

    That's not true. You have to open your Airtime admin and go System/Stream Settings and change the Stream Label fort Artist - Title.

    Have a look to my player and you will see what it does:
    Listen to Ness Radio LIVE
  • Hey Younes

    Thanks for that, it's not quite what I want though. I really need to get the track name from airtime rather than from icecast, as icecast only shows the name of the programme currently playing, not the actual track within the program. Also, I am using python, so a PHP script won't work for me.

    Really - what  I want is to be able to get the underlined text here - but using the api key, without having to authenticate.
  • Vote Up0Vote Down Albert FRAlbert FR
    Posts: 1,978Member, Airtime Moderator
    if you have changed you ls_script.liq : no really options...
    An icecast give you the same metadatas...
    anyway you can recode php into python ;)
  • Hi Albert

    Recoding the php into python isn't really an issue for me. It's just that this script doesn't give me the information I am looking for? Icecast only shows the station name, not the current track?

    Sorry, I'm a bit new to this, what do you mean by change ls_script.liq ? I haven't done anything to this file?

  • Aha! I didn't see that..
    Thanks Younes!!!
  • If anyone is interested, I've written a python script that will parse the data from an icecast stream and return it in a json array. You can find it here.

  • And here is another approach to getting that data too:
  • There is a liquidsoap way which is much easier,I am testing an Api now,will post it here.both how to push to an html, and json ( or xml)
    Post edited by Voisses Tech at 2014-02-21 07:42:50
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.