Skip to content

Models

UserIdentity

Bases: NamedTuple

Represents a user's identity information.

Attributes:

Name Type Description
id str

Unique identifier for the user.

login str

User's login name.

name str

User's display name.


Amount

Bases: NamedTuple

Represents a monetary amount.

Attributes:

Name Type Description
value int

The monetary amount. The amount is specified in the currency's minor unit.

decimal_places int

The number of decimal places used by the currency.

currency str

The ISO-4217 three-letter currency code that identifies the type of currency in value.


ChannelInfo

Bases: NamedTuple

Represents a channel's information.

Attributes:

Name Type Description
identity UserIdentity

The broadcaster's information.

broadcaster_language str

The broadcaster's preferred language. The value is an ISO 639-1 two-letter language code (for example, 'en' for English). The value is set to "other" if the language is not a Twitch supported language.

game_name str

The name of the game that the broadcaster is playing or last played. The value is an empty string if the broadcaster has never played a game.

category_id str

An ID that uniquely identifies the game that the broadcaster is playing or last played. The value is an empty string if the broadcaster has never played a game.

title str

The title of the stream that the broadcaster is currently streaming or last streamed. The value is an empty string if the broadcaster has never streamed.

delay int

The value of the broadcaster's stream delay setting, in seconds. This field's value defaults to zero unless 1) the request specifies a user access token, 2) the ID in the broadcaster_id query parameter matches the user ID in the access token, and 3) the broadcaster has partner status, and they set a non-zero stream delay value.

tags Tuple[str, ...]

The tags applied to the channel.

content_classification_labels Tuple[str, ...]

The CCLs applied to the channel.

is_branded_content bool

Boolean flag indicating if the channel has branded content.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


StreamInfo

Bases: NamedTuple

Represents a Twitch stream.

Attributes:

Name Type Description
identity UserIdentity

The broadcaster's identity information including id, login, and display name.

category Category

The category/game information that the broadcaster is streaming.

type str

The type of stream. Possible values are: live. If an error occurs, this field is set to an empty string.

title str

The stream's title. Is an empty string if not set.

tags Tuple[str, ...]

The tags applied to the stream.

viewer_count int

The number of users watching the stream.

started_at Optional[datetime]

The UTC datetime of when the broadcast began.

language str

The language that the stream uses. This is an ISO 639-1 two-letter language code or "other" if the stream uses a language not in the list of supported stream languages.

thumbnail_url str

A URL to an image of a frame from the last 5 minutes of the stream. Replace the width and height placeholders in the URL ({width}x{height}) with the size of the image you want, in pixels.

is_mature bool

A Boolean value that indicates whether the stream is meant for mature audiences.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


StreamKey

Bases: NamedTuple

Represents a stream key.

Attributes:

Name Type Description
stream_key str

The stream key.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


ChannelStreamSchedule

Bases: NamedTuple

Represents a broadcaster's streaming schedule.

Attributes:

Name Type Description
segments Tuple[ScheduleSegment, ...]

The tuple of broadcasts in the broadcaster's streaming schedule.

identity UserIdentity

The broadcaster's identity information including id, login, and display name.

vacation Optional[ScheduleVacation]

The dates when the broadcaster is on vacation and not streaming.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


ScheduleSegment

Bases: NamedTuple

Represents a broadcast segment in a streaming schedule.

Attributes:

Name Type Description
id str

An ID that identifies this broadcast segment.

start_time datetime

The UTC date and time of when the broadcast starts.

end_time datetime

The UTC date and time of when the broadcast ends.

title str

The broadcast segment's title.

canceled_until Optional[datetime]

Indicates whether the broadcaster canceled this segment. Set to end_time if canceled, null otherwise.

category Optional[ScheduleCategory]

The type of content that the broadcaster plans to stream.

is_recurring bool

Whether the broadcast is part of a recurring series.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


ScheduleVacation

Bases: NamedTuple

Represents vacation dates when the broadcaster is not streaming.

Attributes:

Name Type Description
start_time datetime

The UTC date and time of when the vacation starts.

end_time datetime

The UTC date and time of when the vacation ends.


StreamMarker

Bases: NamedTuple

Represents a stream marker.

Attributes:

Name Type Description
id str

An ID that identifies this marker.

created_at datetime

The UTC date and time (in RFC3339 format) of when the moderator created this marker.

created_by str

The ID of the user that created the marker.

position_seconds int

The relative offset (in seconds) from where the marker is placed in the stream to the created_at time. Typically, the difference is a negative number.

description str

A short description of the marker.

url str

A URL that opens the video in the Highlighter at the marker's location.

video_id str

The ID of the video that the marker is placed in.

label str

The label of the marker, for example "Best Moment".

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


AdSchedule

Bases: NamedTuple

Represents an ad schedule entry.

Attributes:

Name Type Description
snooze_count int

The number of snoozes available for the broadcaster.

snooze_refresh_at Optional[datetime]

The UTC timestamp when the broadcaster will gain an additional snooze, in RFC3339 format.

next_ad_at Optional[datetime]

The UTC timestamp of the broadcaster's next scheduled ad, in RFC3339 format. None if the channel has no ad scheduled or is not live.

duration int

The length in seconds of the scheduled upcoming ad break.

last_ad_at Optional[datetime]

The UTC timestamp of the broadcaster's last ad-break, in RFC3339 format. None if the channel has not run an ad or is not live.

preroll_free_time int

The amount of pre-roll free time remaining for the channel in seconds. Returns 0 if they are currently not pre-roll free.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


AdSnooze

Bases: NamedTuple

Represents an ad snooze response.

Attributes:

Name Type Description
snooze_count int

The number of snoozes available for the broadcaster.

snooze_refresh_at Optional[datetime]

The UTC timestamp when the broadcaster will gain an additional snooze, in RFC3339 format.

next_ad_at Optional[datetime]

The UTC timestamp of the broadcaster's next scheduled ad, in RFC3339 format.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


Raid

Bases: NamedTuple

Represents a raid.

Attributes:

Name Type Description
created_at datetime

The UTC date and time (in RFC3339 format) of when the raid was started.

is_mature bool

Indicates whether the channel being raided contains mature content.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


UserSubscription

Bases: NamedTuple

Represents a user subscription.

Attributes:

Name Type Description
broadcaster UserIdentity

The broadcaster.

gifter UserIdentity

The user who gifted the subscription. Empty fields if not gifted.

is_gift bool

Flag indicating if the subscription is a gift.

user UserIdentity

The subscriber.

tier str

The subscription tier. Possible values are 1000 (Tier 1), 2000 (Tier 2), 3000 (Tier 3).

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


UserInfo

Bases: NamedTuple

Represents user information.

Attributes:

Name Type Description
identity UserIdentity

The user identity.

type str

The type of user. Possible values are: - "admin" — Twitch administrator - "global_mod" - "staff" — Twitch staff - "" — Normal user

broadcaster_type str

The type of broadcaster. Possible values are: - "affiliate" — An affiliate broadcaster - "partner" — A partner broadcaster - "" — A normal broadcaster

description str

The user's description of their channel.

profile_image_url str

A URL to the user's profile image.

offline_image_url str

A URL to the user's offline image.

email Optional[str]

The user's verified email address. Only included if the user access token includes the user:read:email scope.

created_at datetime

The UTC date and time that the user's account was created.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


ChannelEditor

Bases: NamedTuple

Represents a channel editor.

Attributes:

Name Type Description
user UserIdentity

The user that was granted editor privileges.

created_at datetime

The date and time that the user was granted editor privileges.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


ChannelVIP

Bases: NamedTuple

Represents a channel VIP.

Attributes:

Name Type Description
user UserIdentity

The VIP user.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


Moderator

Bases: NamedTuple

Represents a moderator.

Attributes:

Name Type Description
user UserIdentity

The moderator.

created_at datetime

The UTC date and time (in RFC3339 format) of when the moderator was added.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


Chatter

Bases: NamedTuple

Represents a chatter in a channel.

Attributes:

Name Type Description
user UserIdentity

The chatter's identity.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


FollowedChannel

Bases: NamedTuple

Represents a followed channel.

Attributes:

Name Type Description
broadcaster UserIdentity

The broadcaster that this user is following.

followed_at datetime

The UTC timestamp when the user started following the broadcaster.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


ChannelFollower

Bases: NamedTuple

Represents a channel follower.

Attributes:

Name Type Description
user UserIdentity

The follower.

followed_at datetime

The UTC timestamp when the user started following the broadcaster.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


BannedUser

Bases: NamedTuple

Represents a banned user.

Attributes:

Name Type Description
user UserIdentity

The banned user.

expires_at Optional[datetime]

The UTC date and time (in RFC3339 format) of when the timeout expires, or None if the user was banned and not timed out.

created_at datetime

The UTC date and time (in RFC3339 format) of when the user was banned or timed out.

reason str

The reason the user was banned or timed out, if a reason was provided.

moderator UserIdentity

The moderator that banned the user or added the timeout.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


UnbanRequest

Bases: NamedTuple

Represents an unban request.

Attributes:

Name Type Description
id str

An ID that identifies the unban request.

broadcaster UserIdentity

The broadcaster whose chat room the user is requesting an unban from.

user UserIdentity

The user requesting the unban.

text str

The unban request message.

status str

The status of the unban request. Possible values are: pending, approved, denied, acknowledged, canceled.

created_at datetime

The UTC date and time (in RFC3339 format) of when the unban request was created.

resolved_at Optional[datetime]

The UTC date and time (in RFC3339 format) of when the unban request was resolved. None if the request is still pending.

resolution_text str

The moderator's message to the user explaining why the request was denied. The string is empty if the request is pending or approved.

moderator UserIdentity

The moderator that resolved the request. Empty fields if the request is pending.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


BlockedTerm

Bases: NamedTuple

Represents a blocked term.

Attributes:

Name Type Description
broadcaster_id str

The broadcaster that owns the list of blocked terms.

moderator_id str

The moderator that last updated the blocked term.

id str

An ID that uniquely identifies the blocked term.

text str

The blocked term.

created_at datetime

The UTC date and time (in RFC3339 format) of when the term was blocked.

updated_at Optional[datetime]

The UTC date and time (in RFC3339 format) of when the term was updated. None if the term hasn't been updated.

expires_at Optional[datetime]

The UTC date and time (in RFC3339 format) of when the blocked term is set to expire. None if not set.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


ChatSettings

Bases: NamedTuple

Represents a broadcaster's chat settings.

Attributes:

Name Type Description
broadcaster_id str

The ID of the broadcaster whose chat settings these are.

emote_mode bool

Whether chat messages must contain only emotes.

follower_mode bool

Whether the broadcaster restricts the chat room to followers only.

follower_mode_duration Optional[int]

The length of time, in minutes, that users must follow the broadcaster before being able to participate in the chat room. Is None if follower_mode is False.

moderator_id Optional[str]

The moderator's ID. Only included if the request specified a user access token with the moderator:read:chat_settings scope.

non_moderator_chat_delay Optional[bool]

Whether the broadcaster adds a short delay before chat messages appear in the chat room. Only included if the request includes appropriate moderator scope.

non_moderator_chat_delay_duration Optional[int]

The amount of time, in seconds, that messages are delayed before appearing in chat. Is None if non_moderator_chat_delay is False.

slow_mode bool

Whether the broadcaster limits how often users in the chat room are allowed to send messages.

slow_mode_wait_time Optional[int]

The amount of time, in seconds, that users must wait between sending messages. Is None if slow_mode is False.

subscriber_mode bool

Whether only users that subscribe to the broadcaster's channel may talk in the chat room.

unique_chat_mode bool

Whether the broadcaster requires users to post only unique messages in the chat room.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


SharedChatParticipant

Bases: NamedTuple

Represents a participant in a shared chat session.

Attributes:

Name Type Description
broadcaster_id str

The User ID of the participant channel.


SharedChatSession

Bases: NamedTuple

Represents an active shared chat session for a channel.

Attributes:

Name Type Description
session_id str

The unique identifier for the shared chat session.

host_broadcaster_id str

The User ID of the host channel.

participants Tuple[SharedChatParticipant, ...]

The list of participants in the session.

created_at datetime

The UTC datetime for when the session was created.

updated_at datetime

The UTC datetime for when the session was last updated.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


DropReason

Bases: NamedTuple

Represents the reason a chat message was dropped.

Attributes:

Name Type Description
code str

Code for why the message was dropped.

message str

Message for why the message was dropped.


SendMessageStatus

Bases: NamedTuple

Represents the response from sending a chat message.

Attributes:

Name Type Description
message_id str

The message id for the message that was sent.

is_sent bool

If the message passed all checks and was sent.

drop_reason Optional[DropReason]

The reason the message was dropped, if any.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


UserChatColor

Bases: NamedTuple

Represents a user's chat color.

Attributes:

Name Type Description
identity UserIdentity

The user information.

color str

The Hex color code that the user uses in chat for their name. If the user hasn't specified a color in their settings, the string is empty.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


ChatBadgeSet

Bases: NamedTuple

Represents a set of chat badges.

Attributes:

Name Type Description
set_id str

An ID that identifies this set of chat badges (e.g., "bits", "subscriber").

versions Tuple[BadgeVersion, ...]

The list of chat badges in this set.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


BadgeVersion

Bases: NamedTuple

Represents a version of a chat badge.

Attributes:

Name Type Description
id str

An ID that identifies this version of the badge.

image_url_1x str

A URL to the small version (18px x 18px) of the badge.

image_url_2x str

A URL to the medium version (36px x 36px) of the badge.

image_url_4x str

A URL to the large version (72px x 72px) of the badge.

title str

The title of the badge.

description str

The description of the badge.

click_action Optional[str]

The action to take when clicking on the badge. None if no action is specified.

click_url Optional[str]

The URL to navigate to when clicking on the badge. None if no URL is specified.


AutoModSettings

Bases: NamedTuple

Represents AutoMod settings.

Attributes:

Name Type Description
broadcaster_id str

The ID of the broadcaster specified in the request.

moderator_id str

The ID of a user that has permission to moderate the broadcaster's chat room.

overall_level Optional[int]

The default AutoMod level for the broadcaster. This field is null if the broadcaster has not set an overall level of AutoMod filtering.

aggression int

The Automod level for hostility involving aggression.

bullying int

The Automod level for hostility involving name-calling or insults.

disability int

The Automod level for discrimination against disability.

misogyny int

The Automod level for discrimination against women.

racism int

The Automod level for discrimination based on ethnicity, color, or national origin.

sexism int

The Automod level for discrimination based on sex.

sexuality_sex_or_gender int

The AutoMod level for discrimination based on sexuality, sex, or gender.

swearing int

The Automod level for profanity.

sexual_violence int

The Automod level for sexual violence.

suicide int

The Automod level for suicide or self-harm.

other int

The Automod level for other types of discrimination.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


ShieldModeStatus

Bases: NamedTuple

Represents the Shield Mode status.

Attributes:

Name Type Description
is_active bool

A Boolean value that determines whether Shield Mode is active. Is true if Shield Mode is active; otherwise, false.

moderator UserIdentity

The moderator that last activated Shield Mode.

last_activated_at datetime

The UTC date and time (in RFC3339 format) of when Shield Mode was last activated.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


WarnReason

Bases: NamedTuple

Represents a warn reason.

Attributes:

Name Type Description
user UserIdentity

The warned user.

reason str

The reason for the warning.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


AutoModStatusMessage

Bases: NamedTuple

Represents the status of an AutoMod message.

Attributes:

Name Type Description
msg_id str

The unique ID of the message flagged by AutoMod.

msg_text str

The text content of the flagged message.


Cheermote

Bases: NamedTuple

Represents a single Cheermote object.

Attributes:

Name Type Description
prefix str

The name portion of the Cheermote string used in chat to cheer Bits. Combined with number of Bits to form full Cheermote string (e.g., "Cheer100").

tiers Tuple[CheermoteTier, ...]

A tuple of tier levels that the Cheermote supports, each with its own Bits range and associated imagery.

type str

The type of Cheermote. Possible values: - "global_first_party": Twitch-defined, shown in Bits card - "global_third_party": Twitch-defined, not shown in Bits card - "channel_custom": Broadcaster-defined Cheermote - "display_only": Internal use only - "sponsored": Sponsor-defined with additional Bits contribution

order int

The display order in the Bits card. Numbers may not be consecutive and are unique within each Cheermote type.

last_updated datetime

The date and time in RFC3339 format when this Cheermote was last updated.

is_charitable bool

Whether this Cheermote provides a charitable contribution match during campaigns.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


CheermoteTier

Bases: NamedTuple

Represents a tier level for a Cheermote.

Attributes:

Name Type Description
min_bits int

The minimum number of Bits that you must cheer at this tier level. The maximum is determined by the next tier's min_bits minus 1.

id str

The tier level ID. Possible values: "1", "100", "500", "1000", "5000", "10000", "100000".

color str

The hex code of the color associated with this tier level (e.g., "#979797").

images MappingProxyType[str, Any]

The animated and static image sets organized by theme, format, and size. Contains 'dark' and 'light' themes with 'animated' and 'static' formats.

can_cheer bool

Whether users can cheer at this tier level.

show_in_bits_card bool

Whether this tier level is shown in the Bits card.


EmoteImages

Bases: NamedTuple

Represents the image URLs for an emote at different sizes.

Attributes:

Name Type Description
url_1x str

A URL to the small version (28px x 28px) of the emote.

url_2x str

A URL to the medium version (56px x 56px) of the emote.

url_4x str

A URL to the large version (112px x 112px) of the emote.


ChannelEmote

Bases: NamedTuple

Represents a channel-specific custom emote.

Attributes:

Name Type Description
id str

An ID that identifies this emote.

name str

The name of the emote that viewers type in chat to display it.

images EmoteImages

The image URLs for the emote at different sizes.

tier str

The subscriber tier at which the emote is unlocked. Empty string if emote_type is not 'subscriptions'.

emote_type str

The type of emote. Possible values: - "bitstier": A custom Bits tier emote - "follower": A custom follower emote - "subscriptions": A custom subscriber emote

emote_set_id str

An ID that identifies the emote set that the emote belongs to.

format Tuple[str, ...]

The formats that the emote is available in ("static", "animated").

scale Tuple[str, ...]

The sizes that the emote is available in ("1.0", "2.0", "3.0").

theme_mode Tuple[str, ...]

The background themes that the emote is available in ("light", "dark").

template str

A templated URL for generating CDN URLs for this emote.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.

get_url(emote_format, theme_mode, scale)

Generate a CDN URL for this emote using the template.

Parameters:

Name Type Description Default
emote_format str

The format to use ("static" or "animated"). Must be in self.format.

required
theme_mode str

The theme mode to use ("light" or "dark"). Must be in self.theme_mode.

required
scale str

The scale to use ("1.0", "2.0", or "3.0"). Must be in self.scale.

required

Returns:

Type Description
str

The generated CDN URL for the emote.

Raises:

Type Description
ValueError

If the provided parameters are not available for this emote.


GlobalEmote

Bases: NamedTuple

Represents a global Twitch emote available in all channels.

Attributes:

Name Type Description
id str

An ID that identifies this emote.

name str

The name of the emote that viewers type in chat to display it.

images EmoteImages

The image URLs for the emote at different sizes.

format Tuple[str, ...]

The formats that the emote is available in ("static", "animated").

scale Tuple[str, ...]

The sizes that the emote is available in ("1.0", "2.0", "3.0").

theme_mode Tuple[str, ...]

The background themes that the emote is available in ("light", "dark").

template str

A templated URL for generating CDN URLs for this emote.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.

get_url(emote_format, theme_mode, scale)

Generate a CDN URL for this emote using the template.

Parameters:

Name Type Description Default
emote_format str

The format to use ("static" or "animated"). Must be in self.format.

required
theme_mode str

The theme mode to use ("light" or "dark"). Must be in self.theme_mode.

required
scale str

The scale to use ("1.0", "2.0", or "3.0"). Must be in self.scale.

required

Returns:

Type Description
str

The generated CDN URL for the emote.

Raises:

Type Description
ValueError

If the provided parameters are not available for this emote.


EmoteSet

Bases: NamedTuple

Represents an emote from a specific emote set.

Attributes:

Name Type Description
id str

An ID that uniquely identifies this emote.

name str

The name of the emote that viewers type in chat to display it.

images EmoteImages

The image URLs for the emote at different sizes.

emote_type str

The type of emote. Possible values: - "bitstier": A Bits tier emote - "follower": A follower emote - "subscriptions": A subscriber emote

emote_set_id str

An ID that identifies the emote set that the emote belongs to.

owner_id str

The ID of the broadcaster who owns the emote.

format Tuple[str, ...]

The formats that the emote is available in ("static", "animated").

scale Tuple[str, ...]

The sizes that the emote is available in ("1.0", "2.0", "3.0").

theme_mode Tuple[str, ...]

The background themes that the emote is available in ("light", "dark").

template str

A templated URL for generating CDN URLs for this emote.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.

get_url(emote_format, theme_mode, scale)

Generate a CDN URL for this emote using the template.

Parameters:

Name Type Description Default
emote_format str

The format to use ("static" or "animated"). Must be in self.format.

required
theme_mode str

The theme mode to use ("light" or "dark"). Must be in self.theme_mode.

required
scale str

The scale to use ("1.0", "2.0", or "3.0"). Must be in self.scale.

required

Returns:

Type Description
str

The generated CDN URL for the emote.

Raises:

Type Description
ValueError

If the provided parameters are not available for this emote.


Extension

Bases: NamedTuple

Represents an extension.

Attributes:

Name Type Description
id str

The extension ID.

version str

The extension version.

author_name str

The extension author name.

bits_enabled bool

Whether Bits are enabled.

can_install bool

Whether the extension can be installed.

configurations Tuple[ExtensionConfiguration, ...]

The configurations.

description str

The extension description.

has_chat_support bool

Whether the extension has chat support.

icon_url str

The icon URL.

name str

The extension name.

views Tuple[str, ...]

The views.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


ExtensionLiveChannel

Bases: NamedTuple

Represents a live channel with an extension installed or activated.

Attributes:

Name Type Description
broadcaster UserIdentity

The broadcaster.

game_name str

The name of the game being played.

game_id str

The ID of the game being played.

title str

The title of the stream.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


ExtensionSecret

Bases: NamedTuple

Represents an extension secret.

Attributes:

Name Type Description
format_version int

The secret format version.

content str

The secret content.

active_at datetime

The time when the secret becomes active.

expires_at datetime

The time when the secret expires.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


ExtensionConfiguration

Bases: NamedTuple

Represents an extension configuration.

Attributes:

Name Type Description
broadcaster_id str

The ID of the broadcaster.

extension_id str

The ID of the extension.

segment str

The segment type (e.g., global, broadcaster, viewer).

version str

The configuration version.

content str

The configuration content.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


UserExtension

Bases: NamedTuple

Represents a user extension.

Attributes:

Name Type Description
id str

The ID of the extension.

version str

The extension version.

can_activate bool

Indicates whether the user can install or activate the extension.

name str

The extension name.

types Tuple[str, ...]

The types of extensions, such as panel, overlay, component.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


ActiveUserExtension

Bases: NamedTuple

Represents active user extensions.

Attributes:

Name Type Description
panel Tuple[ExtensionPanel, ...]

The active panel extensions.

overlay Tuple[ExtensionOverlay, ...]

The active overlay extensions.

component Tuple[ExtensionComponent, ...]

The active component extensions.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


ExtensionComponent

Bases: NamedTuple

Represents an extension component configuration.

Attributes:

Name Type Description
active bool

Whether the component is active.

id str

The component ID.

version str

The component version.

name str

The component name.

x int

The x coordinate.

y int

The y coordinate.


ExtensionPanel

Bases: NamedTuple

Represents an extension panel configuration.

Attributes:

Name Type Description
active bool

Whether the panel is active.

id str

The panel ID.

version str

The panel version.

name str

The panel name.


ExtensionOverlay

Bases: NamedTuple

Represents an extension overlay configuration.

Attributes:

Name Type Description
active bool

Whether the overlay is active.

id str

The overlay ID.

version str

The overlay version.

name str

The overlay name.


ExtensionTransaction

Bases: NamedTuple

Represents an extension transaction.

Attributes:

Name Type Description
id str

An ID that identifies the transaction.

timestamp datetime

The UTC date and time (in RFC3339 format) of the transaction.

broadcaster UserIdentity

The broadcaster that owns the channel where the transaction occurred.

user UserIdentity

The user that purchased the digital product.

product_type str

The type of transaction. Possible values are: BITS_IN_EXTENSION.

domain str

Set to twitch.ext. + the extension's ID.

broadcast bool

A Boolean value that determines whether the data was broadcast to all instances of the extension.

expiration str

This field is always empty since you may purchase only unexpired products.

sku str

An ID that identifies the digital product.

cost Amount

Contains details about the digital product's cost.

display_name str

The name of the digital product.

in_development bool

A Boolean value that determines whether the product is in development.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


ExtensionBitsProduct

Bases: NamedTuple

Represents an extension Bits product.

Attributes:

Name Type Description
sku str

An ID that identifies the digital product.

cost Amount

Contains details about the digital product's cost.

name str

The name of the product.

in_development bool

A Boolean value that determines whether the product is in development.

display_name str

The product's display name.

expiration str

The expiration date.

is_broadcast bool

Whether the product is broadcast.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


Subscription

Bases: NamedTuple

Twitch EventSub subscription.

Attributes:

Name Type Description
id str

Unique subscription identifier

status str

Subscription status (enabled, webhook_callback_verification_pending, etc.)

type str

Type of subscription event

version str

API version for the subscription

condition MappingProxyType[str, str]

Subscription condition parameters

transport MappingProxyType[str, str]

Transport information for the subscription

created_at datetime

Subscription creation timestamp

cost int

Cost points for this subscription

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


Conduit

Bases: NamedTuple

Represents a Twitch EventSub conduit.

Attributes:

Name Type Description
id str

Conduit ID.

shard_count int

Number of shards created for this conduit.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


ConduitShard

Bases: NamedTuple

Represents a conduit shard.

Attributes:

Name Type Description
id str

Shard ID.

status str

The shard status. Possible values include: - enabled - webhook_callback_verification_pending - webhook_callback_verification_failed - notification_failures_exceeded - websocket_disconnected - websocket_failed_ping_pong - websocket_received_inbound_traffic - websocket_internal_error - websocket_network_timeout - websocket_network_error - websocket_failed_to_reconnect

method str

The transport method (webhook or websocket).

callback Optional[str]

The callback URL for webhook transport.

session_id Optional[str]

WebSocket session ID for websocket transport.

connected_at Optional[datetime]

UTC datetime when WebSocket connection was established.

disconnected_at Optional[datetime]

UTC datetime when WebSocket connection was lost.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


ConduitShardError

Bases: NamedTuple

Represents an error that occurred while updating a conduit shard.

Attributes:

Name Type Description
id str

Shard ID that failed to update.

message str

The error message describing what went wrong.

code str

Error code representing the specific error condition.


ConduitShardUpdate

Bases: NamedTuple

Represents the result of updating conduit shards.

Attributes:

Name Type Description
shards Tuple[ConduitShard, ...]

Tuple of successfully updated shards.

errors Tuple[ConduitShardError, ...]

Tuple of shards that failed to update.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


Category

Bases: NamedTuple

Represents a Twitch category from search results.

Attributes:

Name Type Description
id str

An ID that uniquely identifies the game or category.

name str

The name of the game or category.

box_art_url Optional[str]

A URL to an image of the game's box art or streaming category.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


Game

Bases: NamedTuple

Represents a Twitch game.

Attributes:

Name Type Description
category Category

The category information for this game including id, name, and box_art_url.

igdb_id str

The ID that IGDB uses to identify this game. If the IGDB ID is not available to Twitch, this field is set to an empty string.

raw Game

The original game data from the API.


SearchChannel

Bases: NamedTuple

Represents a Twitch channel from search results.

Attributes:

Name Type Description
identity UserIdentity

The broadcaster's identity information including id, login, and display name.

broadcaster_language str

The ISO 639-1 two-letter language code of the language used by the broadcaster. For example, "en" for English. If the broadcaster uses a language not in the list of supported stream languages, the value is "other".

category Category

The category/game information that the broadcaster is playing or last played.

is_live bool

A Boolean value that determines whether the broadcaster is streaming live. Is True if the broadcaster is streaming live; otherwise, False.

tags Tuple[str, ...]

The tags applied to the channel.

thumbnail_url str

A URL to a thumbnail of the broadcaster's profile image.

title str

The stream's title. Is an empty string if the broadcaster didn't set it.

started_at Optional[datetime]

The UTC datetime of when the broadcaster started streaming.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


Clip

Bases: NamedTuple

Represents a Twitch clip.

Attributes:

Name Type Description
id str

An ID that uniquely identifies the clip.

url str

A URL to the clip.

embed_url str

A URL that you can use in an iframe to embed the clip.

broadcaster UserIdentity

The broadcaster that the video was clipped from.

creator UserIdentity

The user that created the clip.

video_id str

An ID that identifies the video that the clip came from. This field contains an empty string if the video is not available.

category_id str

The category/game ID that was being played when the clip was created.

language str

The ISO 639-1 two-letter language code that the broadcaster broadcasts in. For example, "en" for English. The value is "other" if the broadcaster uses a language that Twitch doesn't support.

title str

The title of the clip.

view_count int

The number of times the clip has been viewed.

created_at datetime

The datetime when the clip was created.

thumbnail_url str

A URL to a thumbnail image of the clip.

duration float

The length of the clip, in seconds. Precision is 0.1.

vod_offset Optional[int]

The zero-based offset, in seconds, to where the clip starts in the video (VOD). Is None if the video is not available or hasn't been created yet from the live stream.

is_featured bool

A Boolean value that indicates if the clip is featured or not.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


Video

Bases: NamedTuple

Represents a Twitch video.

Attributes:

Name Type Description
id str

An ID that identifies the video.

stream_id Optional[str]

The ID of the stream that the video originated from if the video's type is "archive" otherwise, None.

user UserIdentity

The broadcaster that owns the video.

title str

The video's title.

description str

The video's description.

created_at datetime

The datetime when the video was created.

published_at datetime

The datetime when the video was published.

url str

The video's URL.

thumbnail_url str

A URL to a thumbnail image of the video. Replace %{width} and %{height} placeholders with desired dimensions (must be 320x180).

viewable str

The video's viewable state. Always set to "public".

view_count int

The number of times that users have watched the video.

language str

The ISO 639-1 two-letter language code that the video was broadcast in. The value is "other" if the language is not supported.

type str

The video's type. Possible values: "archive", "highlight", "upload".

duration str

The video's length in ISO 8601 duration format (e.g., "3m21s").

muted_segments tuple[MutedSegment, ...]

The segments that Twitch Audio Recognition muted

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


MutedSegment

Bases: NamedTuple

Represents a muted segment in a video.

Attributes:

Name Type Description
duration int

The duration of the muted segment, in seconds.

offset int

The offset, in seconds, from the beginning of the video to where the muted segment begins.


ContentClassificationLabel

Bases: NamedTuple

Represents a Twitch content classification label.

Attributes:

Name Type Description
id str

Unique identifier for the content classification label.

description str

Localized description of the content classification label.

name str

Localized name of the content classification label.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


AnalyticsReport

Bases: NamedTuple

Represents an analytics report.

Attributes:

Name Type Description
extension_id Optional[str]

An ID that identifies the extension that the report was generated for. None for game analytics.

game_id Optional[str]

An ID that identifies the game that the report was generated for. None for extension analytics.

url str

The URL that you use to download the report. The URL is valid for 5 minutes.

type str

The type of report.

started_at datetime

The reporting window's start date.

ended_at datetime

The reporting window's end date.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


TeamInfo

Bases: NamedTuple

Represents a team's information.

Attributes:

Name Type Description
id str

An ID that uniquely identifies the team.

team_name str

The team's name.

team_display_name str

The team's display name.

info str

The team's information/description.

thumbnail_url str

A URL to the team's thumbnail image.

banner Optional[str]

A URL to the team's banner image. None if no banner is set.

background_image_url Optional[str]

A URL to the team's background image. None if no background image is set.

created_at datetime

The UTC date and time of when the team was created.

updated_at datetime

The UTC date and time of when the team was last updated.


ChannelTeam

Bases: NamedTuple

Represents a channel team's information.

Attributes:

Name Type Description
team TeamInfo

The team's information.

identity UserIdentity

The broadcaster's information.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


TeamUsers

Bases: NamedTuple

Represents a collection of team users.

Attributes:

Name Type Description
team TeamInfo

The team's information.

users Tuple[BaseUser, ...]

A tuple of users that belong to the team.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.

total_users property

Returns the total number of users in the team.


StarCommercial

Bases: NamedTuple

Represents the response from starting a commercial on a Twitch channel.

Attributes:

Name Type Description
length int

The length of the commercial that was requested, in seconds. If a commercial longer than 180 seconds was requested, this will be 180.

message str

A message indicating whether Twitch was able to serve an ad.

retry_after int

The number of seconds you must wait before running another commercial.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


BitsLeaderboardEntry

Bases: NamedTuple

Represents an entry in the Bits leaderboard.

Attributes:

Name Type Description
user UserIdentity

The user on the leaderboard.

rank int

The user's position on the leaderboard.

score int

The number of Bits the user has cheered.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


Charity

Bases: NamedTuple

Represents a charity in a campaign.

Attributes:

Name Type Description
name str

The charity's name.

description str

A description of the charity.

logo str

A URL to an image of the charity's logo. The image's type is PNG and its size is 100px X 100px.

website str

A URL to the charity's website.


CharityCampaign

Bases: NamedTuple

Represents a charity campaign.

Attributes:

Name Type Description
id str

An ID that identifies the charity campaign.

broadcaster UserIdentity

Information about the broadcaster that's running the campaign.

charity Charity

Information about the charity.

current_amount Amount

The current amount of donations that the campaign has received.

target_amount Optional[Amount]

The campaign's fundraising goal. None if the broadcaster has not defined a fundraising goal.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


CharityDonation

Bases: NamedTuple

Represents a charity donation.

Attributes:

Name Type Description
id str

An ID that identifies the donation. The ID is unique across campaigns.

campaign_id str

An ID that identifies the charity campaign that the donation applies to.

user UserIdentity

The user that donated money to the campaign.

amount Amount

An object that contains the amount of money that the user donated.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


CreatorGoal

Bases: NamedTuple

Represents a creator goal.

Attributes:

Name Type Description
id str

An ID that identifies this goal.

broadcaster UserIdentity

The broadcaster that created the goal.

type str

The type of goal.

description str

A description of the goal, if specified. The description may be an empty string if not specified.

is_achieved bool

A Boolean value that indicates whether the broadcaster achieved their goal.

current_amount int

The goal's current value.

target_amount int

The goal's target value.

created_at datetime

The UTC date and time (in RFC3339 format) of when the broadcaster created the goal.

updated_at datetime

The UTC date and time (in RFC3339 format) of when the broadcaster last updated the goal.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


Contribution

Bases: NamedTuple

Represents a contribution to a Hype Train.

Attributes:

Name Type Description
user UserIdentity

The user who contributed.

type str

The contribution method. Possible values are: bits, channel_points, subscription.

total int

Total aggregated amount of all contributions made during the Hype Train.


HypeTrainStatus

Bases: NamedTuple

Represents comprehensive Hype Train data including current and historical records.

Attributes:

Name Type Description
current Optional[CurrentHypeTrain]

The currently active Hype Train, if any.

all_time_high Optional[HypeTrainRecord]

The all-time high Hype Train record for this channel.

shared_all_time_high Optional[HypeTrainRecord]

The all-time high shared Hype Train record, if applicable.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


HypeTrainRecord

Bases: NamedTuple

Represents a Hype Train record.

Attributes:

Name Type Description
level int

The level achieved in this Hype Train record.

total int

The total points/contributions achieved.

achieved_at datetime

The time when this record was achieved.


CurrentHypeTrain

Bases: NamedTuple

Represents the current active Hype Train.

Attributes:

Name Type Description
id str

The unique identifier for this Hype Train.

broadcaster UserIdentity

The broadcaster whose channel the Hype Train is taking place in.

level int

The current level of the Hype Train.

total int

The total contributions made to this Hype Train.

progress int

The current progress towards the next level.

goal int

The goal amount needed to reach the next level.

top_contributions Tuple[Contribution, ...]

The top contributors to this Hype Train.

shared_train_participants Optional[Tuple[UserIdentity, ...]]

Participants in shared Hype Train events, if applicable.

started_at datetime

The time when this Hype Train started.

expires_at datetime

The time when this Hype Train will expire.

type str

The type of Hype Train. Possible values are: treasure, golden_kappa, regular.


Poll

Bases: NamedTuple

Represents a poll.

Attributes:

Name Type Description
id str

ID of the poll.

broadcaster UserIdentity

The broadcaster that created the poll.

title str

Question displayed for the poll.

choices Tuple[PollChoice, ...]

Array of the poll choices.

bits_voting_enabled bool

Indicates if Bits can be used for voting.

bits_per_vote int

Number of Bits required to vote once with Bits.

channel_points_voting_enabled bool

Indicates if Channel Points can be used for voting.

channel_points_per_vote int

Number of Channel Points required to vote once with Channel Points.

status str

The poll status. Valid values are ACTIVE, COMPLETED, TERMINATED, ARCHIVED, MODERATED, INVALID.

duration int

The length of the poll in seconds.

started_at datetime

UTC timestamp for the poll's start time.

ended_at Optional[datetime]

UTC timestamp for the poll's end time. None if the poll has not ended.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


PollChoice

Bases: NamedTuple

Represents a poll choice.

Attributes:

Name Type Description
id str

ID for the choice.

title str

Text displayed for the choice.

votes int

Total number of votes received for this choice.

channel_points_votes int

Number of votes received for this choice that used Channel Points.

bits_votes int

Number of votes received for this choice that used Bits.


Prediction

Bases: NamedTuple

Represents a prediction.

Attributes:

Name Type Description
id str

ID of the Prediction.

broadcaster UserIdentity

The broadcaster.

title str

Title for the Prediction.

winning_outcome_id Optional[str]

ID of the winning outcome. None if not resolved.

outcomes Tuple[Outcome, ...]

Array of possible outcomes for the Prediction.

prediction_window int

Total duration of the Prediction (in seconds).

status str

Status of the Prediction. Valid values: ACTIVE, RESOLVED, CANCELED, LOCKED.

created_at datetime

UTC timestamp for when the Prediction was created.

ended_at Optional[datetime]

UTC timestamp for when the Prediction ended. None if not ended.

locked_at Optional[datetime]

UTC timestamp for when the Prediction was locked. None if not locked.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


Outcome

Bases: NamedTuple

Represents a prediction outcome.

Attributes:

Name Type Description
id str

ID of the outcome.

title str

Text displayed for the outcome.

users int

Number of unique users that chose the outcome.

channel_points int

Number of Channel Points used for the outcome.

top_predictors Tuple[Contribution, ...]

Array of users who were the top predictors.

color str

Color for the outcome.


UserActiveExtensionUpdate

Bases: NamedTuple

Represents an update to user active extensions.

Attributes:

Name Type Description
panel Tuple[ExtensionPanel, ...]

The updated panel extensions.

overlay Tuple[ExtensionOverlay, ...]

The updated overlay extensions.

component Tuple[ExtensionComponent, ...]

The updated component extensions.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


DropsEntitlement

Bases: NamedTuple

Represents a drop entitlement.

Attributes:

Name Type Description
id str

An ID that identifies the entitlement.

benefit_id str

An ID that identifies the benefit (reward).

timestamp str

The UTC date and time (in RFC3339 format) of when the entitlement was granted.

user_id str

An ID that identifies the user who was granted the entitlement.

game_id str

An ID that identifies the game the user was playing when the reward was entitled.

fulfillment_status str

The entitlement's fulfillment status. Possible values are: CLAIMED, FULFILLED.

last_updated str

The UTC date and time (in RFC3339 format) of when the entitlement was last updated.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


DropsEntitlementUpdate

Bases: NamedTuple

Represents a drops entitlement update result.

Attributes:

Name Type Description
status str

A string that indicates whether the status of the entitlements in the ids field were successfully updated. Possible values are: * INVALID_ID — The entitlement IDs in the ids field are not valid. * NOT_FOUND — The entitlement IDs in the ids field were not found. * SUCCESS — The status of the entitlements in the ids field were successfully updated. * UNAUTHORIZED — The user or organization identified by the user access token is not authorized to update the entitlements. * UPDATE_FAILED — The update failed. These are considered transient errors and the request should be retried later.

ids Tuple[str, ...]

The list of entitlements that the status in the status field applies to.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


SuspiciousUserStatus

Bases: NamedTuple

Represents the suspicious user status.

Attributes:

Name Type Description
user_id str

The ID of the user being given the suspicious status.

broadcaster_id str

The user ID of the broadcaster indicating in which channel the status is being applied.

moderator_id str

The user ID of the moderator who applied the last status.

updated_at datetime

The timestamp of the last time this user's status was updated.

status str

The type of suspicious status. Possible values: ACTIVE_MONITORING, RESTRICTED

types Tuple[str, ...]

An array of strings representing the type(s) of suspicious user this is. Possible values: MANUALLY_ADDED, DETECTED_BAN_EVADER, DETECTED_SUS_CHATTER, BANNED_IN_SHARED_CHANNEL

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


CreatedClip

Bases: NamedTuple

Represents a clip created from a VOD.

Attributes:

Name Type Description
id str

An ID that uniquely identifies the clip.

edit_url str

A URL you can use to edit the clip's title, feature the clip, create a portrait version of the clip, download the clip media, and share the clip directly to third-party platforms.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


ClipDownload

Bases: NamedTuple

Represents download URLs for a clip.

Attributes:

Name Type Description
clip_id str

An ID that uniquely identifies the clip.

landscape_download_url Optional[str]

The landscape URL to download the clip. None if the URL is not available.

portrait_download_url Optional[str]

The portrait URL to download the clip. None if the URL is not available.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.


UserAuthorization

Bases: NamedTuple

Represents a user's authorization scopes granted to the application.

Attributes:

Name Type Description
identity UserIdentity

The user's identity information.

scopes Tuple[str, ...]

A tuple of all the scopes the user has granted to the client ID.

raw MappingProxyType[str, Any]

A shallow-frozen dictionary representing the original payload.