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!