Is there any legit way to fetch chat replay together with clips using the Clips Discovery API?
There is no documented, legit, way from the Twitch docs.
I beleive you know the Endpoint that is used by twitch.tv which is, of course, not recommended to use:
https://rechat.twitch.tv/rechat-messages?start={timestamp}&video_id={videoId}
HerrAusragend, is it still working? I’m getting invalid video id error every time.
Example clip: Twitch
Example chat rechat url: https://rechat.twitch.tv/rechat-messages?video_id=v138558182&offset_seconds=11490
Pretty sure you could call GetClip on the slug CleanPuzzledSandstormDxAbomb and get enough information to build the rechat url. Not 100% sure though, haven’t tried it.
Edit:
Keep in mind, rechat urls are not documented and supported by Twitch. They can change at anytime without notification.
Edit 2:
Alright, just managed to write code to do this. Basically the flow is below:
- Call GetClip using the following endpoint. Insert the slug of the clip you’re interested in at the end of the endpoint: https://api.twitch.tv/kraken/clips/slug_goes_here
- Using the returned json object, access the VOD object, and store the VOD Id and VOD url.
VOD Id will look like this: 138559162
VOD URL will look like this: Twitch - The rechat url wants the video_id= in the format of v{vod_id}.
- To get the offset_seconds, simply convert the t argument in the VOD URL to seconds. So for the above example, it’d be: (36060) + (11 * 60) + 28. You’ll want to add 2 seconds as well, as the VOD URL deducts 2 seconds from the clip.
- Once you have the VOD Id and the offset_seconds, simply build the rechat URL, and make a call to it to get the chat for that clip: https://rechat.twitch.tv/rechat-messages?video_id=v138558182&offset_seconds=11490
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.