0.3.1 • Published 6 years ago

osbuddy-api v0.3.1

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

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})`)
    })
  })
0.3.1

6 years ago

0.3.0

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago