Get a random channel

Is there any way to get a random channel? I’m after making an app that relies heavily on being able to get a random channel from the entire set of currrent live broadcasters.

Off the top of my head I suppose you could do this by running a query of:

https://api.twitch.tv/kraken/streams?limit=1&offset=%RAND

and setting %RAND to be a randomly generated number between 0 and ‘x’ (Say maybe 100?) to grab 1 of the top 100 streams at random.

or between 0 and all the live channels:

http://api.twitch.tv/kraken/streams/summary

(Which I only assume that channels signifies)

EDIT:
If anyone of us had searched the forums before posting, it’s already been implemented: Get Random Game Stream List from API

so you would hit
https://api.twitch.tv/kraken/beta/streams/random?limit=1&offset=0

1 Like

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