Youtube Livestream Polls API
under review
S
Shaurya Kesarwani
It will be nice if this could be added within the sammi yt live extension
there is a YouTube API that can let you add a poll to your livestream via an HTTP request. It is called the YouTube Live Streaming API.
To use this API, you will need to create a YouTube Developer account and obtain an API key. Once you have done that, you can use the API to insert a poll into your livestream using the following steps:
Create a new poll object.
Set the poll's properties, such as the question, answers, and duration.
Make an HTTP request to the liveBroadcasts.insert endpoint, passing in the poll object as a parameter.
If the request is successful, YouTube will insert the poll into your livestream. You can then view the poll results in the YouTube Studio Live Control Room.
Here is an example of an HTTP request to insert a poll into a livestream:
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"snippet": {
"title": "My Livestream",
"description": "This is my livestream.",
"scheduledStartTime": "2023-10-09T12:00:00Z",
"liveChatId": "YOUR_LIVE_CHAT_ID",
"polls": [
{
"question": "What is your favorite color?",
"answers": [
"Red",
"Green",
"Blue",
],
"duration": 60
}
]
}
}
If the request is successful, YouTube will return a JSON response containing the newly created live broadcast object. The id field of the object will be the unique identifier of the live broadcast.
You can then use the liveBroadcasts.list endpoint to get the status of the live broadcast and to check if the poll has been inserted successfully.
I hope this helps!
Christina
under review
I'll look into this if it receives more votes.
S
Shaurya Kesarwani
idk if it works sadly since youtube api page is kinda a nightmare to navigate.
i dont think this is a valid json request. i havent found too many answers regarding yt polls so i cant say for sure if it exists even. you can close this if the api doesnt work
S
Shaurya Kesarwani
the example is copied from stackoverflow and youtube live streaming api.
hopefully this can be added within sammi directly, instead of needing us to make a google cloud project and setup our api keys etc