Skip to content
twitch.apiv2.0

Reference / API groups

twitch.games

Games and categories: look them up, list the most watched.

Every method of twitch.games, with its parameters, what it returns and the token it needs.

twitch.games.top(params?, options?): Paginator<Game>

Lists the categories with the most viewers right now, most watched first.

Token: app or user.

NameTypeDescription
firstnumberItems per page, 1 to 100. Twitch defaults to 20.
afterstringCursor of the next page.
beforestringCursor of the previous page.

options: Request options for this call: as, token, signal, timeout, retries.

Paginator<Game>

Fields of Game
NameTypeDescription
idstringID of the category.
namestringName of the category.
box_art_urlstringURL of the box art. Replace &#123;width} and &#123;height} with the size you want, in pixels.
igdb_idstringID of the game on IGDB. An empty string when Twitch does not know it.
const top = await twitch.games.top().take(10);

Twitch reference

twitch.games.get(params, options?): Promise<Game[]>

Gets categories by ID, by exact name, by IGDB ID, or any mix of them. Categories that do not exist are left out of the result.

Token: app or user.

NameTypeDescription
idstring | readonly string[]IDs of the categories to get. Any number: long lists are split for you.
namestring | readonly string[]Exact names of the categories to get. Any number: long lists are split for you.
igdb_idstring | readonly string[]IGDB IDs of the games to get. Any number: long lists are split for you.

options: Request options for this call: as, token, signal, timeout, retries.

Promise<Game[]>

Fields of Game
NameTypeDescription
idstringID of the category.
namestringName of the category.
box_art_urlstringURL of the box art. Replace &#123;width} and &#123;height} with the size you want, in pixels.
igdb_idstringID of the game on IGDB. An empty string when Twitch does not know it.
const [game] = await twitch.games.get({ name: "Fortnite" });
const games = await twitch.games.get({ id: ["33214", "509658"] });

Twitch reference