Using the api to start / stream

hey, im looking for a way to make the connected user to start a stream using the twitch api. ive looked thru the docs and couldnt find a way too.
thanks!

To stream you need to send an RTMP stream to a Twitch Ingest server.

To get the users Stream Key you use the Get Stream Key endpoint.
To get the list of ingest servers you use the Get Ingest Server endpoint.
And as for getting the user to send the RTMP stream to that destination, that’s outside the scope of the Twitch API as it’s for you to develop and/or integrate with broadcast software.

ok few questions, the streaming key is per user right? not per stream.
meaning when i get the twitch auth key and sends the req to the twitch api , my response will be the same when i use the same user or does it stream per request?
tnx

For Twitch the Stream Key is unique perh user/channel combo.

So “Get Stream Key” will always return the same value. (untill a user resets the key)

ok tnx! and any suggestions for how to find out whats the best ingest server to connect my user to?
lol i still havent built anything , just curios

The only way to know is to try streaming to an ingest and see how the quality is.

The Ingests API Reference | Twitch Developers will include the “name” of the ingest and that name usually refers to a geographical location

Broadly speaking a streamer would want to broadcast to the nearest ingest geographically.

There are also other extenral tools and OBS itself includes a tool to test ingests and see what works best. (stream for a bit in bandwidht test mode and monitor bandwidth and dropped frame counts)

So the only way to find the best is to test and see how it goes.

While it’s not possible to do this programmatically, one way to find out the suggested best ingest would be for the user that will be streaming to go to https://stream.twitch.tv/ingests/ which will give a list of recommended ingests. The user could then copy the endpoint and paste it in to whatever broadcasting software is to be used.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.