Getting info about my channel?

What method I must to use for getting information about my channel? For example, I wanna get access to the list of my subscribers via php, or js? What I must to do at first, second, etc… And is it possible without OAuth token?

I use simple code, it’s my first querry. It’s an example from first page on new api dev tut,
but I need more, as I said before… I need to get subs list of my chan. Thx.

<?php
$channelsApi = 'https://api.twitch.tv/helix/streams';
$channelName = 'cName';
$clientId = 'cId';
 $ch = curl_init();
 curl_setopt_array($ch, array(
    CURLOPT_HTTPHEADER => array(
       'Client-ID: ' . $clientId,
       'game_id: 33214'
    ),
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_URL => $channelsApi
 ));
 $response = curl_exec($ch);
 curl_close($ch);

 $json = json_decode($response, true);
 var_dump($json);
?>

If you want subscribers, no, you will need an oAuth token with the relevant scope applied. As Subscribers is privileged data.

Covers authentication, you will need “oAuth Authorization Code Flow”

Covers the Subscriptions endpoint.

curl -H 'Accept: application/vnd.twitchtv.v5+json' \
-H 'Client-ID: uo6dggojyb8d6soh92zknwmi5ej1q2' \
-H 'Authorization: OAuth cfabdegwdoklmawdzdo98xt2fo512y' \
-X GET 'https://api.twitch.tv/kraken/channels/129454141/subscriptions'

You’ll also need to be able to offset/paginate thru the list, this is a kraken end point so doesn’t “paginate” itself but it does support limit/offset

1 Like

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