Endpoint https://api.twitch.tv/helix/clips
will return pagination cursors that loop infinitely as the last pagination cursor returns the first pagination cursor.
Initial request:
curl -H 'Client-ID: <clientId>' -X GET 'https://api.twitch.tv/helix/clips?broadcaster_id=129117300&first=100'
Response:
{"data":[...],"pagination":{"cursor":"eyJiIjpudWxsLCJhIjp7IkN1cnNvciI6Ik1UQXcifX0"}}
Request with last pagination cursor in chain:
curl -H 'Client-ID: <clientId>' -X GET 'https://api.twitch.tv/helix/clips?broadcaster_id=129117300&first=100&after=eyJiIjpudWxsLCJhIjp7IkN1cnNvciI6IiJ9fQ'
Response:
{"data":[...],"pagination":{"cursor":"eyJiIjpudWxsLCJhIjp7IkN1cnNvciI6Ik1UQXcifX0"}}
The pagination cursor in the final request returns the same pagination cursor in the first request which causes pagination to loop endlessly as there is no halting condition.
In previous times when I ran my script I believe the last pagination cursor was set to the string “null” which provided a way to halt the script.
Please confirm if this is a bug or if there is a different way to determine the halting condition.
Many thanks.