PHP code example of imorate / twitchfa-api

1. Go to this page and download the library: Download imorate/twitchfa-api 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/ */

    

imorate / twitchfa-api example snippets


use Twitchfa\TwitchfaClient;

$client = new TwitchfaClient();
$result = $client->twitch()->searchStreamers('mechiller');

use Twitchfa\TwitchfaClient;

$client = new TwitchfaClient();
$result = $client->twitch()->searchStreamers('fk_orca');
$response = $client->getLastResponse();
$headers = $response->getHeaders();

use Twitchfa\TwitchfaClient;

$client = new TwitchfaClient();
$result = $client->twitch()->getBanners();

use Twitchfa\TwitchfaClient;

$client = new TwitchfaClient();
$result = $client->twitch()->getNotifications();

use Twitchfa\TwitchfaClient;

$client = new TwitchfaClient();
$result = $client->twitch()->searchStreamers('fk_orca');

use Twitchfa\TwitchfaClient;

$client = new TwitchfaClient();
$accessToken = 'eyJhbGciOiJSUzI...';
$result = $client->twitch()->getFollowing($accessToken);

use Twitchfa\TwitchfaClient;

$client = new TwitchfaClient();
$accessToken = 'eyJhbGciOiJSUzI...';
$result = $client->twitch()->getSelf($accessToken);

use Twitchfa\TwitchfaClient;

$client = new TwitchfaClient();
$result = $client->twitch()->getStreamers(1,10);

use Twitchfa\TwitchfaClient;

$client = new TwitchfaClient();
$result = $client->twitch()->addStreamer('some_random_username');

use Twitchfa\TwitchfaClient;

$client = new TwitchfaClient();
$result = $client->twitch()->getTwitchStats();