Skip to content
twitch.apiv2.0

Reference / API groups

twitch.users

Users: profiles, block list and installed extensions.

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

twitch.users.get(params, options?): Promise<User[]>

Gets users by ID, by login name, or both. Users that do not exist are left out of the result.

Token: app or user.

NameTypeDescription
idstring | readonly string[]IDs of the users to get. Any number: long lists are split for you.
loginstring | readonly string[]Login names of the users to get. Any number: long lists are split for you.

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

Promise<User[]>

Fields of User
NameTypeDescription
idstringID of the user.
loginstringLogin name: lowercase, the one that appears in URLs.
display_namestringDisplay name, with the capitalisation the user chose.
type"" | "admin" | "global_mod" | "staff"Staff role on Twitch. An empty string for a regular user.
broadcaster_type"" | "affiliate" | "partner"Monetisation status. An empty string for a regular broadcaster.
descriptionstringChannel description written by the user.
profile_image_urlstringURL of the profile picture.
offline_image_urlstringURL of the image shown when the channel is offline.
view_countnumberDeprecated. Twitch no longer fills this field.
emailstringVerified email address. Only present when the call is made with a token of this user that has the user:read:email scope.
created_atstringWhen the account was created, as an RFC 3339 timestamp.
const users = await twitch.users.get({ login: ["twitchdev", "twitch"] });

Twitch reference

twitch.users.getById(id, options?): Promise<User | null>

Gets one user by ID, or null when there is no such user. Calls made in the same tick are merged into a single request.

Token: app or user.

id: string

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

Promise<User \| null>

Fields of User
NameTypeDescription
idstringID of the user.
loginstringLogin name: lowercase, the one that appears in URLs.
display_namestringDisplay name, with the capitalisation the user chose.
type"" | "admin" | "global_mod" | "staff"Staff role on Twitch. An empty string for a regular user.
broadcaster_type"" | "affiliate" | "partner"Monetisation status. An empty string for a regular broadcaster.
descriptionstringChannel description written by the user.
profile_image_urlstringURL of the profile picture.
offline_image_urlstringURL of the image shown when the channel is offline.
view_countnumberDeprecated. Twitch no longer fills this field.
emailstringVerified email address. Only present when the call is made with a token of this user that has the user:read:email scope.
created_atstringWhen the account was created, as an RFC 3339 timestamp.
const user = await twitch.users.getById("141981764");

Twitch reference

twitch.users.getByLogin(login, options?): Promise<User | null>

Gets one user by login name, or null when there is no such user. Calls made in the same tick are merged into a single request.

Token: app or user.

login: string

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

Promise<User \| null>

Fields of User
NameTypeDescription
idstringID of the user.
loginstringLogin name: lowercase, the one that appears in URLs.
display_namestringDisplay name, with the capitalisation the user chose.
type"" | "admin" | "global_mod" | "staff"Staff role on Twitch. An empty string for a regular user.
broadcaster_type"" | "affiliate" | "partner"Monetisation status. An empty string for a regular broadcaster.
descriptionstringChannel description written by the user.
profile_image_urlstringURL of the profile picture.
offline_image_urlstringURL of the image shown when the channel is offline.
view_countnumberDeprecated. Twitch no longer fills this field.
emailstringVerified email address. Only present when the call is made with a token of this user that has the user:read:email scope.
created_atstringWhen the account was created, as an RFC 3339 timestamp.
const user = await twitch.users.getByLogin("twitchdev");

Twitch reference

twitch.users.me(options?): Promise<User>

Gets the user who owns the token the call is made with. Includes email when the token has the user:read:email scope.

Token: user.

This method takes no parameters of its own.

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

Promise<User>

Fields of User
NameTypeDescription
idstringID of the user.
loginstringLogin name: lowercase, the one that appears in URLs.
display_namestringDisplay name, with the capitalisation the user chose.
type"" | "admin" | "global_mod" | "staff"Staff role on Twitch. An empty string for a regular user.
broadcaster_type"" | "affiliate" | "partner"Monetisation status. An empty string for a regular broadcaster.
descriptionstringChannel description written by the user.
profile_image_urlstringURL of the profile picture.
offline_image_urlstringURL of the image shown when the channel is offline.
view_countnumberDeprecated. Twitch no longer fills this field.
emailstringVerified email address. Only present when the call is made with a token of this user that has the user:read:email scope.
created_atstringWhen the account was created, as an RFC 3339 timestamp.
const me = await twitch.users.me();

Twitch reference

twitch.users.update(params, options?): Promise<User>

Updates the description of the user making the call.

Token: user, scope user:edit.

NameTypeDescription
descriptionstringNew channel description, 300 characters at most. An empty string removes it.

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

Promise<User>

