I have posted this issue before… but it is still not fixed.
I am running the following code:
$client->get('https://api.twitch.tv/helix/streams', [
'headers' => [
'Authorization' => 'Bearer '.$token,
'Client-ID' => $client_id,
],
'query' => [
'game_id' => ["10872","10970","11406","16951","18902","23579","27098","29448","30639","313204","31568","458126","460167","461067","476449","488615","490500","490698","490709","494544","494995","496464","497385","497877","500626","502447","510578","510799","5218","5645","9041"],
'language' => [],
'type' => 'live',
'first' => 100,
'after' => '',
],
]);
It fetches for a list of live streams playing the specific list of games. There are literally thousands of streams which fit these parameters; but it limits to the top 100. So what it should do, is return the first 100, then give me a “pagination cursor”, so I can get the next group of 100 by putting that cursor value into the after
field. I loop through this 5 times, to get the top 500 streams that match these parameters.
Sometimes I will get proper results. However, more often than not, I will not get proper results. Instead of getting the first 100… I will instead get around 40-60 results, and it will return a VERY SPECIFIC cursor value:
eyJiIjp7IkN1cnNvciI6ImV5SnpJam95TVRjeExqazBNak0xTVRneU5EVTVNRE1zSW1RaU9tWmhiSE5sTENKMElqcDBjblZsZlE9PSJ9LCJhIjp7IkN1cnNvciI6IiJ9fQ
This pagination cursor specifically means there are no more pages. But as I said, there should be over 500 streams right now that fit my parameters. I can keep on re-running the script, and eventually I will get proper results… but I shouldn’t have to do this.