# Best way to keep status of off/online streams updated?

**URL:** <https://discuss.dev.twitch.com/t/best-way-to-keep-status-of-off-online-streams-updated/2321>\
**Category:** API\
**Created:** [May 27, 2015, 2:50am UTC](https://discuss.dev.twitch.com/t/best-way-to-keep-status-of-off-online-streams-updated/2321 "2015-05-27T02:50:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hungryhipp0](https://avatars.discourse-cdn.com/v4/letter/h/958977/32.png) [@hungryhipp0](https://discuss.dev.twitch.com/u/hungryhipp0)\
**Post date:** [May 27, 2015, 2:50am UTC](https://discuss.dev.twitch.com/t/best-way-to-keep-status-of-off-online-streams-updated/2321/1 "2015-05-27T02:50:31Z")

</div>

Currently I’m writing an app which will do an json call, retrieve channel information (based on a submission), and then saves that information in to a database for later use and display on my site.

However one thing I’m curious about, what is the best way to handle keeping up to date stream status without bloat and hurting performance? Would a cronjob that executes a function that grabs all the streams in the db, and then makes a call using the channel names, checking to see if each one is online be the right way to go? or Should I just set up middleware that does a check on page request?

---

<div class="post-metadata">

**Author:** ![3ventic](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/3ventic/32/298_2.png) [@3ventic](https://discuss.dev.twitch.com/u/3ventic)\
**Post date:** [May 27, 2015, 7:34pm UTC](https://discuss.dev.twitch.com/t/best-way-to-keep-status-of-off-online-streams-updated/2321/2 "2015-05-27T19:34:18Z")

</div>

The best way is probably to poll [`https://api.twitch.tv/kraken/streams?channel=comma,separated,list,of,channels`](https://github.com/justintv/Twitch-API/blob/master/v3_resources/streams.md#get-streams), which will return a response containing all the specified streams that are currently live. The offline ones will be missing from the response.

---

<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:** [June 26, 2015, 7:34pm UTC](https://discuss.dev.twitch.com/t/best-way-to-keep-status-of-off-online-streams-updated/2321/3 "2015-06-26T19:34:30Z")

</div>

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