A Node.js wrapper for the Backpack.tf economy Web API.
Using npm:
$ npm install bptf-prices
Using yarn:
$ yarn add bptf-prices
Note: Make sure you've supplied a valid API key
in the test.js file.
Using npm:
$ npm test
Using yarn:
$ yarn test
const bptfprices = require('bptf-prices');
import bptfprices from 'bptf-prices';
const bptf = new bptfprices({ apiKey: 'XXXXXXXXXXXXXXXXXXXXXXXX' });
bptf.getSpecialItems({
appid: 440,
callback: (err, specials) => {
if (err) throw err;
console.log(specials.items);
}
});
(async () => {
try {
const data = await bptf.getCurrencies({
raw: 2
});
console.log(data.currencies);
} catch (error) {
console.error('An error occurred: ', error);
}
})();
There are some more examples available in the test directory.
See the Wiki pages for further documentation.
Copyright 2023, Simon Sørensen