3.0.0 • Published 6 years ago

@dsyncerek/node-steam-prices v3.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

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));
3.0.0

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago