Accessing last game played on offline channel

Good day!

I am trying to achieve a way to fetch stream informations, and as long as it’s still live, it’s fine. But if the stream is offline, the data is empty (which is logical).

Is there any endpoint I did not noticed, that allows to ask “what was the previous stream” ? or "What is the currently selected game for this user’s channel, even though he is offline ? (In HELIX endpoint)

Use case example:
User A finishes stream, hosts user B with X viewers, as a good mod of B, he shoutout, i’d like to display "was playing ". This is not working as the stream is over and data is an empty array;

Any suggestions on how to achieve that ?

Thanks a lot!

Right now, I’m fairly certain the only way to go about this is via v3 and v5 APIs. To do it via v5, you’d need to make calls to the following:

Get id of username:
https://api.twitch.tv/kraken/users?login=<channel Name>, documentation: https://dev.twitch.tv/docs/v5/reference/users/#get-users

Get game assigned to channel:
https://api.twitch.tv/kraken/channels/<channel ID>, documentation: https://dev.twitch.tv/docs/v5/reference/channels/#get-channel-by-id

The response in that final request will include the recently played game.

Thanks!

It is what I was using previously, but I’d like to only use HELIX as v3 and v5 are deprecated;
The Helix endpoint for this isn’t yet created if I understand well ?

As I understand it, that’s correct.

The Helix Users endpoint doesn’t return game data (makes sense):

And the Streams resource is only available while a stream is live. The “channel” resource doesn’t seem to be supported in Helix at the moment.

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