Pull Sub, View & Bit Count With Helix API

I’ve gotten my follower count to pull from the helix API, How would I go about getting sub, total views and bits count to pull.

Here is my follower count code:


function file_get_contents_curl($url) {
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
        'Client-ID: xxxxxxxxxxxxxxxxxxxxxxxxx'

    $data = curl_exec($ch);
    return $data;

$url = 'https://api.twitch.tv/helix/users/follows?to_id=280137643';
$json_array = json_decode(file_get_contents_curl($url), true);

echo $json_array['total']; ?>


Iterate all pages and do the math

You don’t theres no such API for bit count/historical all time totals for what you have received

There is the leaderboard, but thats well the leaderboard

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