1. Go to this page and download the library: Download ptrtn/battlerite 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/ */
$client = \PtrTn\Battlerite\Client::create('your-api-key');
// Retrieve matches for a specific player for the last 24 hours
$matches = $client->getMatches(
MatchesQuery::create()
->forPlayerIds(['934791968557563904'])
->withStartDate(new DateTime('-1 day'))
);
$client = \PtrTn\Battlerite\Client::create('your-api-key');
// Retrieve a list of players for a specific player name
$players = $client->getPlayers(
PlayersQuery::create()
->forPlayerNames(['PlakkeStrasser'])
);