t3sted Posted May 5, 2023 Report Posted May 5, 2023 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
Dr. McKay Posted May 6, 2023 Report Posted May 6, 2023 getInventoryHistory is deprecated and I'd be surprised if it still works. You should use IEconService/GetTradeHistory instead. Quote
t3sted Posted May 6, 2023 Author Report Posted May 6, 2023 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
Dr. McKay Posted May 6, 2023 Report Posted May 6, 2023 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
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.