Check for stremer live in X teams

You have 2 options, either poll the streams endpoint as you have been doing, or alternative you could use Webhooks https://dev.twitch.tv/docs/api/webhooks-guide and subscribe to the Stream Changed topic https://dev.twitch.tv/docs/api/webhooks-reference#topic-stream-changed

What webhooks will do is allow for Twitch to send a notification to your server when there is a change to the stream (you’ll need to create a subscription to that topic for each user), and then you can keep track on your server of which streamers are live based on the notifications Twitch sends you. This will scale up to the max number of webhook subscriptions (10k users), and give you the most accurate data as Twitch will send the notification shortly after the API updates.