Steam Inventory History
This small module allows you to easily retrieve the trade history for your Steam account from Node. It works by parsing the inventory history page and only supports English.
This might be useful to check if a "failed" trade offer actually went through.
Just install it from npm:
$ npm install steam-inventoryhistory
This module exports a class, so you'll need to instantiate an instance of it:
var InventoryHistory = ;var history = ;
Then, set it up with your cookies. You can get these from node-steam's
// Example using node-steamsteam;
Finally, you can call the
getHistory method to get your inventory history.
Adds a single cookie to the internal cookie jar. The
setCookies method just calls this method once for each cookie in the array.
The meat and potatoes. This method actually retrieves the trade history. There's an optional
options parameter which should be an object containing up to two properties:
page- The page number of inventory history to retrieve, starting at 1. There are 30 items per page. Defaults to 1.
resolveVanityURLs- The inventory history page doesn't give Steam IDs for users who have configured a custom profile URL. If this is specified, then
node-steam-inventoryhistorywill request the XML profile of each unique trader to get their Steam IDs. Defaults to
The callback will receive two parameters:
err- An error that occurred, or
history- An object containing the data on the requested history page:
first- The index of the first trade on this page, starting from 1, where 1 is the most recent trade we've made. For example, if you request page 3 and there are 30 items per page, this will be 61.
last- The index of the last trade on this page.
totalTrades- The total number of trades in your history.
trades- An array containing the trades on this page:
date- A Date object for the date and time when this trade took place.
partnerName- The current profile name of the person you traded with.
partnerSteamID- The 64-bit Steam ID of the person you traded with. This will be
nullif they have a custom URL and you didn't specify
partnerVanityURL- The custom profile URL of the person you traded with, if it exists.
nullif they don't have one.
itemsReceived- An array of items you received.
itemsGiven- An array of items you lost.
Note that this method may take quite some time to complete since Steam generally takes a while to generate and send the inventory history page.