# Using the api to start / stream

**URL:** <https://discuss.dev.twitch.com/t/using-the-api-to-start-stream/42175>\
**Category:** API\
**Created:** [December 3, 2022, 8:41am UTC](https://discuss.dev.twitch.com/t/using-the-api-to-start-stream/42175 "2022-12-03T08:41:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![bvurth000100](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/bvurth000100/32/21158_2.png) [@bvurth000100](https://discuss.dev.twitch.com/u/bvurth000100)\
**Post date:** [December 3, 2022, 8:41am UTC](https://discuss.dev.twitch.com/t/using-the-api-to-start-stream/42175/1 "2022-12-03T08:41:59Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Dist](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/dist/32/7192_2.png) [@Dist](https://discuss.dev.twitch.com/u/Dist)\
**Post date:** [December 3, 2022, 9:01am UTC](https://discuss.dev.twitch.com/t/using-the-api-to-start-stream/42175/2 "2022-12-03T09:01:33Z")

</div>

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](https://dev.twitch.tv/docs/api/reference#get-stream-key) endpoint.  
To get the list of ingest servers you use the [Get Ingest Server](https://dev.twitch.tv/docs/video-broadcast/reference#get-ingest-servers) 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.

---

<div class="post-metadata">

**Author:** ![bvurth000100](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/bvurth000100/32/21158_2.png) [@bvurth000100](https://discuss.dev.twitch.com/u/bvurth000100)\
**Post date:** [December 4, 2022, 2:43pm UTC](https://discuss.dev.twitch.com/t/using-the-api-to-start-stream/42175/3 "2022-12-04T14:43:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [December 4, 2022, 2:44pm UTC](https://discuss.dev.twitch.com/t/using-the-api-to-start-stream/42175/4 "2022-12-04T14:44:19Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![bvurth000100](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/bvurth000100/32/21158_2.png) [@bvurth000100](https://discuss.dev.twitch.com/u/bvurth000100)\
**Post date:** [December 4, 2022, 2:45pm UTC](https://discuss.dev.twitch.com/t/using-the-api-to-start-stream/42175/5 "2022-12-04T14:45:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [December 4, 2022, 2:48pm UTC](https://discuss.dev.twitch.com/t/using-the-api-to-start-stream/42175/6 "2022-12-04T14:48:26Z")

</div>

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

The Ingests API [Reference | Twitch Developers](https://dev.twitch.tv/docs/video-broadcast/reference) 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.

---

<div class="post-metadata">

**Author:** ![Dist](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/dist/32/7192_2.png) [@Dist](https://discuss.dev.twitch.com/u/Dist)\
**Post date:** [December 4, 2022, 3:44pm UTC](https://discuss.dev.twitch.com/t/using-the-api-to-start-stream/42175/7 "2022-12-04T15:44:29Z")

</div>

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/](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.

---

<div class="post-metadata">

**Author:** ![system](https://d2opxh93rbxzdn.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://discuss.dev.twitch.com/u/system)\
**Post date:** [January 3, 2023, 3:44pm UTC](https://discuss.dev.twitch.com/t/using-the-api-to-start-stream/42175/8 "2023-01-03T15:44:50Z")

</div>

Closed on January 3, 2023, 3:44pm UTC

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