Streams

class twitch.api.streams.Streams

This class provides methods for easy access to Twitch Streams API.

classmethod get_stream_by_user(channel_id, stream_type)

Gets stream information for a specified user.

Parameters:
  • channel_id (string) – ID of the channel you want to get information of
  • stream_type (string) – Constrains the type of streams returned. Default STREAM_TYPE_LIVE.
classmethod get_live_streams(channel, game, language, stream_type, limit, offset)

Gets a list of live streams.

Parameters:
  • channel (string) – Comma-separated list of channel IDs you want to get
  • game (string) – Game of the streams returned
  • language (string) – Constrains the language of the streams returned
  • stream_type (string) – Constrains the type of streams returned. Default STREAM_TYPE_LIVE.
  • limit (int) – Maximum number of objects to return. Default 25. Maximum 100.
  • offset (int) – Object offset for pagination of result. Default 0.
classmethod get_summary(game)

Gets a list of summaries of live streams.

Parameters:game (string) – Game of the streams returned

Gets a list of all featured live streams.

Parameters:
  • limit (int) – Maximum number of objects to return. Default 25. Maximum 100.
  • offset (int) – Object offset for pagination of result. Default 0.
classmethod get_followed(stream_type, limit, offset)

Gets a list of online streams a user is following, based on a specified OAuth token.

Parameters:
  • stream_type (string) – Constrains the type of streams returned. Default STREAM_TYPE_LIVE.
  • limit (int) – Maximum number of objects to return. Default 25. Maximum 100.
  • offset (int) – Object offset for pagination of result. Default 0.
>>> from twitch import TwitchClient
>>> client = TwitchClient('<my client id>', '<my oauth token>')
>>> followed = client.streams.get_followed()
classmethod get_streams_in_community(community_id)

Gets a list of streams in a community. (From Twitch forum Communities API Release)

Parameters:community_id (string) – Community ID
>>> from twitch import TwitchClient
>>> client = TwitchClient('<my client id>')
>>> streams = client.streams.get_streams_in_community('5181e78f-2280-42a6-873d-758e25a7c313')