How Can I Check if a Twitch Stream is Live?

I’ve embedded two twitch streams on my site. I also have two buttons, which allow my users to switch from one stream to the other. Eventually, I’d like to have several buttons with several different streamers to choose from. But I would like to add a text element for each stream that changes from “offline” to “online” depending on whether or not the streamer is live. Each streamer will have a text element near their button showing their streaming status.

I think I can figure out the if/then coding, but is there a way to “query” or “get” or otherwise “test” the status on twitch? Here’s what I found online for getting a streamer’s live status:

GET https://api.twitch.tv/kraken/streams/

I found this link here:
https://dev.twitch.tv/docs/v5/reference/streams/#get-stream-by-user

Can anyone get me started in the right direction?

Hi,
You can use Wix Fetch API to access the Twitch API and check the status (please check with them how to check it). After you get the needed value, you can change the text of the element on your site to the gotten value.

Thank you so much. This is going to be amazing if I can figure this out.

hey, did you figure it out? I’m looking for the same thing.