Wondering what’s next for npm?Check out our public roadmap! »

    steamcommunity-inventory

    1.2.1 • Public • Published

    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

    Param Type Descriptions
    steamID string Steam account identificator
    appID string Application identificator, eg: https://store.steampowered.com/app/440/Team_Fortress_2/
    contextID string Inventory 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])

    Param Type Description
    options.steamID string When 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.formatter function modifies econItem before being passed into then
    [options.headers] Object HTTP headers
    For Rate limiting see: https://github.com/SGrondin/bottleneck#constructor
    options.minTime number
    options.maxConcurent number
    options.reservoir number
    options.reservoirRefreshAmount number
    options.reservoirRefreshInverval number

    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

    Param Type
    cookies Array.<string>

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

    A shorthand function used for requesting and limiting.

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

    Param Type Description
    options Object See 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

    Param Type Default Description
    steamID string
    appID string
    contextID string
    count number How 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
    [start] number From which item do we start.
    [tradableOnly] boolean true
    [inventory] Array.<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

    Param Type Default
    steamID string
    appID string
    contextID string
    [language] string "english"
    [start] string assetID you want to start from.
    [count] number If set gets the exact amount of items, if Infinity gets all recursively, if void gets only the first 500
    [inventory] Array.<Object> []

    Install

    npm i steamcommunity-inventory

    DownloadsWeekly Downloads

    3

    Version

    1.2.1

    License

    MIT

    Unpacked Size

    20.8 kB

    Total Files

    14

    Last publish

    Collaborators

    • avatar