Creating a clip at a precise moment with a bot?

Hello,

I’m trying to create a bot that is able to create a clip at a precise moment and give back the URL of the clip. Does the API support this feature ?

clips get created by POSTing to https://clips.twitch.tv/clips with this data:

{
    "player_backend_type": "player_core",
    "channel": "name_of_the_channel",
    "offset": "1234",
    "broadcast_id": "12345678",
    "vod_id": "",
    "play_session_id": "76cfad875fb8b5b6c76d55db76df"
}

This is undocumented, probably not meant for 3rd party use, and I haven’t tried it. But I can tell you this from observation:

  • offset is in seconds, since the start of the broadcast or the vod
  • only broadcast_id or vod_id gets submitted, depending on what you create the clip from. the vod_id is the same that is in the url, so no surprise there
  • play_session_id apparently is a random token. I haven’t looked at how it gets acquired, and doing the above request always returned a 500 error for me so far.

So to get this to work, it needs a bit more investigation

Thanks a lot ! So I have my Java program and I should make a POST request to the url you gave me and then transmit the data in the brackets ? Can you give me an example ?

No. As I said, I didn’t get it to work, and I don’t plan on figuring it out and writing a Java tutorial on it, sorry

Ok that’s nice you answered :smiley: I know where to dig in now.

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