Fields of User
NameTypeDescription
idstringID of the user.
loginstringLogin name: lowercase, the one that appears in URLs.
display_namestringDisplay name, with the capitalisation the user chose.
type"" | "admin" | "global_mod" | "staff"Staff role on Twitch. An empty string for a regular user.
broadcaster_type"" | "affiliate" | "partner"Monetisation status. An empty string for a regular broadcaster.
descriptionstringChannel description written by the user.
profile_image_urlstringURL of the profile picture.
offline_image_urlstringURL of the image shown when the channel is offline.
view_countnumberDeprecated. Twitch no longer fills this field.
emailstringVerified email address. Only present when the call is made with a token of this user that has the user:read:email scope.
created_atstringWhen the account was created, as an RFC 3339 timestamp.
await twitch.users.update({ description: "Live every evening." });

Twitch reference

twitch.users.authorization(params, options?): Promise<UserAuthorization[]>

Tells which scopes the given users granted to your application.

Token: app.

NameTypeDescription
user_id requiredstring | readonly string[]IDs of the users to check. Any number: long lists are split for you.

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

Promise<UserAuthorization[]>

Fields of UserAuthorization
NameTypeDescription
user_idstringID of the user.
user_namestringDisplay name of the user.
user_loginstringLogin name of the user.
scopesstring[]Every scope the user granted to your client ID.
has_authorizedbooleanWhether the user authorized your application at all.
const [auth] = await twitch.users.authorization({ user_id: "141981764" });

Twitch reference

twitch.users.blocks(params?, options?): Paginator<BlockedUser>

Lists the users a broadcaster has blocked, most recent first.

Token: user, scope user:read:blocked_users.

NameTypeDescription
broadcaster_idstringBroadcaster whose block list to read. Defaults to the user making the call.
firstnumberItems per page, 1 to 100. Twitch defaults to 20.
afterstringCursor of the page to fetch.

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

Paginator<BlockedUser>

Fields of BlockedUser
NameTypeDescription
user_idstringID of the blocked user.
user_loginstringLogin name of the blocked user.
display_namestringDisplay name of the blocked user.
for await (const blocked of twitch.users.blocks()) console.log(blocked.user_login);

Twitch reference

twitch.users.block(params, options?): Promise<void>

Blocks a user on behalf of the user making the call.

Token: user, scope user:manage:blocked_users.

NameTypeDescription
target_user_id requiredstringID of the user to block.
source_context"chat" | "whisper"Where the behaviour that motivates the block took place.
reason"harassment" | "spam" | "other"Why the user is being blocked.

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

Promise<void>

await twitch.users.block({ target_user_id: "198704263", reason: "spam" });

Twitch reference

twitch.users.unblock(params, options?): Promise<void>

Removes a block set by the user making the call.

Token: user, scope user:manage:blocked_users.

NameTypeDescription
target_user_id requiredstringID of the user to unblock.

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

Promise<void>

await twitch.users.unblock({ target_user_id: "198704263" });

Twitch reference

twitch.users.extensions(options?): Promise<UserExtension[]>

Lists the extensions installed by the user making the call. Inactive ones are only included with the user:edit:broadcast scope.

Token: user, scope user:read:broadcast or user:edit:broadcast.

This method takes no parameters of its own.

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

Promise<UserExtension[]>

Fields of UserExtension
NameTypeDescription
idstringID of the extension.
versionstringInstalled version.
namestringName of the extension.
can_activatebooleanWhether the extension is configured and ready to be activated.
typeExtensionType[]Slots this extension can be activated in.
const extensions = await twitch.users.extensions();

Twitch reference

twitch.users.activeExtensions(params?, options?): Promise<ActiveExtensions>

Gets the extensions a broadcaster has active in each slot.

Token: app or user.

NameTypeDescription
user_idstringBroadcaster to read. Optional with a user token, required with an app token.

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

Promise<ActiveExtensions>

Fields of ActiveExtensions
NameTypeDescription
panelRecord<string, ExtensionSlot>Panel extensions, shown under the video.
overlayRecord<string, ExtensionSlot>Overlay extensions, shown on top of the whole video.
componentRecord<string, ComponentExtensionSlot>Component extensions, shown on top of a part of the video.
const active = await twitch.users.activeExtensions({ user_id: "141981764" });
console.log(active.panel["1"]);

Twitch reference

twitch.users.updateExtensions(params, options?): Promise<ActiveExtensions>

Activates, deactivates or moves the extensions of the user making the call.

Token: user, scope user:edit:broadcast.

NameTypeDescription
data required{ panel?: Record<string, ExtensionSlot> | undefined; overlay?: Record<string, ExtensionSlot> | undefined; component?: Record<string, ComponentExtensionSlot> | undefined; }Slots to change, by kind then by slot number. Slots you leave out are untouched.

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

Promise<ActiveExtensions>

Fields of ActiveExtensions
NameTypeDescription
panelRecord<string, ExtensionSlot>Panel extensions, shown under the video.
overlayRecord<string, ExtensionSlot>Overlay extensions, shown on top of the whole video.
componentRecord<string, ComponentExtensionSlot>Component extensions, shown on top of a part of the video.
await twitch.users.updateExtensions({
data: { panel: { "1": { active: true, id: "rh6jq1q334hqc2rr1qlzqbvwlfl3x0", version: "1.1.0" } } },
});

Twitch reference