Collections¶
-
class
twitch.api.collections.
Collections
¶ This class provides methods for easy access to Twitch Collections API.
-
classmethod
get_metadata
(collection_id)¶ Gets summary information about a specified collection.
Parameters: collection_id (string) – Collection ID >>> from twitch import TwitchClient >>> client = TwitchClient('<my client id>') >>> collection = client.collections.get_metadata('12345')
-
classmethod
get
(collection_id, include_all_items)¶ Gets all items in a specified collection.
Parameters: - collection_id (string) – Collection ID
- include_all_items (boolean) – If True, unwatchable VODs are included in the response. Default: false.
-
classmethod
get_by_channel
(channel_id, limit, cursor, containig_item)¶ Gets all collections owned by a specified channel.
Parameters: - channel_id (string) – Channel ID
- limit (int) – Maximum number of objects to return. Default 10. Maximum 100.
- cursor (string) – Cursor of the next page
- containig_item (string) – Returns only collections containing the specified video. Example: video:89917098.
-
classmethod
create
(channel_id, title)¶ Creates a new collection owned by a specified channel.
Parameters: - channel_id (string) – Channel ID
- title (string) – Collection title
-
classmethod
update
(collection_id, title)¶ Updates the title of a specified collection.
Parameters: - collection_id (string) – Collection ID
- title (string) – Collection title
-
classmethod
create_thumbnail
(collection_id, item_id)¶ Adds the thumbnail of a specified collection item as the thumbnail for the specified collection.
Parameters: - collection_id (string) – Collection ID
- item_id (string) – Item ID
-
classmethod
delete
(collection_id)¶ Deletes a specified collection.
Parameters: collection_id (string) – Collection ID
-
classmethod
add_item
(collection_id, item_id, item_type)¶ Adds a specified item to a specified collection.
Parameters: - collection_id (string) – Collection ID
- item_id (string) – Item ID
- item_type (string) – Type of the item. Example: video.
-
classmethod
delete_item
(collection_id, collection_item_id)¶ Deletes a specified collection item from a specified collection.
Parameters: - collection_id (string) – Collection ID
- collection_item_id (string) – Collection Item ID
-
classmethod
move_item
(collection_id, collection_item_id, position)¶ Deletes a specified collection item from a specified collection.
Parameters: - collection_id (string) – Collection ID
- collection_item_id (string) – Collection Item ID
- position (int) – New item position
-
classmethod