Objects used by the Twitch API#

class twitchAPI.object.TwitchObject#

Bases: object

A lot of API calls return a child of this in some way (either directly or via generator). You can always use the to_dict() method to turn that object to a dictionary.

Example:

blocked_term = await twitch.add_blocked_term('broadcaster_id', 'moderator_id', 'bad_word')
print(blocked_term.id)
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

__init__(**kwargs)#
class twitchAPI.object.IterTwitchObject#

Bases: TwitchObject

Special type of TwitchObject. These usually have some list inside that you may want to dicrectly itterate over in your API usage but that also contain other usefull data outside of that List.

Example:

lb = await twitch.get_bits_leaderboard()
print(lb.total)
for e in lb:
    print(f'#{e.rank:02d} - {e.user_name}: {e.score}')
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.AsyncIterTwitchObject#

Bases: TwitchObject, Generic[T]

A few API calls will have usefull data outside of the list the pagination itterates over. For those cases, this object exist.

Example:

schedule = await twitch.get_channel_stream_schedule('user_id')
print(schedule.broadcaster_name)
async for segment in schedule:
    print(segment.title)
__init__(_data, **kwargs)#
static __new__(cls, *args, **kwds)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.TwitchUser#

Bases: TwitchObject

id: str#
login: str#
display_name: str#
type: str#
broadcaster_type: str#
description: str#
profile_image_url: str#
offline_image_url: str#
view_count: int#
email: str = None#
created_at: datetime#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.TwitchUserFollow#

Bases: TwitchObject

from_id: str#
from_login: str#
from_name: str#
to_id: str#
to_name: str#
followed_at: datetime#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.TwitchUserFollowResult#

Bases: AsyncIterTwitchObject[TwitchUserFollow]

total: int#
data: List[TwitchUserFollow]#
__init__(_data, **kwargs)#
static __new__(cls, *args, **kwds)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.DateRange#

Bases: TwitchObject

ended_at: datetime#
started_at: datetime#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.ExtensionAnalytic#

Bases: TwitchObject

extension_id: str#
URL: str#
type: str#
date_range: DateRange#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.GameAnalytics#

Bases: TwitchObject

game_id: str#
URL: str#
type: str#
date_range: DateRange#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.CreatorGoal#

Bases: TwitchObject

id: str#
broadcaster_id: str#
broadcaster_name: str#
broadcaster_login: str#
type: str#
description: str#
current_amount: int#
target_amount: int#
created_at: datetime#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.BitsLeaderboardEntry#

Bases: TwitchObject

user_id: str#
user_login: str#
user_name: str#
rank: int#
score: int#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.BitsLeaderboard#

Bases: IterTwitchObject

data: List[BitsLeaderboardEntry]#
date_range: DateRange#
total: int#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.ProductCost#

Bases: TwitchObject

amount: int#
type: str#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.ProductData#

Bases: TwitchObject

domain: str#
sku: str#
cost: ProductCost#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.ExtensionTransaction#

Bases: TwitchObject

id: str#
timestamp: datetime#
broadcaster_id: str#
broadcaster_login: str#
broadcaster_name: str#
user_id: str#
user_login: str#
user_name: str#
product_type: str#
product_data: ProductData#
inDevelopment: bool#
displayName: str#
expiration: str#
broadcast: str#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.ChatSettings#

Bases: TwitchObject

broadcaster_id: str#
moderator_id: str#
slow_mode: bool#
slow_mode_wait_time: int#
follower_mode: bool#
follower_mode_duration: int#
subscriber_mode: bool#
unique_chat_mode: bool#
non_moderator_chat_delay: bool#
non_moderator_chat_delay_duration: int#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.CreatedClip#

Bases: TwitchObject

id: str#
edit_url: str#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.Clip#

Bases: TwitchObject

id: str#
url: str#
embed_url: str#
broadcaster_id: str#
broadcaster_name: str#
creator_id: str#
creator_name: str#
video_id: str#
game_id: str#
language: str#
title: str#
view_count: int#
created_at: datetime#
thumbnail_url: str#
duration: float#
vod_offset: int#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.CodeStatus#

Bases: TwitchObject

code: str#
status: StatusCode#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.Game#

Bases: TwitchObject

box_art_url: str#
id: str#
name: str#
igdb_id: str#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.AutoModStatus#

Bases: TwitchObject

msg_id: str#
is_permitted: bool#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.BannedUser#

Bases: TwitchObject

user_id: str#
user_login: str#
user_name: str#
expires_at: datetime#
created_at: datetime#
reason: str#
moderator_id: str#
moderator_login: str#
moderator_name: str#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.BanUserResponse#

Bases: TwitchObject

broadcaster_id: str#
moderator_id: str#
user_id: str#
created_at: datetime#
end_time: datetime#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.BlockedTerm#

Bases: TwitchObject

broadcaster_id: str#
moderator_id: str#
id: str#
text: str#
created_at: datetime#
updated_at: datetime#
expires_at: datetime#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.Moderator#

Bases: TwitchObject

user_id: str#
user_login: str#
user_name: str#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.CreateStreamMarkerResponse#

Bases: TwitchObject

id: str#
created_at: datetime#
description: str#
position_seconds: int#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.Stream#

Bases: TwitchObject

id: str#
user_id: str#
user_login: str#
user_name: str#
game_id: str#
game_name: str#
type: str#
title: str#
viewer_count: int#
started_at: datetime#
language: str#
thumbnail_url: str#
tag_ids: List[str]#
is_mature: bool#
tags: List[str]#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.StreamMarker#

Bases: TwitchObject

id: str#
created_at: datetime#
description: str#
position_seconds: int#
URL: str#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.StreamMarkers#

Bases: TwitchObject

video_id: str#
markers: List[StreamMarker]#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.GetStreamMarkerResponse#

Bases: TwitchObject

user_id: str#
user_name: str#
user_login: str#
videos: List[StreamMarkers]#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.BroadcasterSubscription#

Bases: TwitchObject

broadcaster_id: str#
broadcaster_login: str#
broadcaster_name: str#
gifter_id: str#
gifter_login: str#
gifter_name: str#
is_gift: bool#
tier: str#
plan_name: str#
user_id: str#
user_name: str#
user_login: str#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.BroadcasterSubscriptions#

Bases: AsyncIterTwitchObject[BroadcasterSubscription]

total: int#
points: int#
data: List[BroadcasterSubscription]#
__init__(_data, **kwargs)#
static __new__(cls, *args, **kwds)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.UserSubscription#

Bases: TwitchObject

broadcaster_id: str#
broadcaster_name: str#
broadcaster_login: str#
is_gift: bool#
tier: str#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.StreamTag#

Bases: TwitchObject

tag_id: str#
is_auto: bool#
localization_names: Dict[str, str]#
localization_descriptions: Dict[str, str]#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.TeamUser#

Bases: TwitchObject

user_id: str#
user_name: str#
user_login: str#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.ChannelTeam#

Bases: TwitchObject

broadcaster_id: str#
broadcaster_name: str#
broadcaster_login: str#
background_image_url: str#
banner: str#
users: Optional[List[TeamUser]]#
created_at: datetime#
updated_at: datetime#
info: str#
thumbnail_url: str#
team_name: str#
team_display_name: str#
id: str#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.UserExtension#

Bases: TwitchObject

id: str#
version: str#
can_activate: bool#
type: List[str]#
name: str#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.ActiveUserExtension#

Bases: UserExtension

x: int#
y: int#
active: bool#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

id: str#
version: str#
can_activate: bool#
type: List[str]#
name: str#
class twitchAPI.object.UserActiveExtensions#

Bases: TwitchObject

panel: Dict[str, ActiveUserExtension]#
overlay: Dict[str, ActiveUserExtension]#
component: Dict[str, ActiveUserExtension]#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.VideoMutedSegments#

Bases: TwitchObject

duration: int#
offset: int#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.Video#

Bases: TwitchObject

id: str#
stream_id: str#
user_id: str#
user_login: str#
user_name: str#
title: str#
description: str#
created_at: datetime#
published_at: datetime#
url: str#
thumbnail_url: str#
viewable: str#
view_count: int#
language: str#
type: VideoType#
duration: str#
muted_segments: List[VideoMutedSegments]#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.ChannelInformation#

Bases: TwitchObject

broadcaster_id: str#
broadcaster_login: str#
broadcaster_name: str#
game_name: str#
game_id: str#
broadcaster_language: str#
title: str#
delay: int#
tags: List[str]#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.SearchChannelResult#

Bases: ChannelInformation

is_live: bool#
tags_ids: List[str]#
started_at: datetime#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

broadcaster_id: str#
broadcaster_login: str#
broadcaster_name: str#
game_name: str#
game_id: str#
broadcaster_language: str#
title: str#
delay: int#
tags: List[str]#
class twitchAPI.object.SearchCategoryResult#

Bases: TwitchObject

id: str#
name: str#
box_art_url: str#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.StartCommercialResult#

Bases: TwitchObject

length: int#
message: str#
retry_after: int#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.Cheermote#

Bases: TwitchObject

min_bits: int#
id: str#
color: str#
images: Dict[str, Dict[str, Dict[str, str]]]#
can_cheer: bool#
show_in_bits_card: bool#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.GetCheermotesResponse#

Bases: TwitchObject

prefix: str#
tiers: List[Cheermote]#
type: str#
order: int#
last_updated: datetime#
is_charitable: bool#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.HypeTrainContribution#

Bases: TwitchObject

total: int#
type: HypeTrainContributionMethod#
user: str#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.HypeTrainEventData#

Bases: TwitchObject

broadcaster_id: str#
cooldown_end_time: datetime#
expires_at: datetime#
goal: int#
id: str#
last_contribution: HypeTrainContribution#
level: int#
started_at: datetime#
top_contributions: List[HypeTrainContribution]#
total: int#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.HypeTrainEvent#

Bases: TwitchObject

id: str#
event_type: str#
event_timestamp: datetime#
version: str#
event_data: HypeTrainEventData#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.DropsEntitlement#

Bases: TwitchObject

id: str#
benefit_id: str#
timestamp: datetime#
user_id: str#
game_id: str#
fulfillment_status: DropsEntitlementFulfillmentStatus#
updated_at: datetime#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.MaxPerStreamSetting#

Bases: TwitchObject

is_enabled: bool#
max_per_stream: int#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.MaxPerUserPerStreamSetting#

Bases: TwitchObject

is_enabled: bool#
max_per_user_per_stream: int#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.GlobalCooldownSetting#

Bases: TwitchObject

is_enabled: bool#
global_cooldown_seconds: int#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.CustomReward#

Bases: TwitchObject

broadcaster_name: str#
broadcaster_login: str#
broadcaster_id: str#
id: str#
image: str#
background_color: str#
is_enabled: bool#
cost: int#
title: str#
prompt: str#
is_user_input_required: bool#
max_per_stream_setting: MaxPerStreamSetting#
max_per_user_per_stream_setting: MaxPerUserPerStreamSetting#
global_cooldown_setting: GlobalCooldownSetting#
is_paused: bool#
is_in_stock: bool#
default_image: Dict[str, str]#
should_redemptions_skip_request_queue: bool#
redemptions_redeemed_current_stream: int#
cooldown_expires_at: datetime#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.PartialCustomReward#

Bases: TwitchObject

id: str#
title: str#
prompt: str#
cost: int#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.CustomRewardRedemption#

Bases: TwitchObject

broadcaster_name: str#
broadcaster_login: str#
broadcaster_id: str#
id: str#
user_id: str#
user_name: str#
user_input: str#
status: CustomRewardRedemptionStatus#
redeemed_at: datetime#
reward: PartialCustomReward#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.ChannelEditor#

Bases: TwitchObject

user_id: str#
user_name: str#
created_at: datetime#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.BlockListEntry#

Bases: TwitchObject

user_id: str#
user_login: str#
user_name: str#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.PollChoice#

Bases: TwitchObject

id: str#
title: str#
votes: int#
channel_point_votes: int#
bits_votes: int#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.Poll#

Bases: TwitchObject

id: str#
broadcaster_name: str#
broadcaster_id: str#
broadcaster_login: str#
title: str#
choices: List[PollChoice]#
bits_voting_enabled: bool#
bits_per_vote: int#
channel_point_voting_enabled: bool#
channel_points_per_vote: int#
status: PollStatus#
duration: int#
started_at: datetime#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.Predictor#

Bases: TwitchObject

user_id: str#
user_name: str#
user_login: str#
channel_points_used: int#
channel_points_won: int#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.PredictionOutcome#

Bases: TwitchObject

id: str#
title: str#
users: int#
channel_points: int#
top_predictors: Optional[List[Predictor]]#
color: str#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.Prediction#

Bases: TwitchObject

id: str#
broadcaster_id: str#
broadcaster_name: str#
broadcaster_login: str#
title: str#
winning_outcome_id: Optional[str]#
outcomes: List[PredictionOutcome]#
prediction_window: int#
status: PredictionStatus#
created_at: datetime#
ended_at: Optional[datetime]#
locked_at: Optional[datetime]#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.RaidStartResult#

Bases: TwitchObject

created_at: datetime#
is_mature: bool#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.ChatBadgeVersion#

Bases: TwitchObject

id: str#
image_url_1x: str#
image_url_2x: str#
image_url_4x: str#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.ChatBadge#

Bases: TwitchObject

set_id: str#
versions: List[ChatBadgeVersion]#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.Emote#

Bases: TwitchObject

id: str#
name: str#
images: Dict[str, str]#
tier: str#
emote_type: str#
emote_set_id: str#
format: List[str]#
scale: List[str]#
theme_mode: List[str]#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.GetEmotesResponse#

Bases: IterTwitchObject

data: List[Emote]#
template: str#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.EventSubSubscription#

Bases: TwitchObject

id: str#
status: str#
type: str#
version: str#
condition: Dict[str, str]#
created_at: datetime#
transport: Dict[str, str]#
cost: int#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.GetEventSubSubscriptionResult#

Bases: AsyncIterTwitchObject[EventSubSubscription]

total: int#
total_cost: int#
max_total_cost: int#
data: List[EventSubSubscription]#
__init__(_data, **kwargs)#
static __new__(cls, *args, **kwds)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.StreamCategory#

Bases: TwitchObject

id: str#
name: str#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.ChannelStreamScheduleSegment#

Bases: TwitchObject

id: str#
start_time: datetime#
end_time: datetime#
title: str#
canceled_until: Optional[datetime]#
category: StreamCategory#
is_recurring: bool#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.StreamVacation#

Bases: TwitchObject

start_time: datetime#
end_time: datetime#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.ChannelStreamSchedule#

Bases: AsyncIterTwitchObject[ChannelStreamScheduleSegment]

segments: List[ChannelStreamScheduleSegment]#
broadcaster_id: str#
broadcaster_name: str#
broadcaster_login: str#
vacation: Optional[StreamVacation]#
__init__(_data, **kwargs)#
static __new__(cls, *args, **kwds)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.ChannelVIP#

Bases: TwitchObject

user_id: str#
user_name: str#
user_login: str#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.UserChatColor#

Bases: TwitchObject

user_id: str#
user_name: str#
user_login: str#
color: str#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.Artist#

Bases: TwitchObject

id: str#
name: str#
creator_channel_id: str#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.Album#

Bases: TwitchObject

id: str#
name: str#
image_url: str#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.Soundtrack#

Bases: TwitchObject

artists: List[Artist]#
id: str#
isrc: str#
duration: int#
title: str#
album: Album#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.TrackSource#

Bases: TwitchObject

content_type: SoundtrackSourceType#
id: str#
image_url: str#
soundtrack_url: str#
spotify_url: str#
title: str#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.CurrentSoundtrack#

Bases: TwitchObject

track: Soundtrack#
source: TrackSource#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.Playlist#

Bases: TwitchObject

title: str#
id: str#
image_url: str#
description: str#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.Chatter#

Bases: TwitchObject

user_id: str#
user_login: str#
user_name: str#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.GetChattersResponse#

Bases: AsyncIterTwitchObject[Chatter]

data: List[Chatter]#
total: int#
__init__(_data, **kwargs)#
static __new__(cls, *args, **kwds)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.ShieldModeStatus#

Bases: TwitchObject

is_active: bool#
moderator_id: str#
moderator_login: str#
moderator_name: str#
last_activated_at: Optional[datetime]#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.CharityAmount#

Bases: TwitchObject

value: int#
decimal_places: int#
currency: str#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.CharityCampaign#

Bases: TwitchObject

id: str#
broadcaster_id: str#
broadcaster_login: str#
broadcaster_name: str#
charity_name: str#
charity_description: str#
charity_website: str#
current_amount: CharityAmount#
target_amount: CharityAmount#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict

class twitchAPI.object.CharityCampaignDonation#

Bases: TwitchObject

id: str#
campaign_id: str#
user_id: str#
user_name: str#
user_login: str#
amount: CharityAmount#
__init__(**kwargs)#
to_dict(include_none_values=False)#

build dict based on annotation types

Parameters:

include_none_values (bool) – if fields that have None values should be included in the dictionary

Return type:

dict