Streams API returning incorrect results

I’m not sure if this is related to your issue exactly, but I actually had a similar problem with my PHP JSON format. It wasn’t limiting to a certain amount of results, which I wanted. It turned out it wasn’t the Twitch API, but more the json_decode variable I had set. I can’t remember exactly but I believe it was one of the “curl_setopt” functions that had caused my issue.
Here’s what I needed to get it working:

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $file);
curl_setopt($curl, CURLOPT_HTTPGET, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$content = curl_exec($curl);
curl_close($curl);
					
$response = json_decode($content, true);

Then in my case, I simply used this to fetch the info: $response[“display_name”]
Again, I’m not sure if it’s relevant to your issue but I thought I’d post, in case it helped.

1 Like