Embed multiple streams

I’m new to this API and I’m trying to figure out how I would embed the most viewed stream on my website. The url https://api.twitch.tv/kraken/streams?limit=1 comes up when I search google but if I input that into iFrame it does nothing. Am I missing code to display the most viewed in my window.

iframe src=“https://api.twitch.tv/kraken/streams?limit=1” frameborder=“0” name=“maintwitch” id=“maintwitch” scrolling=“no” height=“350” width=“400”>/iframe
I know im missing the <> didnt know if it would display the code in post.

Also is it possible to add the 2nd highest 3rd,4th and 5th top streams as href images, that target maintwitch frame.

You will have to parse the returned JSON. This can easiest be done with JQuery and there should be many tutorials on this. Basically you asynchronously request the above url, parse the JSON for the correct link and use this as the src in your iframe.

This is a better way of looking at a request I just made:

The url you want to end up with is http://twitch.tv/channel_name/embed

I have an example of what you are doing at http://isso.pro/twitchtest/

topStream.php - The live page
topStream.php.txt - The source.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.