Get all Steam Items

Asked

Viewed 65 times

0

Well, I have the following code that gets you items from a particular player’s inventory. However it only shows me 1 type of each item, ie if the player has 5 boxes of the same type, it only shows me 1 box.

How do I show all boxes?

Code:

$steamid = $_COOKIE["steamid"];






$destUrl = 'http://steamcommunity.com/profiles/' . $steamid . '/inventory/json/730/2/';

$data = file_get_contents($destUrl, false);
$data = json_decode($data, true);
$data1= array_keys($data['rgDescriptions']);
$data2= $data['rgDescriptions'];
for($i = 0; $i < count($data1); ++$i) {

    echo '<br> ID: '. $data1[$i];
    echo '<br> Name: '. $data2[$data1[$i]]['name'];
    echo '<br> Market_Hash_Name: '. $data2[$data1[$i]]['market_hash_name'];
    echo '<br> Market_Name: '. $data2[$data1[$i]]['market_name'];
    echo '<br>';


}

Thank you

  • Could you show me which doc you got this link for inventory check? I can’t run the link at all!

  • The link is here: http://steamcommunity.com/id/CSGOSort/inventory/json/730/2/

  • Maybe just show a box, 'cause maybe there’s a field quantidade mark five, as in your example. Put the print_r of $data

  • There is a field amount, that tells you how many items he has of that guy

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.