Skip to content
twitch.apiv2.0

Reference / API groups

twitch.search

Search for categories and channels.

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

twitch.search.categories(params, options?): Paginator<CategorySearchResult>

Finds the categories whose name contains every word of the query, in any order and whatever the case.

Token: app or user.

NameTypeDescription
query requiredstringText to look for. Pass it as is, it is URL encoded for you.
firstnumberItems per page, 1 to 100. Twitch defaults to 20.
afterstringCursor of the next page.

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

Paginator<CategorySearchResult>

Fields of CategorySearchResult
NameTypeDescription
idstringID of the category.
namestringName of the category.
box_art_urlstringURL of the box art.
const categories = await twitch.search.categories({ query: "fort" }).take(5);

Twitch reference

twitch.search.channels(params, options?): Paginator<ChannelSearchResult>

Finds channels that streamed in the last six months. The query is matched against the start of the login name, or with live_only against the start of the broadcaster’s name and of the category name.

Token: app or user.

NameTypeDescription
query requiredstringText to look for. Pass it as is, it is URL encoded for you.
live_onlybooleantrue to keep only channels that are live. Twitch defaults to false.
firstnumberItems per page, 1 to 100. Twitch defaults to 20.
afterstringCursor of the next page.

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

Paginator<ChannelSearchResult>

Fields of ChannelSearchResult
NameTypeDescription
broadcaster_languagestringLanguage of the broadcaster: an ISO 639-1 code, or "other".
broadcaster_loginstringLogin name of the broadcaster.
display_namestringDisplay name of the broadcaster.
game_idstringID of the category being streamed, or of the last one that was.
game_namestringName of the category being streamed, or of the last one that was.
idstringID of the broadcaster.
is_livebooleanWhether the channel is live right now.
tag_idsstring[]Deprecated. Always empty. Use tags.
tagsstring[]Tags applied to the channel.
thumbnail_urlstringURL of the broadcaster’s profile picture.
titlestringTitle of the stream. An empty string when none is set.
started_atstringWhen the stream started, as an RFC 3339 timestamp. An empty string when the channel is offline.
for await (const channel of twitch.search.channels({ query: "speedrun", live_only: true })) {
console.log(channel.display_name, channel.title);
}

Twitch reference