PHP code example of corbpie / twitch-api-class

1. Go to this page and download the library: Download corbpie/twitch-api-class library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

corbpie / twitch-api-class example snippets




use Corbpie\TwitchApiClass\twitchWrapper;

$call = new twitchWrapper();

echo $call->accessCodeUrl();

$call->getTopStreams();

$call->getGameTopStreams($gameid);

$call->getGameTopStreams($gameid);
echo $call->getTopStreamerForGame();

$call->getGameTopStreams($gameid);
echo $call->getTopViewersForGame();

$call->getTopGames();

$call->getUserDetails($username);

$call->getUserDetails($username);
$user_id = $call->idForUser();

$call->getUserEmotes($username);

$call->emoteImage($emoteid);

$call->chatForVod($vod_id, $offset);

$call->getUserStream($username);

$call->getUserStream($username);
$call->userIsLive();//true for live | false for not live

$call->streamGameId();

$call->streamViewers();

$call->streamTitle();

$call->streamId();

$call->streamStart();

$call->streamThumbnail();

$call->getStreamTags($streamid);

$call->getGameClips($gameid);

$call->getUserClips($user);

$call->getUserVideos($user);

$call->getUserVideosForGame($user, $game_id);

$call->getGameData($game_id);

$call->getGameData($game_id);
$game_name = $call->gameName();

$call->getGameData($game_id);
$game_name = $call->gameArtwork();

$call->getGameData($game_id);
$game_name = $call->gameArtwork();

//array return call here Eg:$call->getUserDetails('shroud');
$custom = $call->getCustom(0, 'type');
src/twitchWrapper.php