PHP code example of webrepin / hltv-api

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

    

webrepin / hltv-api example snippets


     
    use HltvApi\Client;
    
    $client = new Client();
    
    

    use HltvApi\Entity\Entity;
    

         
    use HltvApi\Client;
   
    $client = new Client();
 
    $matches = $client->ongoing();
 
    foreach ($matches as $match) {
       echo $match->getTeam1();
       echo $match->getTeam2();
       echo $match->getMatchUrl();
       echo $match->getMatchUrl();
    }
    

    echo $match->details()->getOdds()
    echo $match->details()->getMapName(1)
    echo $match->details()->getMapScore(1)
    echo $match->details()->getMapResults(1)
    

         
    use HltvApi\Client;
   
    $client = new Client([
       ['0.0.0.0', '80', CURLPROXY_SOCKS5],
       ['0.0.0.0', '443', CURLPROXY_HTTP],
       ...
    ]);