# How could I check if channel is live using javascript

**URL:** <https://staging-discuss.dev.twitch.com/t/how-could-i-check-if-channel-is-live-using-javascript/42538>\
**Category:** API\
**Created:** [December 24, 2022, 11:04pm UTC](https://staging-discuss.dev.twitch.com/t/how-could-i-check-if-channel-is-live-using-javascript/42538 "2022-12-24T23:04:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ali-kingX](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/ali-kingx/32/21652_2.png) [@ali-kingX](https://staging-discuss.dev.twitch.com/u/ali-kingX)\
**Post date:** [December 24, 2022, 11:04pm UTC](https://staging-discuss.dev.twitch.com/t/how-could-i-check-if-channel-is-live-using-javascript/42538/1 "2022-12-24T23:04:49Z")

</div>

I’m making a discord bot that sends a message when a specified channel is online. I haven’t found any thing on this yet.

---

<div class="post-metadata">

**Author:** ![Dist](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/dist/32/7192_2.png) [@Dist](https://staging-discuss.dev.twitch.com/u/Dist)\
**Post date:** [December 24, 2022, 11:09pm UTC](https://staging-discuss.dev.twitch.com/t/how-could-i-check-if-channel-is-live-using-javascript/42538/2 "2022-12-24T23:09:07Z")

</div>

The [Get Streams](https://dev.twitch.tv/docs/api/reference#get-streams) endpoint returns data on channels that are online, so if you want to see if a specific channel is live you’d specify that channel in the params and if a stream object is returned then they are live, otherwise they’re offline.

Alternatively you could use [EventSub](https://dev.twitch.tv/docs/eventsub), and subscribe to the `stream.online` type for the channel and receive a notification from Twitch when that channel goes live.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://staging-discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [December 25, 2022, 11:21am UTC](https://staging-discuss.dev.twitch.com/t/how-could-i-check-if-channel-is-live-using-javascript/42538/3 "2022-12-25T11:21:51Z")

</div>

Here is a whole/complete example and/or product to use

> **[GitHub - BarryCarlyon/twitch\_discord\_barrycarlyon\_co\_uk: A Super Simple...](https://github.com/barrycarlyon/twitch_discord_barrycarlyon_co_uk)**
>
> A Super Simple Twitch to Discord Notification Tool - GitHub - BarryCarlyon/twitch\_discord\_barrycarlyon\_co\_uk: A Super Simple Twitch to Discord Notification Tool

---

<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:** [January 24, 2023, 11:22am UTC](https://staging-discuss.dev.twitch.com/t/how-could-i-check-if-channel-is-live-using-javascript/42538/4 "2023-01-24T11:22:20Z")

</div>

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