0

I am looking for the list of api's I can use to get the Logged-in User's affiliate status (Path to Affiliate). I have seen some websites doing it but I checked Twitch official api version 5 and latest version of the api and I dont find api's that could help me retrieve this info.

There are 3 stats I am interested in:

  1. No. of hours streamed in past 30 days
  2. No. of days (different days) user streamed in past 30 days
  3. No. of viewers(average viewers) in hours streamed in past 30 days.

Check image below for reference. twitch stats for affiliate program

Murlidhar Fichadia
  • 2,589
  • 6
  • 43
  • 93

2 Answers2

-1

You can't there are no documented endpoints that present this information for third parties to consume.

Based on back and forth comments:

You can achieve similar resutls by use the Streams API to collect the information yourself into a database. And then correlate it yourself.

You would probably use EventSub (a webhook type solution) to give you more accuarate stream down times.

But still long poll the streams endpoint to monitor the viewer count.

Barry Carlyon
  • 1,039
  • 9
  • 13
  • but there is a website that shows this stats. if you have a twitch account.. do login to this website using twitch account: twitchfollowers.com – Murlidhar Fichadia Mar 04 '21 at 17:20
  • That's all public data collected and assumptions made from that public data. And won't be representative of what Twitch has on file for the achievements/milestones shown in the OP screenshot. – Barry Carlyon Mar 04 '21 at 18:37
  • Yeah they call the public data endpoints periodically then make their own assumptions on that data. So won't be as accurate as Twitch/the things in the screenshot – Barry Carlyon Mar 05 '21 at 18:07
  • what do you mean by public data endpoints? can you show me one? – Murlidhar Fichadia Mar 06 '21 at 22:06
  • I dont need 100% accuracy. – Murlidhar Fichadia Mar 06 '21 at 22:08
  • Any endpoint documented on https://dev.twitch.tv/docs/api/reference that doesn't need a scope – Barry Carlyon Mar 07 '21 at 23:02
  • I am fine with public data endpoints.. but I couldnt find the public api's that would give me data I need indirectly.. – Murlidhar Fichadia Mar 08 '21 at 12:21
  • 1
    Call the streams API to get live status. Wait for the stream to end by polling the streams API. Then store the time streamed in your database. (Or use eventsub for a webhook notification of stream up down). You can use your database to find out when you get to 8 hours.and store the dates your streamed, which'll let you then count the days streamed. It will also give you the viewer count so you can score the viewers every minute or so then calulate the average. So for those three attributes [Get Streams](https://dev.twitch.tv/docs/api/reference#get-streams) will let you approximate the data. – Barry Carlyon Mar 11 '21 at 18:28
  • *nods* I tweaked my primary answer. You'll probably want to look at eventsub as they you can get more accurate up/down times. And still use long poll to monitor the viewer count – Barry Carlyon Mar 13 '21 at 15:42
-1

im fairly new to this twitch and programming in genral but isnt there a way to pull the data off their servers the ame way it must pull it to show it you on your insights tab in the 30 day progress box?

  • Twitch doesn't have any "historical" endpoints so you have to collect and store it and make assumptions on the data after a given time period – Barry Carlyon Mar 11 '21 at 18:20