Helix Top Clips

Hello there, is there any chance some of you can demonstrate how to use the parameters before and after defined in the Helix API top clips endpoint? I tried to search for examples or other people codes but found no solution yet.

As per the docs:

Before and after are used to paginate.

The example response:

{"data":
  [{
    "id":"RandomClip1",
    "url":"https://clips.twitch.tv/AwkwardHelplessSalamanderSwiftRage",
    "embed_url":"https://clips.twitch.tv/embed?clip=RandomClip1",
    "broadcaster_id":"1234",
    "broadcaster_name": "JJ",
    "creator_id":"123456",
    "creator_name": "MrMarshall",
    "video_id":"1234567",
    "game_id":"33103",
    "language":"en",
    "title":"random1",
    "view_count":10,
    "created_at":"2017-11-30T22:34:18Z",
    "thumbnail_url":"https://clips-media-assets.twitch.tv/157589949-preview-480x272.jpg"
  },
  ...
  ]
  "pagination": {"cursor": "eyJiIjpudWxsLCJhIjoiIn0"}
}

Returns a pagination -> cursor key.

You pass this in after, to go to the next page, and you pass this to before to go back a page.

Basically the same as saying “give me page 5” but you use the cursor instead.

After:

Cursor for forward pagination: tells the server where to start fetching the next set of results, in a multi-page response. This applies only to queries specifying broadcaster_id or game_id. The cursor value specified here is from the pagination response field of a prior query.

Hope that helps

Hey Barry, thanks for the input, I will try it out and let you know if it works for me. I’m basically trying to get top weekly/montly/daily clips of a channel and thats the only way I thought off.

Then you actually want: this Kraken/v5 end point

Instead

Name Type Description
period string The window of time to search for clips. Valid values: day, week, month, all. Default: week.
trending boolean If true, the clips returned are ordered by popularity; otherwise, by viewcount. Default: false.

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