PHP code example of rkmaier / pubgapi

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

    

rkmaier / pubgapi example snippets



    'providers'     => array(

        //...
        Rkmaier\Pubgapi\PubgApiService::class,

    ),


    'aliases'       => array(

        //...
        'PubgApi' => Rkmaier\Pubgapi\Facades\PubgApi::class,

    ),



return [

    'api_url'=>'https://api.playbattlegrounds.com/shards/',
    'region' => 'pc-eu',
    'access_token' =>'',

];


PubgApi::status()

PubgApi::region('pc-na')

PubgApi::region('pc-na')->players('shroud')->get();

PubgApi::region('pc-eu')->player('<PLAYER_ID>')->get();

PubgApi::region('pc-eu')->player('<PLAYER_NAME')->get();

PubgApi::region('pc-eu')->seasons()->get();

PubgApi::region('pc-eu')->playerStats('<PLAYER_NAME')->get;

PubgApi::region('pc-eu')->playerStats('<PLAYER_NAME')->get(); // Current Season by default 

PubgApi::region('pc-eu')->playerStats('<PLAYER_NAME','SEASON_ID')->get;

PubgApi::region('pc-eu')->playerStats('<PLAYER_NAME')->stat('duo-fpp');

PubgApi::region('pc-eu')->playerStats('<PLAYER_NAME','<SEASON_ID>')->stat('duo-fpp');

PubgApi::region('pc-eu')->player('<PLAYER_NAME')->matches();

PubgApi::region('pc-eu')->match('<MATCH_ID>')->get();

PubgApi::region('pc-eu')->players('<PLAYER_ID1>','<PLAYER_ID2>','<PLAYER_ID3>')->limit(1)->offset(2)->get();



$data['access_token'] = '<YOUR PUBG DEV ACCESS TOKEN>'; 
$pubgAPi = new \Rkmaier\Pubgapi\PubgApiService($data); 
$pubgAPi->region('pc-eu')->players('rkmaier,molnarz,Istvan92,zuuup,Aigialeusz')->get());