Retrieve VOD ID by stream ID

I’d like to retrieve VOD ID by Stream ID. Is there any option to do it with the Helix api?

1 Like

Unfortunately there is no way to do that right now, either in Kraken or in the new Twitch API (aka Helix).

Sorry! :frowning:

I actually think you can, but it’s not exactly clean. Here’s the flow:

  1. Using stream id, get stream data via v5 endpoint:

  2. Extract streamer’s user id from stream data: 44338537

  3. Use stream id to query Helix videos endpoint:

  4. 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).

  5. Extract the first video’s (streaming VOD with any luck) ID: 203314133

  6. Query v5 videos endpoint to get data about the video.

  7. 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 :slight_smile: 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.