My understanding is that https://api.twitch.tv/helix/clips
will return the first x
clips from a channel or game, and the pagination
value can then be used to get the next x
clips in the sequence and a new pagination value. This behavior currently works for /streams
.
/clips?after=[pagination]
will return the next sequence of clips, however, the pagination
value returned will be the same as the one that was sent, meaning you can get at most two pages worth of results.
First request:
curl -H 'Client-ID: removed' -X GET 'https://api.twitch.tv/helix/clips?broadcaster_id=37402112&first=5'
{"data":
[{
"id":"TallSpeedyWasabiThisIsSparta",
"url":"https://clips.twitch.tv/TallSpeedyWasabiThisIsSparta",
"embed_url":"https://clips.twitch.tv/embed?clip=TallSpeedyWasabiThisIsSparta",
"broadcaster_id":"37402112",
"broadcaster_name":"shroud",
"creator_id":"95718870",
"creator_name":"crowexia",
"video_id":"282660163",
"game_id":"460630",
"language":"en",
"title":"shroud actually banned from PUBG",
"view_count":1034942,"created_at":"2018-07-10T01:43:43Z",
"thumbnail_url":"https://clips-media-assets2.twitch.tv/AT-cm%7C269177107-preview-480x272.jpg"},
...
],
"pagination":{"cursor":"eyJiIjpudWxsLCJhIjp7IkN1cnNvciI6Ik5RPT0ifX0"}}
Second request with &after=[pagination]
:
curl -H 'Client-ID: removed' -X GET 'https://api.twitch.tv/helix/clips?broadcaster_id=37402112&first=5&after=eyJiIjpudWxsLCJhIjp7IkN1cnNvciI6Ik5RPT0ifX0'
{"data":
[{
"id":"PiercingVenomousCatPastaThat",
"url":"https://clips.twitch.tv/PiercingVenomousCatPastaThat",
"embed_url":"https://clips.twitch.tv/embed?clip=PiercingVenomousCatPastaThat",
"broadcaster_id":"37402112",
"broadcaster_name":"shroud",
"creator_id":"14558374",
"creator_name":"Chesner",
"video_id":"362325296",
"game_id":"491931",
"language":"en",
"title":"Shroud gets called out by Pewds",
"view_count":510961,"created_at":"2019-01-11T20:03:21Z",
"thumbnail_url":"https://clips-media-assets2.twitch.tv/AT-cm%7C377053130-preview-480x272.jpg"},
...
],
"pagination":{"cursor":"eyJiIjpudWxsLCJhIjp7IkN1cnNvciI6Ik1UQT0ifX0"}}