Get streams repeatedly returning cursor "IA"

See title. I think this started yesterday when my script stopped working. I didn’t dig into it until today though. I’m seeing the following behavior:

   % curl -H "Authorization: Bearer $TWITCH_TOKEN" \
-X GET 'https://api.twitch.tv/helix/streams?user_id=30661033'
{"data":[{"id":"36361123280","user_id":"30661033","user_name":"saintvicious","game_id":"513143","type":"live","title":"Me Zed !comps","viewer_count":1921,"started_at":"2019-12-06T10:40:08Z","language":"en","thumbnail_url":"https://static-cdn.jtvnw.net/previews-ttv/live_user_saintvicious-{width}x{height}.jpg","tag_ids":["6ea6bca4-4712-4ab9-a906-e3336a9d8039"]}],"pagination":{"cursor":"IA"}}%                                   

Using the cursor just returns the same data and cursor:

   % curl -H "Authorization: Bearer $TWITCH_TOKEN" \
-X GET 'https://api.twitch.tv/helix/streams?after=IA&user_id=30661033'
{"data":[{"id":"36361123280","user_id":"30661033","user_name":"saintvicious","game_id":"513143","type":"live","title":"Me Zed !comps","viewer_count":1921,"started_at":"2019-12-06T10:40:08Z","language":"en","thumbnail_url":"https://static-cdn.jtvnw.net/previews-ttv/live_user_saintvicious-{width}x{height}.jpg","tag_ids":["6ea6bca4-4712-4ab9-a906-e3336a9d8039"]}],"pagination":{"cursor":"IA"}}%                                       

The behavior is mostly consistent. I occasionally get what looks like a reasonable cursor (although for this particular request there shouldn’t be a cursor at all):

   % curl -H "Authorization: Bearer $TWITCH_TOKEN" \
-X GET 'https://api.twitch.tv/helix/streams?user_id=30661033'
{"data":[{"id":"36361123280","user_id":"30661033","user_name":"saintvicious","game_id":"513143","type":"live","title":"Me Zed !comps","viewer_count":1913,"started_at":"2019-12-06T10:40:08Z","language":"en","thumbnail_url":"https://static-cdn.jtvnw.net/previews-ttv/live_user_saintvicious-{width}x{height}.jpg","tag_ids":["6ea6bca4-4712-4ab9-a906-e3336a9d8039"]}],"pagination":{"cursor":"eyJiIjpudWxsLCJhIjp7Ik9mZnNldCI6MX19"}}%     

And again, using the cursor just returns the same data and the “IA” cursor again:

   % curl -H "Authorization: Bearer $TWITCH_TOKEN" \
-X GET 'https://api.twitch.tv/helix/streams?after=eyJiIjpudWxsLCJhIjp7Ik9mZnNldCI6MX19&user_id=30661033'
{"data":[{"id":"36361123280","user_id":"30661033","user_name":"saintvicious","game_id":"513143","type":"live","title":"Me Zed !comps","viewer_count":1921,"started_at":"2019-12-06T10:40:08Z","language":"en","thumbnail_url":"https://static-cdn.jtvnw.net/previews-ttv/live_user_saintvicious-{width}x{height}.jpg","tag_ids":["6ea6bca4-4712-4ab9-a906-e3336a9d8039"]}],"pagination":{"cursor":"IA"}}%

Let me know if there is any additional data that I can provide. I haven’t checked if this is happening with any other endpoints.

For the first two you can just ignore the cursor since you requested a single stream.

When you specify a single user_id you’ll never have a second page.

So just ignore it.

It’s not the first time this one has cropped up.

It’s been passed on for investigation again

Thanks for the quick reply and for passing this on to investigation.

The single user_id was just an example. I’m actually calling /streams for every stream a given user follows.

Will results ever be paginated if the number of user_ids is less than first? I was operating under the assumption that the response might contain less than first objects since the documentation says “maximum”.

I’m not sure I’ve not tested it myself.

I’d expect that the number of user_id’s you specify override’s first

So if you specify 100 user_id’s you’ll get the streams of those 100 that are live if calling streams

I just tested it and the API does respect first. As a test I specified three user_ids and it paginated successfully. However, it took many attempts as sometimes it returned the bad cursor “IA”:

   % curl -H "Authorization: Bearer $TWITCH_TOKEN" \
