Skip to content
twitch.apiv2.0

Reference / API groups

twitch.channels

Channels: title, category and tags, editors, follows and followers.

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

twitch.channels.get(params, options?): Promise<ChannelInformation[]>

Gets the title, category, language and tags of one or more channels. Channels that do not exist are left out of the result.

Token: app or user.

NameTypeDescription
broadcaster_id requiredstring | readonly string[]IDs of the broadcasters to get. Any number: long lists are split for you.

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

Promise<ChannelInformation[]>

Fields of ChannelInformation
NameTypeDescription
broadcaster_idstringID of the broadcaster.
broadcaster_loginstringLogin name of the broadcaster.
broadcaster_namestringDisplay name of the broadcaster.
broadcaster_languagestringLanguage of the channel: an ISO 639-1 code, or "other".
game_namestringName of the current or last category. An empty string when the channel never had one.
game_idstringID of the current or last category. An empty string when the channel never had one.
titlestringTitle of the current or last stream. An empty string when the channel never streamed.
delaynumberStream delay in seconds. Stays at 0 unless the call is made with the token of this broadcaster, who must be a partner with a delay set.
tagsstring[]Tags applied to the channel.
content_classification_labelsstring[]IDs of the content classification labels applied to the channel.
is_branded_contentbooleanWhether the channel is flagged as showing branded content.
const [channel] = await twitch.channels.get({ broadcaster_id: "141981764" });
console.log(channel?.title, channel?.game_name);

Twitch reference

twitch.channels.update(params?, options?): Promise<void>

Changes the title, category, language, tags, delay or content labels of a channel. Only the fields you set are touched.

Token: user, scope channel:manage:broadcast.

NameTypeDescription
broadcaster_idstringBroadcaster whose channel to update. Defaults to the user making the call.
game_idstringID of the category to set. "0" or an empty string clears it.
broadcaster_languagestringLanguage of the channel: an ISO 639-1 code, or "other".
titlestringStream title, 140 characters at most. Cannot be empty.
delaynumberStream delay in seconds, 900 at most. Partners only.
tagsreadonly string[]Tags to apply, replacing the current ones. Up to 10, each 25 characters at most, without spaces or special characters. An empty array removes them all.
content_classification_labelsreadonly ChannelContentLabel[]Labels to switch on or off. Labels you leave out keep their current state.
is_branded_contentbooleanWhether the channel shows branded content.

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

Promise<void>

await twitch.channels.update({ title: "Speedrun practice", game_id: "33214", tags: ["Speedrun"] });

Twitch reference

twitch.channels.editors(params?, options?): Promise<ChannelEditor[]>

Lists the editors of a channel.

Token: user, scope channel:read:editors.

NameTypeDescription
broadcaster_idstringBroadcaster who owns the channel. Defaults to the user making the call.

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

Promise<ChannelEditor[]>

Fields of ChannelEditor
NameTypeDescription
user_idstringID of the editor.
user_namestringDisplay name of the editor.
created_atstringWhen the user was made an editor, as an RFC 3339 timestamp.
const editors = await twitch.channels.editors();

Twitch reference

twitch.channels.followed(params?, options?): Paginator<FollowedChannel>

Lists the channels a user follows, most recent follow first. With broadcaster_id it tells whether the user follows that one channel.

Token: user, scope user:read:follows.

NameTypeDescription
user_idstringUser whose follows to list. Defaults to the user making the call.
broadcaster_idstringOnly this broadcaster: the list holds one item when the user follows them, none otherwise.
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<FollowedChannel>

Fields of FollowedChannel
NameTypeDescription
broadcaster_idstringID of the followed broadcaster.
broadcaster_loginstringLogin name of the followed broadcaster.
broadcaster_namestringDisplay name of the followed broadcaster.
followed_atstringWhen the user started following, as an RFC 3339 timestamp.
for await (const follow of twitch.channels.followed()) console.log(follow.broadcaster_name);
const count = await twitch.channels.followed().total();
const follows = (await twitch.channels.followed({ broadcaster_id: "141981764" })).data.length > 0;

Twitch reference

twitch.channels.followers(params, options?): Paginator<ChannelFollower>

Lists the followers of a channel, most recent first. The list itself is only returned to the broadcaster or one of their moderators, with the moderator:read:followers scope. Any other token gets an empty list but still gets the follower count, which is what total() reads. With user_id it tells whether that one user follows the channel.

Token: app or user. Scope moderator:read:followers to get the list.

NameTypeDescription
broadcaster_id requiredstringBroadcaster whose followers to list.
user_idstringOnly this user: the list holds one item when they follow the broadcaster, none otherwise.
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<ChannelFollower>

Fields of ChannelFollower
NameTypeDescription
user_idstringID of the follower.
user_loginstringLogin name of the follower.
user_namestringDisplay name of the follower.
followed_atstringWhen the user started following, as an RFC 3339 timestamp.
const latest = await twitch.channels.followers({ broadcaster_id: "141981764" }).take(10);
const count = await twitch.channels.followers({ broadcaster_id: "141981764" }).total();

Twitch reference