This package has been deprecated

Author message:

@dsyncerek/node-steam-prices

3.0.0 • Public • Published

Steam Prices for Node.js

MongoDB collection with Steam prices.

Installation

npm i @dsyncerek/node-steam-prices

Configuration

const SteamPrices = module.exports('your mongodb connection url', {
    interval: 8, // update every 8 hours
    tableName: 'steam_items'
});

You need to provide function that transforms api resopnse to array of items with name and price property.

SteamPrices.addProvider('https://api.csgofast.com/price/all', data => {
    let _ret = [];
    for (let p in data) if (data.hasOwnProperty(p)) _ret.push({name: p, price: data[p]});
    return _ret;
});

SteamPrices.addProvider('https://api.opskins.com/IPricing/GetAllLowestListPrices/v1/?appid=730', data => {
    data = data.response;
    let _ret = [];
    for (let p in data) if (data.hasOwnProperty(p)) _ret.push({name: p, price: data[p].price / 100});
    return _ret;
});

prices.update();

Usage

SteamPrices.getItem('AWP | Dragon Lore (Factory New)').then(data => console.log(data));

Readme

Keywords

Package Sidebar

Install

npm i @dsyncerek/node-steam-prices

Weekly Downloads

5

Version

3.0.0

License

MIT

Unpacked Size

3.7 kB

Total Files

4

Last publish

Collaborators

  • npm