Skip to content

CEconItem

Alexander Corn edited this page Dec 21, 2015 · 2 revisions

A class which represents an item within the Steam Economy. Returned by calls to CSteamUser#getInventory or SteamCommunity#getUserInventory.

Properties

Contains many properties which come directly from Steam and can change at any time. Properties of note are listed below:

id

The item's unique ID within its app+context.

assetid

Alias of id.

contextid

The ID of the context within the app in which the item resides.

appid

The ID of the app which owns the item.

classid

The first half of the item cache identifier. The classid is enough to get you basic details about the item.

instanceid

The second half of the item cache identifier.

amount

How much of this item is in this stack.

pos

The item's position within the inventory (starting at 1). Not defined if this item wasn't retrieved directly from an inventory (e.g. from a trade offer or inventory history).

name

The item's display name.

market_hash_name

The item's universal market name. This identifies the item's market listing page.

name_color

The render color of the item's name, in hexadecimal.

background_color

The displayed background color, in hexadecimal.

type

The "type" that's shown under the game name to the right of the game icon.

tradable

true if the item can be traded, false if not.

marketable

true if the item can be listed on the Steam Community Market, false if not.

commodity

true if, on the Steam Community Market, this item will use buy orders. false if not.

market_tradable_restriction

How many days for which the item will be untradable after being sold on the market.

market_marketable_restriction

How many days for which the item will be unmarketable after being sold on the market.

descriptions

An array of objects containing information about the item. Displayed under the item's type.

fraudwarnings

An array of strings containing "fraud warnings" about the item. In inventories and trades, items with fraud warnings have a red (!) symbol, and fraud warnings are displayed in red under the item's name.

tags

An array of objects containing the item's inventory tags.

app_data

Not always present. An object containing arbitrary data as reported by the game's item server.

Methods

getImageURL()

Returns a URL where this item's image can be downloaded. You can optionally append a size as such:

var url = item.getImageURL() + "128x128";

getLargeImageURL()

Same as getImageURL(), except for the item's large image, if present.

getTag(category)

  • category - A string containing the tag's category (the category property of the tag object)

Returns a specific tag from the item, or null if it doesn't exist

You can’t perform that action at this time.