TwitchGamesRequests

Inherits: TwitchRequestBase < RefCounted < Object

Twitch Games API for game information and top games.

Description

TwitchGamesRequests provides methods for retrieving game information and discovering top games by viewer count. No special OAuth scopes required. Access through TwitchAPI.get_games().

Tutorials

Methods

void

get_games(params: Dictionary)

void

get_top_games(params: Dictionary = {})


Method Descriptions

void get_games(params: Dictionary) 🔗

Gets information about specified games. params must include id, name, or igdb_id. Results are returned via the TwitchAPI.request_completed signal with signal_name "games_received".

Response includes: Array of games with id, name, box_art_url (template with {width}x{height}), igdb_id.

var params = {"name": ["Just Chatting", "Minecraft"]}
TwitchAPI.get_games().get_games(params)
# Response: {"data": [{"id": "509658", "name": "Just Chatting", "box_art_url": "https://static-cdn.jtvnw.net/ttv-boxart/509658-{width}x{height}.jpg", "igdb_id": ""}]}

void get_top_games(params: Dictionary = {}) 🔗

Gets games sorted by number of current viewers on Twitch. Optional params can include first, before, and after for pagination. Results are returned via the TwitchAPI.request_completed signal with signal_name "top_games_received".

Response includes: Array of games with id, name, box_art_url, igdb_id.

TwitchAPI.get_games().get_top_games({"first": 10})
# Response: {"data": [{"id": "509658", "name": "Just Chatting", "box_art_url": "https://static-cdn.jtvnw.net/ttv-boxart/509658-{width}x{height}.jpg"}]}