I’d like to retrieve VOD ID by Stream ID. Is there any option to do it with the Helix api?
Unfortunately there is no way to do that right now, either in Kraken or in the new Twitch API (aka Helix).
I actually think you can, but it’s not exactly clean. Here’s the flow:
Using stream id, get stream data via v5 endpoint:
Extract streamer’s user id from stream data: 44338537
Use stream id to query Helix videos endpoint: https://api.twitch.tv/helix/videos?user_id=44338537
By default, this should be sorted by time, so the current stream VOD should be the first one (this is making a kind of big assumption).
Extract the first video’s (streaming VOD with any luck) ID: 203314133
Query v5 videos endpoint to get data about the video. https://api.twitch.tv/kraken/videos/203314133
Finally, check the “status” field of the video data to ensure it is “recording”, that should ensure you have the right video.
Note you might be able to use helix for some (or all) of these endpoints, I didn’t check.
I’m really afraid of this assumption It’s like a lucky card and it’s kinda hard to base a business on it…
Is there any intentions to add such endpoint/option on the twitch side?
If you capture the /stream data during a stream then the relevant VOD and Stream Start times should be about the same as well.
Also, what is your usecase for tying a stream to a VOD. Perhaps we know of a way to help you better achieve your end goal instead of /stream/vod mismash
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.