-X GET 'https://api.twitch.tv/helix/streams?first=1&user_id=30661033&user_id=24124090&user_id=28640725'
{"data":[{"id":"36361123280","user_id":"30661033","user_name":"saintvicious","game_id":"513143","type":"live","title":"Me Zed !comps","viewer_count":2128,"started_at":"2019-12-06T10:40:08Z","language":"en","thumbnail_url":"https://static-cdn.jtvnw.net/previews-ttv/live_user_saintvicious-{width}x{height}.jpg","tag_ids":["6ea6bca4-4712-4ab9-a906-e3336a9d8039"]},{"id":"36362407344","user_id":"24124090","user_name":"DatModz","game_id":"512929","type":"live","title":"Finishing Darksiders Genesis - Unbiased Review | Light ARPG","viewer_count":1110,"started_at":"2019-12-06T18:00:26Z","language":"en","thumbnail_url":"https://static-cdn.jtvnw.net/previews-ttv/live_user_datmodz-{width}x{height}.jpg","tag_ids":["6ea6bca4-4712-4ab9-a906-e3336a9d8039","67259b26-ff83-444e-9d3c-faab390df16f","d0976a7e-26a7-4a48-9225-c522808540f2"]},{"id":"36362159712","user_id":"28640725","user_name":"LobosJr","game_id":"24241","type":"live","title":"~Final Fantasy Friday!~ | FFXIV First Character Continues!","viewer_count":835,"started_at":"2019-12-06T16:48:23Z","language":"en","thumbnail_url":"https://static-cdn.jtvnw.net/previews-ttv/live_user_lobosjr-{width}x{height}.jpg","tag_ids":["6ea6bca4-4712-4ab9-a906-e3336a9d8039"]}],"pagination":{"cursor":"IA"}}%                                                                                                                                                                                                                      

   % curl -H "Authorization: Bearer $TWITCH_TOKEN" \
-X GET 'https://api.twitch.tv/helix/streams?first=1&user_id=30661033&user_id=24124090&user_id=28640725'
{"data":[{"id":"36361123280","user_id":"30661033","user_name":"saintvicious","game_id":"513143","type":"live","title":"Me Zed !comps","viewer_count":2124,"started_at":"2019-12-06T10:40:08Z","language":"en","thumbnail_url":"https://static-cdn.jtvnw.net/previews-ttv/live_user_saintvicious-{width}x{height}.jpg","tag_ids":["6ea6bca4-4712-4ab9-a906-e3336a9d8039"]}],"pagination":{"cursor":"eyJiIjpudWxsLCJhIjp7Ik9mZnNldCI6MX19"}}%                                                                                                                                                                                                                                                                                                               

   % curl -H "Authorization: Bearer $TWITCH_TOKEN" \
-X GET 'https://api.twitch.tv/helix/streams?first=1&user_id=30661033&user_id=24124090&user_id=28640725'
{"data":[{"id":"36361123280","user_id":"30661033","user_name":"saintvicious","game_id":"513143","type":"live","title":"Me Zed !comps","viewer_count":2128,"started_at":"2019-12-06T10:40:08Z","language":"en","thumbnail_url":"https://static-cdn.jtvnw.net/previews-ttv/live_user_saintvicious-{width}x{height}.jpg","tag_ids":["6ea6bca4-4712-4ab9-a906-e3336a9d8039"]},{"id":"36362407344","user_id":"24124090","user_name":"DatModz","game_id":"512929","type":"live","title":"Finishing Darksiders Genesis - Unbiased Review | Light ARPG","viewer_count":1110,"started_at":"2019-12-06T18:00:26Z","language":"en","thumbnail_url":"https://static-cdn.jtvnw.net/previews-ttv/live_user_datmodz-{width}x{height}.jpg","tag_ids":["6ea6bca4-4712-4ab9-a906-e3336a9d8039","67259b26-ff83-444e-9d3c-faab390df16f","d0976a7e-26a7-4a48-9225-c522808540f2"]},{"id":"36362159712","user_id":"28640725","user_name":"LobosJr","game_id":"24241","type":"live","title":"~Final Fantasy Friday!~ | FFXIV First Character Continues!","viewer_count":835,"started_at":"2019-12-06T16:48:23Z","language":"en","thumbnail_url":"https://static-cdn.jtvnw.net/previews-ttv/live_user_lobosjr-{width}x{height}.jpg","tag_ids":["6ea6bca4-4712-4ab9-a906-e3336a9d8039"]}],"pagination":{"cursor":"IA"}}%                                                                                                                                                                                                                      

[... a few more "IA"s ...]

   % curl -H "Authorization: Bearer $TWITCH_TOKEN" \
-X GET 'https://api.twitch.tv/helix/streams?first=1&user_id=30661033&user_id=24124090&user_id=28640725&after=eyJiIjpudWxsLCJhIjp7Ik9mZnNldCI6MX19'
{"data":[{"id":"36362407344","user_id":"24124090","user_name":"DatModz","game_id":"512929","type":"live","title":"Finishing Darksiders Genesis - Unbiased Review | Light ARPG","viewer_count":1117,"started_at":"2019-12-06T18:00:26Z","language":"en","thumbnail_url":"https://static-cdn.jtvnw.net/previews-ttv/live_user_datmodz-{width}x{height}.jpg","tag_ids":["6ea6bca4-4712-4ab9-a906-e3336a9d8039","67259b26-ff83-444e-9d3c-faab390df16f","d0976a7e-26a7-4a48-9225-c522808540f2"]}],"pagination":{"cursor":"eyJiIjp7Ik9mZnNldCI6MH0sImEiOnsiT2Zmc2V0IjoyfX0"}}%                                                                                                                                                                                  

   % curl -H "Authorization: Bearer $TWITCH_TOKEN" \
-X GET 'https://api.twitch.tv/helix/streams?first=1&user_id=30661033&user_id=24124090&user_id=28640725&after=eyJiIjp7Ik9mZnNldCI6MH0sImEiOnsiT2Zmc2V0IjoyfX0'
{"data":[{"id":"36361123280","user_id":"30661033","user_name":"saintvicious","game_id":"513143","type":"live","title":"Me Zed !comps","viewer_count":2128,"started_at":"2019-12-06T10:40:08Z","language":"en","thumbnail_url":"https://static-cdn.jtvnw.net/previews-ttv/live_user_saintvicious-{width}x{height}.jpg","tag_ids":["6ea6bca4-4712-4ab9-a906-e3336a9d8039"]},{"id":"36362407344","user_id":"24124090","user_name":"DatModz","game_id":"512929","type":"live","title":"Finishing Darksiders Genesis - Unbiased Review | Light ARPG","viewer_count":1110,"started_at":"2019-12-06T18:00:26Z","language":"en","thumbnail_url":"https://static-cdn.jtvnw.net/previews-ttv/live_user_datmodz-{width}x{height}.jpg","tag_ids":["6ea6bca4-4712-4ab9-a906-e3336a9d8039","67259b26-ff83-444e-9d3c-faab390df16f","d0976a7e-26a7-4a48-9225-c522808540f2"]},{"id":"36362159712","user_id":"28640725","user_name":"LobosJr","game_id":"24241","type":"live","title":"~Final Fantasy Friday!~ | FFXIV First Character Continues!","viewer_count":835,"started_at":"2019-12-06T16:48:23Z","language":"en","thumbnail_url":"https://static-cdn.jtvnw.net/previews-ttv/live_user_lobosjr-{width}x{height}.jpg","tag_ids":["6ea6bca4-4712-4ab9-a906-e3336a9d8039"]}],"pagination":{"cursor":"IA"}}%                                                                                                                                                                                                                      

[... a couple more "IA"s ...]

   % curl -H "Authorization: Bearer $TWITCH_TOKEN" \
-X GET 'https://api.twitch.tv/helix/streams?first=1&user_id=30661033&user_id=24124090&user_id=28640725&after=eyJiIjp7Ik9mZnNldCI6MH0sImEiOnsiT2Zmc2V0IjoyfX0'
{"data":[{"id":"36362159712","user_id":"28640725","user_name":"LobosJr","game_id":"24241","type":"live","title":"~Final Fantasy Friday!~ | FFXIV First Character Continues!","viewer_count":830,"started_at":"2019-12-06T16:48:23Z","language":"en","thumbnail_url":"https://static-cdn.jtvnw.net/previews-ttv/live_user_lobosjr-{width}x{height}.jpg","tag_ids":["6ea6bca4-4712-4ab9-a906-e3336a9d8039"]}],"pagination":{"cursor":"eyJiIjp7Ik9mZnNldCI6MX0sImEiOnsiT2Zmc2V0IjozfX0"}}%

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