Skip to content

CMarketItem

Alex Corn edited this page Apr 2, 2022 · 3 revisions

A class which stands for an item on the Steam Community Market. Cannot be instantiated directly, it must be received from a call to getMarketItem.

Currently, non-USD currencies are not supported.

Properties

commodity

true if this is a commodity item (buy/sell orders) or false otherwise

commodityID

If this is a commodity item, this will be the item's commodity ID. Not defined otherwise.

medianSalePrices

An array containing objects of the following structure:

  • hour - A Date object representing the hour that this object contains data for
  • price - The median price at which this item was sold during this hour (as a float)
  • quantity - The amount of this item which was sold during this hour

quantity

How many copies of this item are currently available on the market.

lowestPrice

The lowest price at which this item is sold, in cents.

buyQuantity

If this is a commodity, how many buy orders there are for this item. Not defined otherwise.

highestBuyOrder

If this is a commodity, the value of the highest buy order for this item, in cents. Not defined otherwise.

Methods

updatePrice(currency, callback)

  • currency - The Steam currency code you want prices in (e.g. 1 for USD)
  • callback - Fired when the data is updated.
    • err - null on success, an Error object on failure

If this is a commodity item, you can call this to fetch the latest prices. If not a commodity, this will throw an Error. Once complete, quantity, lowestPrice, buyQuantity, and highestBuyOrder will be updated.