Empty results from api.twitch.tv/helix/channels/followers

Hey there! I have empty results from this query. They used to work fine last year. What am I doing wrong?

<?php
$TOKENT = "xxx";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.twitch.tv/helix/channels/followers?broadcaster_id=180523751&first=1");
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'Client-ID: xxx',
    'Authorization: Bearer ' . $TOKENT,
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($ch);
var_dump($result);
curl_close($ch);
$json = json_decode($result, true);
$likes = $json['total'];
?>

string(39) “{“total”:128,“data”:,“pagination”:{}}”

Then one of the following applies:

  • token is not of type user
  • token is lacks the relevant scope
  • the user token has the scope, but the user is not a mod (or better) of the channel

I use app credentials to get this data. It worked for years and now is broken for some reason.

The authentication requirements for this API changed.

I see now. Wow, thanks.

Get Channel Followers

Authorization

  • Requires a user access token that includes the moderator:read:followers scope.
  • The ID in the broadcaster_id query parameter must match the user ID in the access token or the user ID in the access token must be a moderator for the specified broadcaster.

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