-
Notifications
You must be signed in to change notification settings - Fork 7
ISteamEconomy
Steam economy item related stuff. Be sure to look at IEconService for trading stuff.
| Method | Description |
|---|---|
| GetAssetClassInfo | Access item specific details by class and instance IDs. |
| GetAssetPrices | Find prices of purchasable in-game items. |
Access item specific details by class and instance IDs. You can pass any objects that have a class ID, and you can use instance IDs for more specific details on a certain item. Items returned from GetTradeHistory can be passed directly to this function!
The Steam Web API goes through each item one at a time, and stops giving results as soon as an item can't be located. I.e.: You pass 10 items, and all items except the 4th item are valid, however because the 4th failed, Steam returns immediately and only 3 items are in the response.
NOTE: If you only pass a single item, the result will be that item object itself, rather than being an object with a count and items object.
getItemInfo(appID, items)
appID required
Type:
IntegerSteam internal app ID, can also be a string
items required
Type:
Object/ Array of ObjectsAn object or array of objects defining items. They must include a
classID, and may optionally include aninstanceID to get more specific details about the item.
Integer
count
Total number of items returned. If this is less than the number passed, then one of the items failed. Only included if more than one item was requested.Object
items
Item objects listed by theirclassID. If aninstanceID was passed for a certain item, then that name is{{class}}_{{instance}}. Only included if more than one item was requested.String
name
Short name of the itemString
nameColor
Hexadecimal color that the name should be shown asString
type
Specific type of the item. Can be used for categorizing items.String
marketName
Name shown in the market, exact search nameString
marketHash
URL form of the market nameString
marketUrl
Full URL to the market page for this kind of itemBoolean
tradable
Whether this kind of item is tradableBoolean
marketable
Whether this kind of item is marketableBoolean
commodity
Whether this kind of item is a commodity, meaning all items are technically identicalInteger
tradeRestriction
Number of days this item will not be tradable after buying from the market or receiving in a tradeString
icon
URL to an icon for this item. A size can be appended to the end like200x200to get a specific size image, where the smallest dimensions will match.
const api = require('steam-js-api')
api.setKey('{{YOUR KEY}}')
api.getItemInfo(730, {class: '2735394074'}).then(result => {
console.log(result.data)
}).catch(console.error)This would display an object that looks like this one:
{
"name": "AUG | Stymphalian",
"nameColor": "D2D2D2",
"type": "Classified Rifle",
"marketName": "AUG | Stymphalian (Factory New)",
"marketHash": "AUG | Stymphalian (Factory New)",
"marketUrl": "https://steamcommunity.com/market/listings/undefined/AUG | Stymphalian (Factory New)",
"tradable": true,
"marketable": true,
"commodity": false,
"tradeRestriction": 7,
"icon": "https://steamcommunity-a.akamaihd.net/economy/image/-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpot6-iFABz7PLddgJR-MW7hIiKm_71PYTTn3lV-_p9g-7J4bP5iUazrl1sa23zd4KQJlQ_YlCB-la8xuu8h5S5vMzJwXpi7HUl4H2LnRLkhxhNcKUx0ob1nNaW/"
}Find prices of purchasable in-game items. Only works for economy appIDs, calling this with games that have no in-game purchasable items will certainly result in errors.
getGameItemPrices(appID[, currencyFilter])
appID required
Type:
IntegerSteam internal app ID, can also be a string
currencyFilter
Type:
String
Default:falseThe 3-letter currency code to return, for example 'USD' or 'JPY'. Boolean
falseor empty string returns all prices.
Integer
count
Number of items returnedArray
items
Array of item objectsString
class
Unique class ID for the item, often enough to uniquely identify an itemString
name
Not actually the name of the item, but you can use theclassin a call togetItemInfo()to get a reliable nameString
date
Likely meant for the game, such as creating limited time offers or such. Seems to be a string conversion from a unix timestamp, as sometimes the date of the epoch appears here, signalling a unix timestamp of0, which for all intents and purposes is a useless value.Object
prices
Prices listed by the 3-letter currency code, all prices are in the smallest division of the currency. For example, USD is represented by cents, so a value of299really means$2.99. Notice: sometimes the invalidUnknowncurrency appears, you should ignore that.Object
pricesOriginal
May not be defined. The "original" prices of the items, used in-game to show discounted prices. If you are representing this visually, you should check that the "original" price is actually less than the current price, as most of the time the "original" and current price are actually the same.
const api = require('steam-js-api')
api.setKey('{{YOUR KEY}}')
api.getGameItemPrices(730).then(result => {
console.log(result.data)
}).catch(console.error)This would display an object that looks like this one:
{
"count": 3,
"items": [
{
"class": "3106078545",
"name": "1375",
"date": "2018-11-29",
"prices": {
"USD": 249,
"GBP": 199,
"EUR": 220,
"RUB": 17000,
"BRL": 979,
"Unknown": 0,
"JPY": 27500
}
},
{
"class": "2948967440",
"name": "1374",
"date": "2018-06-07",
"prices": {
"USD": 249,
"GBP": 199,
"EUR": 220,
"RUB": 17000,
"BRL": 979,
"Unknown": 0,
"JPY": 27500
}
},
{
"class": "2727231383",
"name": "1373",
"date": "2017-12-20",
"prices": {
"USD": 249,
"GBP": 199,
"EUR": 220,
"RUB": 17000,
"BRL": 979,
"Unknown": 0,
"JPY": 27500
}
}
]
}> GetTradeHistory
> GetTradeStatus
> GetBadges
> GetCommunityBadgeProgress
> GetOwnedGames
> GetRecentlyPlayedGames
> GetSteamLevel
> GetAssetClassInfo
> GetAssetPrices
> GetFriendList
> GetPlayerBans
> GetPlayerSummaries
> GetUserGroupList
> ResolveVanityURL
> GetGlobalAchievement...
> GetNumberOfCurrentPlayers
> GetPlayerAchievements
> GetSchemaForGame
> GetUserStatsForGame