I get inaccurate information when I request the first streams of the Get Streams route

Hi, I am developing a library in NodeJS using the Twitch API to facilitate the search for live streams. I use this documentation: Reference | Twitch Developers

When I want to search for the first 100 streams in the Spanish language or any other language, the information is not always accurate, sometimes I get 98 streams, other times 100 streams, and others 95, the search never works perfectly. I use this route: https://api.twitch.tv/helix/streams?language=es&first=100

I thought it could be because of the combination of the “first” and “language” parameters but if I only search the first 100 streams without specifying any language, I still get inaccurate information.

It is also not because of the search for 100 streams, because when I search for 10 streams many times I can get 9 or 8 streams and my API calls are not frequent

Does anyone know the reason why the API response is not exact or had a similar problem that they have been able to solve? I can create the npm library but when developers use the search the result they will get will be inaccurate

What you found is pretty normal in my experience. IE: it’s not broken, there is nothing for you to fix

Why it happens no idea. I could speculate to the cows come home, but it’s all speculation.

Basically sometimes you won’t get 100 channels when using first 100

Example: Browser Categories | Twitch API Example

Here it’s just the game filter. You’ll also get first != record cound when loading with zero filters and just paginating

Oops, I can’t do anything, so I’ll just write a warning in my library’s documentation. To explain that the Twitch API doesn’t always respond with the parameters I request,

1 Like

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