I have 11 teams who I want to check if any of team member is live, I have arround 2100 members total.
The only way I views is through https://api.twitch.tv/helix/streams with user_id or user_login, but I will have to make 20 query to check that and I refresh that information at each 5 minutes.
I will also incrase the size of team and add new team in my system in the future
So do you have a better way to get that information?
Thanks for help and time!
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.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.