PHP code example of florianorineveu / ow-api-php

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

    

florianorineveu / ow-api-php example snippets




OwAPI\Client;

$client = new Client(); 

// Get profile data for player Ori#21337 (it's me!), 
$response = $client->profile(Client::PLATFORMS['PC'], Client::REGIONS['EU'], 'Ori#21337');

// Read the response
if ($response->isSuccess()) {
    echo $response->getBody()['name'];
}

// Other available methods:
// - ALL profile data, heavy endpoint
$completeStats = $client->completeStats(Client::PLATFORMS['PC'], Client::REGIONS['EU'], 'Ori#21337');

// - Get profile data for specific heroes:
$heroesStats = $client->heroes(
    Client::PLATFORMS['PC'],
    Client::REGIONS['EU'],
    'Ori#21337',
    ['brigitte', 'mercy', 'ana']
);