npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

osrs-ge

v1.0.3

Published

Old school runescape (osrs) grand exchange api

Downloads

4

Readme

osrs-ge

Old school runescape (osrs) grand exchange api

What it does

This wrapper gets GE data into a more usable JSON object and provides extra information about items in the GE


Installation

With npm:

$ npm install osrs-ge

How to use

Install the package and then import it into your project Once you import it you can call the functions asynchronously:

const ge = require('osrs-ge');
const item = await ge.getItem(4151);
const items = await ge.getItems('rune');
const graphData = await ge.getGraphData();
const lastUpdatedDate = await ge.getLastUpdatedDate();

What you'll get

getItem returns an item object that looks like this:

{
  item: {
    icon: 'https://secure.runescape.com/m=itemdb_oldschool/1724236194410_obj_sprite.gif?id=4151',
    icon_large: 'https://secure.runescape.com/m=itemdb_oldschool/1724236194410_obj_big.gif?id=4151',
    id: 4151,
    type: 'Default',
    typeIcon: 'https://www.runescape.com/img/categories/Default',
    name: 'Abyssal whip',
    description: 'A weapon from the Abyss.',
    current: { trend: 'neutral', price: '1.4m' },
    today: { trend: 'positive', price: '+12.8k' },
    members: 'true',
    day30: { trend: 'negative', change: '-2.0%' },
    day90: { trend: 'negative', change: '-15.0%' },
    day180: { trend: 'negative', change: '-18.0%' }
  }
}

getItems returns and array of items based on your input:


  total: 4152,
  items: [
    {
      icon: 'https://secure.runescape.com/m=itemdb_oldschool/1724236194410_obj_sprite.gif?id=1319',
      icon_large: 'https://secure.runescape.com/m=itemdb_oldschool/1724236194410_obj_big.gif?id=1319',
      id: 1319,
      type: 'Default',
      typeIcon: 'https://www.runescape.com/img/categories/Default',
      name: 'Rune 2h sword',
      description: 'A two handed sword.',
      current: [Object],
      today: [Object],
      members: 'false'
    },
    // ...
        ]
    }

getGraphData Graph shows the prices each day of a given item for the previous 180 days. The timecode is the number of milliseconds that has passed since 1 January 1970 and the price is the market value of the item for the given day. When no price information is available, then a value of zero is returned.


  {"daily":{"1419897600000":15633853,"1419984000000":15475988,"1420070400000":15379017},"average":{"1419897600000":14708793,"1419984000000":14764787,"1420070400000":148288055}}

getLastUpdatedDate returns the runedate of when the Grand Exchange Database was last updated.