t3sted Posted May 5 Report Share Posted May 5 I just started using this module and I'm having trouble getting Steam inventory history. The following code always returnsĀ "Error: Malformed page: no trade found": // set options for the inventory history request const options = { direction: 'past', // retrieve trades that occurred further in the past than startTime resolveVanityURLs: true, // resolve custom profile URLs to Steam IDs }; // make the API request to retrieve the inventory history data community.getInventoryHistory(options, (err, history) => { if (err) { console.error(err); process.exit(); } // print the inventory history to the console console.log(`Inventory history (${history.trades.length} trades):`); for (const trade of history.trades) { console.log(`- ${trade.date.toISOString()}: Traded with ${trade.partnerName}`); console.log(` Received: ${trade.itemsReceived.map(item => item.name).join(', ')}`); console.log(` Given: ${trade.itemsGiven.map(item => item.name).join(', ')}`); } process.exit(); }); Does anyone know why this might be happening? TYIA Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted May 6 Report Share Posted May 6 getInventoryHistory is deprecated and I'd be surprised if it still works. You should use IEconService/GetTradeHistory instead. Quote Link to comment Share on other sites More sharing options...
t3sted Posted May 6 Author Report Share Posted May 6 Thanks for your reply. Everyone who's written Steam APIs seems to conflate trade history and inventory history. I'm really after complete inventory history; unfortunately, trade history doesn't account for market transactions. I suppose some combination of the two might be my only option. Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted May 6 Report Share Posted May 6 getInventoryHistory was written years ago, before the inventory history page showed more than just trades. I'm not aware of anything that scrapes the newer full inventory history page. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.