How should i get user recently stream category using API

Can someone explain what should i do to get the above list?

This list is based off of the users vods/videos, if the vods are available.

However the Get Videos API doesn’t return the game(s) for a VOD

See this uservoice - Return Tags and Game ID in Get Videos in Helix – Twitch UserVoice

So the only way it can be built is by collected that data in real time.

May i know how can i collect the data in real time and stored it in our database?
I am using PHP & wordpress for my website.

Poll Get Streams Reference | Twitch Developers and watch for game changes

Utilized EventSub for real time updates EventSub Subscription Types | Twitch Developers

May i know how do i watch for game changes?

You Call Get Streams it says user x is playing game y
You Call Get Streams it says user x is playing game y
You Call Get Streams it says user x is playing game y
You Call Get Streams it says user x is playing game y
You Call Get Streams it says user x is playing game y
You Call Get Streams it says user x is playing game y
You Call Get Streams it says user x is playing game y
You Call Get Streams it says user x is playing game y
You Call Get Streams it says user x is playing game x
You Call Get Streams it says user x is playing game x
You Call Get Streams it says user x is playing game x
You Call Get Streams it says user x is playing game x
You Call Get Streams it says user x is playing game x
You Call Get Streams it says user x is playing game x
You Call Get Streams it says user x is playing game x
You Call Get Streams it says user x is playing game x

So you call the api periodicially (aka poll)
and whenever the game changes you record the change

is there any other way to get it? Because i can call the API only when i am in the website but in that time if user does not pay any game, then how will i record the game changes and stored it in our database?

Wordpress has a Cron function Cron | Plugin Developer Handbook | WordPress Developer Resources

may i know at what time should i call the corn job so that i can get the data?

You decide that. It’s your project so you need to descide what cadence of checking you want to do

suppose a user does not come to the website but he is streaming on the twitch, in that case will corn job work?

Cronjob runs independant of people visiting the website. Assuming you have correctly configured/setup wordpress cron to not rely on visitors

no what i mean was, i want to display the recent streamed category of a user, so if user does not logged in in our website, how the corn job will get the stream data of that particular user without id?

The last category the user probably streamed you can get from the Current Stream/category selected for the channel Reference | Twitch Developers

if you don’t know whom you need to collect data for then then you can’t since you don’t know you need to collect their data

if you are trying to get data about a streamer whom is newly signed up to your service, you can’t as theres no historical APIs or an API for recently streamed as we discussed in the first reply

Then how twitchtracker getting the data, please check the below link

By calling get streams and storing the data for the whole platform

Please explain in detail

I already did

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