KickLivestreamsRequests
Inherits: KickRequestBase < RefCounted < Object
Handles Kick API requests related to livestreams.
Description
KickLivestreamsRequests provides methods for retrieving livestream information from the Kick API.
Access this handler through KickAPI.get_livestreams().
func _ready():
KickAPI.configure("your_token")
KickAPI.request_completed.connect(_on_request_completed)
# Get livestream by channel slug
KickAPI.get_livestreams().get_livestreams({"slug": ["streamer123"]})
# Get multiple livestreams by broadcaster IDs
KickAPI.get_livestreams().get_livestreams({"broadcaster_user_id": [123, 456, 789]})
func _on_request_completed(signal_name: String, response_code: int, data: Dictionary):
if signal_name == "livestreams_received":
# Output:
# {
# "data": [
# {
# "broadcaster_user_id": 12345,
# "slug": "streamer123",
# "channel_id": 54321,
# "stream_title": "Epic Gaming Session!",
# "category": {
# "id": 42,
# "name": "Gaming",
# "thumbnail": "https://..."
# },
# "thumbnail": "https://...",
# "language": "en",
# "viewer_count": 1250,
# "started_at": "2024-01-15T10:00:00Z",
# "has_mature_content": false
# }
# ],
# "message": "success"
# }
for stream in data["data"]:
print("Stream: ", stream["slug"])
print(" Title: ", stream["stream_title"])
print(" Viewers: ", stream["viewer_count"])
print(" Category: ", stream["category"]["name"])
print(" Started: ", stream["started_at"])
Tutorials
Methods
void |
get_livestreams(params: Dictionary = {}) |
Method Descriptions
void get_livestreams(params: Dictionary = {}) 🔗
Retrieves livestream information. The params dictionary can include:
broadcaster_user_id: Array of broadcaster user IDs (up to 50)slug: Array of channel slugs (up to 50)
You cannot mix broadcaster_user_id and slug parameters.
Results are returned via the KickAPI.request_completed signal with signal_name "livestreams_received".
KickAPI.get_livestreams().get_livestreams({"slug": ["streamer123"]})