Is There Any Way To Check if a Twitch Stream Is Live Using Python?

It looks like Twitch provides an API (documentation here) that provides a way to get that info. A very simple example of getting the feed would be:

import urllib2

url = 'http://api.justin.tv/api/stream/list.json?channel=FollowGrubby'
contents = urllib2.urlopen(url)

print contents.read()

This will dump all of the info, which you can then parse with a JSON library (XML looks to be available too). Looks like the value returns empty if the stream isn’t live (haven’t tested this much at all, nor have I read anything 🙂 ). Hope this helps!

Leave a Comment