# Getting notified when a stream is live

**URL:** <https://staging-discuss.dev.twitch.com/t/getting-notified-when-a-stream-is-live/17672>\
**Category:** API\
**Created:** [September 13, 2018, 11:37pm UTC](https://staging-discuss.dev.twitch.com/t/getting-notified-when-a-stream-is-live/17672 "2018-09-13T23:37:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kindperrybot](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/kindperrybot/32/5173_2.png) [@kindperrybot](https://staging-discuss.dev.twitch.com/u/kindperrybot)\
**Post date:** [September 13, 2018, 11:37pm UTC](https://staging-discuss.dev.twitch.com/t/getting-notified-when-a-stream-is-live/17672/1 "2018-09-13T23:37:54Z")

</div>

I am currently making a site to promote esport professional streams and I am trying to figure out how to check if a channel is live and display it next to the hyperlink for the stream, this is the site currently and I will be needing to add that “check” for ~200-300 streams for the LoL tab [http://www.prostreams.gg/](http://www.prostreams.gg/) Any advice on has to how I should do this?

---

<div class="post-metadata">

**Author:** ![IllusionaryOne](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/illusionaryone/32/2011_2.png) [@IllusionaryOne](https://staging-discuss.dev.twitch.com/u/IllusionaryOne)\
**Post date:** [September 13, 2018, 11:40pm UTC](https://staging-discuss.dev.twitch.com/t/getting-notified-when-a-stream-is-live/17672/2 "2018-09-13T23:40:48Z")

</div>

Use the following API endpoint (at least in v5):

> **[Reference](https://dev.twitch.tv/docs/api/reference/)**
>
> Twitch Developer tools and services to integrate Twitch into your development or create interactive experience on twitch.tv.

You can query 100 channels at a time, so break your list up accordingly. Remember that it is 2-3 minutes behind when streams actually go live as it is cached data. Do not constantly poll the endpoint though, put a pause between each query.

If wanting to use the New Twitch API:

> **[Reference](https://dev.twitch.tv/docs/api/reference/#get-streams)**
>
> Twitch Developer tools and services to integrate Twitch into your development or create interactive experience on twitch.tv.

Again, limited to 100 channels at a time. Rate limits are enforced here so be sure that you are following the rate limit guidelines depending upon the type of authentication you are using.

---

<div class="post-metadata">

**Author:** ![kindperrybot](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/kindperrybot/32/5173_2.png) [@kindperrybot](https://staging-discuss.dev.twitch.com/u/kindperrybot)\
**Post date:** [September 13, 2018, 11:43pm UTC](https://staging-discuss.dev.twitch.com/t/getting-notified-when-a-stream-is-live/17672/3 "2018-09-13T23:43:47Z")

</div>

100 channels per page or could I set it to do 100 more channels after that?

---

<div class="post-metadata">

**Author:** ![IllusionaryOne](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/illusionaryone/32/2011_2.png) [@IllusionaryOne](https://staging-discuss.dev.twitch.com/u/IllusionaryOne)\
**Post date:** [September 14, 2018, 12:01am UTC](https://staging-discuss.dev.twitch.com/t/getting-notified-when-a-stream-is-live/17672/4 "2018-09-14T00:01:08Z")

</div>

You can scan 100 at a time. You would just need to break your master list of channels, be it 100, 200, 350, 512, … channels into lists of 100 and then perform a query for each list. Build up a master list of the data that comes back and refresh your page from that. You could even refresh in between queries if you wanted. However you are designing your solution.

---

<div class="post-metadata">

**Author:** ![IllusionaryOne](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/illusionaryone/32/2011_2.png) [@IllusionaryOne](https://staging-discuss.dev.twitch.com/u/IllusionaryOne)\
**Post date:** [September 14, 2018, 12:07am UTC](https://staging-discuss.dev.twitch.com/t/getting-notified-when-a-stream-is-live/17672/5 "2018-09-14T00:07:04Z")

</div>

Think of the code like this (quick and dirty):

```auto
ChannelIndex = 0
FOR ListOfChannels
    FOR 1...100
        QueryListOfChannels += ListOfChannels[ChannelIndex++]
    DONE
    responseData = QueryTwitch(QueryListOfChannels)
    UpdateWebPage(responseData)
    DELETE QueryListOfChannels
DONE

```

There are probably better ways to accomplish this, this is just off the top of my head.

---

<div class="post-metadata">

**Author:** ![kindperrybot](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/kindperrybot/32/5173_2.png) [@kindperrybot](https://staging-discuss.dev.twitch.com/u/kindperrybot)\
**Post date:** [September 14, 2018, 12:07am UTC](https://staging-discuss.dev.twitch.com/t/getting-notified-when-a-stream-is-live/17672/6 "2018-09-14T00:07:58Z")

</div>

I appreciate the help, I have no experience in web dev outside of what I have learned this week making the site, so all of this really helps!

---

<div class="post-metadata">

**Author:** ![kindperrybot](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/kindperrybot/32/5173_2.png) [@kindperrybot](https://staging-discuss.dev.twitch.com/u/kindperrybot)\
**Post date:** [September 14, 2018, 1:22am UTC](https://staging-discuss.dev.twitch.com/t/getting-notified-when-a-stream-is-live/17672/7 "2018-09-14T01:22:38Z")

</div>

I added you on discord to discuss

---

<div class="post-metadata">

**Author:** ![system](https://d2spem0quai2ol.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://staging-discuss.dev.twitch.com/u/system)\
**Post date:** [October 14, 2018, 1:22am UTC](https://staging-discuss.dev.twitch.com/t/getting-notified-when-a-stream-is-live/17672/8 "2018-10-14T01:22:42Z")

</div>

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