Is there a way to get the amount of hours streamed by a user?

Hi, I want to get

  • hours streamed
  • peak views
  • hours watched and other data similar to this

Something similar to what does
But im not finding the answer anywhere in Twitch Reference

Does anyone know what I could have to do to get acess to this kind of data?

Any help would be greatly aprecciated

There’s no way to get historical data through the API.

If you want to get that data then you would need to keep track of it in real-time, such as by periodically polling the Get Streams endpoint and then calculating their hours streamed, viewer count, and things of that nature yourself.

For some data, such as sub count, you would need the broadcaster to grant you permissions to access their subscribers list, otherwise you would be limited to guessing sub counts based on subscription messages in chat but this results in VASTLY inaccurate sub counts which is why sites like twitchtracker which guess sub counts are not particularly useful.

So how do websites like TwitchTracker works? I mean, they have all those data, so they gotta get somewhere

They collect it in real time and store it in their own database(s) for later analysis and display.

Do you have any idea of how to get this kind of data in real time and recording it? Since Twitch doesn’t provide it, then how could we calculate on our own?

Im doing a website for a streamer and the idea was to do a dash with this data, so Idk what to do since twitch doesnt provide what I need or how calculate this on my own

Hours the streamer is live is calcuatling by getting the start and end time of a stream
IE: when they appear in get streams (which will also give you the stream start time), and when they disappear from get streams (the approx end time)

Peak viewers, well you are checking get streams every 5 minutes or so, well then you have that data.

Hours watched: calulate that using the data you collected above.

This is all what Dist already told you.

If you are doing it for a single streamer and only that stream then you would utilise EventSub for Stream Start/End times.

As for viewers then you’d have to call the get streams endpoint peridicially to get the viewer count.

And then at stream end calculate the apporx hours watched from the data you collected for the stream.

Which is all done via Get Streams, like dist already told you.

Pretty much it’s basic maths/statistics really.

Thanks, Barry!

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