The following will retrieve a channel
object for the twitch
channel and echo the response.
$channelsApi = 'https://api.twitch.tv/kraken/channels/';
$channelName = 'twitch';
$clientId = '...';
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_HTTPHEADER=> array(
'Client-ID: ' . $clientId
),
CURLOPT_RETURNTRANSFER=> true,
CURLOPT_URL => $channelsApi . $channelName
));
$response = curl_exec($ch);
curl_close($ch);
echo $response;