PHP code example of ge-tracker / osrs-api

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

    

ge-tracker / osrs-api example snippets

bash
php artisan vendor:publish --provider="GeTracker\OsrsApi\OsrsApiServiceProvider"
 php
public function execute(OsrsApi $osrsApi)
{
    $item = $osrsApi->ge()->itemDetail(13576);
    echo $item->id . ': ' . $item->name;
}
 php
public function execute(OsrsApi $osrsApi)
{
    $hiscores = $osrsApi->hiscores()->fetch('Lynx Titan');
    
    echo 'Attack: ' . $hiscores->stats->attack->level;
}