PHP code example of iceq1337 / steam-inventory-api

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

    

iceq1337 / steam-inventory-api example snippets


use SteamInventory\Inventory;

$options = [
    'steamid' => '76561198129782984',
    'appid' => 753, // default: 753
    'contextid' => 6, // default: 6
    'language' => 'english', // default: 'english'
    'all_items' => false, // default: false
    'count' => 100, // default: 500, max: 5000
    'start_assetid' => null, // default: null, used for consecutive requests
];

$inventory = new Inventory($options);
$items = $inventory->getItems();
$total = $inventory->total_inventory_count;

foreach ($items as $item) {
    echo $item->getName() . "<br>";
}
shell
composer