osbuddy-api

0.3.1 • Public • Published

npm version

osbuddy-api

Unofficial OSBuddy API client. This does not support or document all of the available endpoints.

Install

$ npm i osbuddy-api

Example Usage

// example.js
const { getHourlyPrices, Statistics } = require('osbuddy-api')
 
const stats = new Statistics()
 
// fetch the online user stats
stats.onlineUsers().then(stats => {
  console.log('online user statistics:', stats)
})
 
// get "Santa hat" prices
getHourlyPrices(1050)
  .then(({ itemId, interval, records }) => {
    console.log(`${records.length} prices for ${itemId}`)
 
    records.forEach(({ timestamp, price, volume }) => {
      // price and volume have "buying", "selling", and "overall" fields
      console.log(`${new Date(timestamp)} - price: ${price.overall} (total: ${volume.overall})`)
    })
  })

Readme

Keywords

none

Package Sidebar

Install

npm i osbuddy-api

Weekly Downloads

0

Version

0.3.1

License

MIT

Unpacked Size

8.9 kB

Total Files

10

Last publish

Collaborators

  • kylestev