1.0.0 • Published 6 years ago

nexus-stats-api v1.0.0

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

Nexus Stats API Package

Installation

npm install nexus-stats-api

Usage

const Nexus = require("nexus-stats-api")
const nexus = new Nexus()

nexus.get("/warframe/v1/items").then(res => console.log(res.body)) // list of all stored items

Configuration

const Nexus = require("nexus-stats-api")
const nexus = new Nexus({key: value})
KeyDefaultDescription
use_sockettrueWhether or not to use Socket.io as standard request engine. Setting to false uses http. Subscriptions will use Socket.io regardless.
namespace"/"Socket.io namespace to connect to
user_keynull(optional) User key obtained via Auth-Node registration
user_secretnull(optional) User secret obtained via Auth-Node
ignore_limiterfalseWhether or not to disable the default rate limit adaptions. Disabling this only makes sense if you connect as a user who won't face rate limits. If you disable it anyway, expect all your requests to get blocked.

API

For response formats, check the provisional nexus-stats docs

Item Price Stats

nexus.getItemStats(name)

Get detailed item statistics for a given item. Returns a promise with a statistics object.

Item Price List

nexus.getItemPrices()

Returns a list of all items and their overall price stats in the last week.

Supply & Demand

nexus.getItemDistribution()

Returns a list of all items and their supply/demand values.

Player Profiles

nexus.getPlayerProfile(name)

Returns the ingame player profile for given user.

Bot Status

nexus.getBotStatus()

Returns the upstatus for all connected bots.

Subscriptions

Subscriptions allow you to receive real-time data whenever an item is updated. Updates trigger on in-game requests.

nexus.subscribe(endpoint)

Subscribe to updates on a specific endpoint. Updates can be listened to via nexus.on(endpoint, fn).

ArgumentDescriptionDefault
endpointURL to listen for updates on e.g. /warframe/v1/items/frost prime/statisticsNone
nexus.on(ev, fn)

Listens to specific Socket.io event, then runs the given function with the received data

ArgumentDescriptionDefault
evEvent name. Usually a subscribed endpoint URL.None
fnFunction to execute on event triggerNone

RESTful methods

// GET Request
nexus.get(url)

// POST, PUT, PATCH Requests
nexus.post(url, body)
nexus.put(url, body)
nexus.patch(url, body)

// DELETE Request
nexus.delete(url, body)

Sends a RESTful request to a certain URL (without domain) and returns a promise containing the response data.

See the blitz-js-query documentation for further details on sending RESTful methods.

License

MIT

1.0.0

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago

0.0.26

7 years ago

0.0.25

7 years ago

0.0.24

7 years ago

0.0.23

7 years ago

0.0.22

7 years ago

0.0.21

7 years ago

0.0.20

7 years ago

0.0.19

7 years ago

0.0.17

7 years ago

0.0.16

7 years ago

0.0.15

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago