Models Reference

Model class

class twitcaspy.models.Model(api=None)

Model Base Class

_api
Type

API

classmethod parse(api, json)

Parse a JSON Model into a model instance.

Result class

class twitcaspy.models.Result(api=None)

Bases: twitcaspy.models.model.Model

API Result Object

latelimit
Type

LateLimit

Raw class

class twitcaspy.models.Raw

Raw Object

The data will be returned as it is.
This class does not instantiate.

User class

class twitcaspy.models.User(api=None)

Bases: twitcaspy.models.model.Model

User Object

id
The ID of the user.
Type

str

screen_id
The screen name of the user.(e.g.: @~~)
Note: screen_id is subject to change by the user.
Type

str

name
Human readable user name
Type

str

image
URL of user icon
Type

str

profile
Profile text
Type

str

level
User level
Type

int

last_movie_id
The last live ID by the user
Type

str or None

is_live
Whether it is currently live streamed
Type

bool

supporter_count(deprecated)
Number of user supporters.
Returns a fixed value of 0.
This parameter is deprecated.
Type

int

supporting_count(deprecated)
Number supported user by the user.
Returns a fixed value of 0.
This parameter is deprecated.
Type

int

created(deprecated)
Date and time when this account was created.
Returns a fixed value of 0.
This parameter is deprecated.
Type

int

References

https://apiv2-doc.twitcasting.tv/#user-object

App class

class twitcaspy.models.App(api=None)

Bases: twitcaspy.models.model.Model

Application Object

client_id
Application client ID
Type

str

name
Application name
Type

str

owner_user_id
Application developer user ID
Type

str

References

https://apiv2-doc.twitcasting.tv/#app-object

Live class

class twitcaspy.models.Live(api=None)

Bases: twitcaspy.models.model.Model

Live Object

movie
Type

Movie

broadcaster
Type

User

tags
Type

list

Movie class

class twitcaspy.models.Movie(api=None)

Bases: twitcaspy.models.model.Model

Movie Object

id
The ID of the movie.
Type

str

user_id
The ID of the user.
Type

str

title
Live title
Type

str

subtitle
Live subtitle (telop)
Type

str

last_owner_comment
Live streamer’s latest comment text
Type

str or None

category
category id
Type

str or None

Link URL to live (or recording)
Type

str

is_live
Whether live streaming now
Type

bool

is_recorded
Whether the recording is public
Type

bool

comment_count
Total number of comments
Type

int

large_thumbnail
URL of thumbnail image (large)
Type

str

small_thumbnail
URL of thumbnail image (small)
Type

str

country
stream area (country code)
Type

str

duration
stream time (seconds)
Type

int

created
Converted created_time to datetime.datetime type
Type

datetime.datetime

created_time
Unix time stamp of stream start datetime
Type

int

is_collabo
Whether it is a collaboration stream
Type

bool

is_protected
Whether to need the secret word
Type

bool

max_view_count
Maximum number of simultaneous viewers
(0 if streaming now.)
Type

int

current_view_count
Current number of simultaneous viewers
(0 if not streaming now.)
Type

int

total_view_count
Total number of viewers
Type

int

hls_url
URL for HTTP Live Streaming playback
Changed the URL of the hls_url parameter from http to https (This sentence was translated by Google Translate.[ja->en])
Type

str or None

References

https://apiv2-doc.twitcasting.tv/#movie-object

Comment class

class twitcaspy.models.Comment(api=None)

Bases: twitcaspy.models.model.Model

Comment Object

id
The ID of the comment.
Type

str

message
comment text
Type

str

from_user
Comment contributor information
Type

User

created
Converted created_time to datetime.datetime type
Type

datetime.datetime

created_time
Unix time stamp of comment posting datetime
Type

int

References

https://apiv2-doc.twitcasting.tv/#comment-object

Gift class

class twitcaspy.models.Gift(api=None)

Bases: twitcaspy.models.model.Model

Gift Object

id
Item transmission ID
Type

str

message
Message body when sending an item.
Type

str

item_image
Item image URL
Type

str

item_sub_image
If there is an image selected when sending the item, the URL of the image.
Type

str or None

item_id
Item ID
Type

str

item_mp
Item MP
Type

str

item_name
Item name
Type

str

user_image
URL of user icon
Type

str

user_screen_id
User’s screen_id at the time the item was submitted.
Type

str

user_screen_name
Human readable screen_id
Type

str

user_name
Human readable user name
Type

str

References

https://apiv2-doc.twitcasting.tv/#gift-object

Supporter class

class twitcaspy.models.Supporter(api=None)

Bases: twitcaspy.models.user.User

Supporter Object

id
The ID of the user.
Type

str

screen_id
The screen name of the user.(e.g.: @~~)
Note: screen_id is subject to change by the user.
Type

str

name
Human readable user name
Type

str

image
URL of user icon
Type

str

profile
Profile text
Type

str

level
User level
Type

int

last_movie_id
The last live ID by the user
Type

str or None

is_live
Whether it is currently live streamed
Type

bool

supported
Unix time stamp of supported datetime
Added ‘unix time stamp <supported> of supported datetime’ to SupporterUser object of response (This sentence was translated by Google Translate.[ja->en])
Type

int

supported_time
Converted supported to datetime.datetime type
Type

datetime.datetime

supporter_count(deprecated)
Number of user supporters.
Returns a fixed value of 0.
This parameter is deprecated.
Type

int

supporting_count(deprecated)
Number supported user by the user.
Returns a fixed value of 0.
This parameter is deprecated.
Type

int

point
Item score
Type

int

total_point
Cumulative score
Type

int

created(deprecated)
Date and time when this account was created.
Returns a fixed value of 0.
This parameter is deprecated.
Type

int

References

https://apiv2-doc.twitcasting.tv/#supporteruser-object

Category class

class twitcaspy.models.Category(api=None)

Bases: twitcaspy.models.model.Model

Category Object

id
Category ID
Type

str

name
Category name
Type

str

sub_categories
Type

list of SubCategory

References

https://apiv2-doc.twitcasting.tv/#category-object

SubCategory class

class twitcaspy.models.SubCategory(api=None)

Bases: twitcaspy.models.model.Model

SubCategory Object

id
SubCategory ID
Type

str

name
SubCategory name
Type

str

count
Number of subcategory streams
Type

int

References

https://apiv2-doc.twitcasting.tv/#sub-category-object

WebHook class

class twitcaspy.models.WebHook(api=None)

Bases: twitcaspy.models.model.Model

WebHook Object

user_id
User ID
Type

str

event
Event type to hook
event must be one of the following:
‘livestart’ : Live start
‘liveend’ : Live end
Type

str

References

https://apiv2-doc.twitcasting.tv/#webhook-object

LateLimit class

class twitcaspy.models.LateLimit

Late Limit Object

limit
Maximum number of API executions
Type

int

remaining
API remaining executable times
Type

int

reset
Unix Timestamp at the time when the remaining API execution count is reset
Type

int

reset_time
Converted reset to datetime.datetime type
Type

datetime.datetime

References

https://apiv2-doc.twitcasting.tv/#response-headers

ModelFactory class

class twitcaspy.models.ModelFactory
Used by parsers for creating instances of models.
You may subclass this factory to add your own extended models.
app

alias of twitcaspy.models.app.App

category

alias of twitcaspy.models.category.Category

comment

alias of twitcaspy.models.comment.Comment

gift

alias of twitcaspy.models.gift.Gift

live

alias of twitcaspy.models.live.Live

movie

alias of twitcaspy.models.movie.Movie

raw

alias of twitcaspy.models.raw.Raw

subcategory

alias of twitcaspy.models.subcategory.SubCategory

supporter

alias of twitcaspy.models.supporter.Supporter

user

alias of twitcaspy.models.user.User

webhook

alias of twitcaspy.models.webhook.WebHook