2.0.11 • Published 1 year ago

steamcommunity-inventory v2.0.11

Weekly downloads
1
License
MIT
Repository
-
Last release
1 year ago

steamcommunity-inventory

A rate limit and response handler for steamcommunity inventories.

  • It's functional.
  • Will appreciate all feedback I can get

Instalation

Currently only via NPM: npm install steamcommunity-inventory

Documentation

Vocabulary

ParamTypeDescriptions
steamIDstringSteam account identificator
appIDstringApplication identificator, eg: https://store.steampowered.com/app/440/Team_Fortress_2/
contextIDstringInventory context identificator, eg: https://steamcommunity.com/id/theglencoco/inventory/#440_2_8331418960 440 is AppID, 2 is contextID, last one is assetID

Inventory

Handles inventory requests to SteamCommunity.

Kind: global class

new Inventory(options)

ParamTypeDescription
options.steamIDstringWhen passed with cookies, you don't have to rely on rate limit, steam lets you request your inventory freely
options.method'new' | 'old'method we use for inventory
options.formatterfunctionmodifies econItem before being passed into then
options.headersObjectHTTP headers
For Rate limiting see:https://github.com/SGrondin/bottleneck#constructor
options.minTimenumber
options.maxConcurentnumber
options.reservoirnumber
options.reservoirRefreshAmountnumber
options.reservoirRefreshInvervalnumber

inventory.setCookies(cookies)

Sets cookies to instance NOTE: Current version only accepts cookies in for like

Kind: instance method of Inventory See: https://github.com/DoctorMcKay/node-steam-user#websession

ParamType
cookiesArray.<string>

inventory.get(options) ⇒ Promise.<Array.<EconItem>>

A shorthand function used for requesting and limiting.

Kind: instance method of Inventory See: Inventory.prototype.getViaNewEndpoint

ParamTypeDescription
optionsObjectSee old or new

Methods

Please note that you should only use inventory.get for inventory. These methods are not usable on their own.

OLD: inventory.getViaOldEndpoint(steamID, appID, contextID, start, tradableOnly, inventory)

Gets inventory from old deprecated endpoint that has more data but is more limited.

Kind: instance method of Inventory

ParamTypeDefaultDescription
steamIDstring
appIDstring
contextIDstring
countnumberHow many items you want, Every request gets roughly 2000 items, so count should be multiple of 2000, can also be: Infinity gets all recursively, void gets only the first 500
startnumberFrom which item do we start.
tradableOnlybooleantrue
inventoryArray.<Object>[]Only if you wanna append more items to it. Used for recursion.

NEW: inventory.getViaNewEndpoint(steamID, appID, contextID, language)

Gets inventory from new endpoint that has better rate limit but less data.

Kind: instance method of Inventory

ParamTypeDefault
steamIDstring
appIDstring
contextIDstring
languagestring"english"
startstringassetID you want to start from.
countnumberIf set gets the exact amount of items, if Infinity gets all recursively, if void gets only the first 500
inventoryArray.<Object>[]Only if you wanna append more items to it. Used for recursion.
2.0.11

1 year ago

2.0.7

1 year ago

2.0.9

1 year ago

2.0.10

1 year ago

2.0.8

1 year ago

2.0.6

1 year ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.5

3 years ago

2.0.4

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.0.0

4 years ago