TwitchStreamsRequests
Inherits: TwitchRequestBase < RefCounted < Object
Twitch Streams API for stream information, keys, and markers.
Description
TwitchStreamsRequests provides methods for accessing live stream information, retrieving stream keys, and managing stream markers. Requires various OAuth scopes depending on the operation. Access through TwitchAPI.get_streams().
Tutorials
Methods
void |
create_stream_marker(user_id: String, description: String = "") |
void |
get_followed_streams(user_id: String, params: Dictionary = {}) |
void |
get_stream_key(broadcaster_id: String) |
void |
get_stream_markers(params: Dictionary) |
void |
get_streams(params: Dictionary = {}) |
Method Descriptions
void create_stream_marker(user_id: String, description: String = "") 🔗
Creates a marker at the current timestamp during a live stream. Optional description adds a label to the marker (max 140 characters). Requires channel:manage:broadcast scope. Results are returned via the TwitchAPI.request_completed signal with signal_name "stream_marker_created".
Response includes: id (marker ID), created_at, position_seconds (position in stream), description.
TwitchAPI.get_streams().create_stream_marker("user_id", "Epic moment!")
# Response: {"data": [{"id": "marker123", "created_at": "2025-10-16T12:00:00Z", "position_seconds": 3600, "description": "Epic moment!"}]}
void get_followed_streams(user_id: String, params: Dictionary = {}) 🔗
Gets information about active streams for channels the user follows. Optional params can include first. Requires user:read:follows scope. Results are returned via the TwitchAPI.request_completed signal with signal_name "followed_streams_received".
Response includes: Array of streams (same structure as get_streams response).
TwitchAPI.get_streams().get_followed_streams("user_id", {"first": 20})
# Response: {"data": [{"id": "stream123", "user_name": "Streamer1", "game_name": "Minecraft", "viewer_count": 2500, "started_at": "2025-10-16T10:00:00Z"}]}
void get_stream_key(broadcaster_id: String) 🔗
Gets the broadcaster's stream key (sensitive information). Requires channel:read:stream_key scope. Results are returned via the TwitchAPI.request_completed signal with signal_name "stream_key_received".
Response includes: stream_key (sensitive - broadcaster's streaming key).
TwitchAPI.get_streams().get_stream_key("broadcaster_id")
# Response: {"data": [{"stream_key": "live_123456789_abcdefghijk"}]}
void get_stream_markers(params: Dictionary) 🔗
Gets stream markers for a broadcaster's stream or VOD. params must include user_id or video_id, and can include first. Requires user:read:broadcast scope. Results are returned via the TwitchAPI.request_completed signal with signal_name "stream_markers_received".
Response includes: Array with user_id/name/login, videos array containing video_id and markers array (id, created_at, description, position_seconds).
var params = {"user_id": "broadcaster_id"}
TwitchAPI.get_streams().get_stream_markers(params)
# Response: {"data": [{"user_id": "123", "user_name": "Streamer", "videos": [{"video_id": "456", "markers": [{"id": "marker123", "created_at": "2025-10-16T12:00:00Z", "position_seconds": 3600, "description": "Epic"}]}]}]}
void get_streams(params: Dictionary = {}) 🔗
Gets information about active streams. Optional params can include user_id, user_login, game_id, type, language, and first. Results are returned via the TwitchAPI.request_completed signal with signal_name "streams_received".
Response includes: Array of streams with id, user_id/login/name, game_id, game_name, type, title, tags, viewer_count, started_at, language, thumbnail_url, is_mature.
var params = {"game_id": "509658", "first": 20}
TwitchAPI.get_streams().get_streams(params)
# Response: {"data": [{"id": "stream123", "user_id": "456", "user_name": "Streamer1", "game_name": "Just Chatting", "title": "Chatting!", "viewer_count": 1500, "started_at": "2025-10-16T10:00:00Z"}]}