Twitchfa-api client written with PHP for Twitchfa based on Coingecko-Api structure
For additional information about API visit Twitchfa v2 documentation
- PHP >= 7.52
- ext-json
- guzzlehttp/guzzle
The preferred way to install this extension is through composer.
Either run
$ composer require imorate/twitchfa-api
or add
"imorate/twitchfa-api": "^1.0"
use Twitchfa\TwitchfaClient;
$client = new TwitchfaClient();
$result = $client->twitch()->searchStreamers('mechiller');
You can get last response (ResponseInterface::class
) uses getLastResponse
method:
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();