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

poe-api-manager

v1.2.14

Published

poe.ninja and poe.watch API

Downloads

330

Readme

poe-api-manager

MIT License GitHub package.json version GitHub top language ISSUES NPM Downloads GitHub Actions Workflow Status

Introduction

The purpose of this library is to make the economic data in the Path of Exile game easily usable. This library is written in typescript.

Important!: For economy, it is taken from the poe.ninja and poe.watch

Note: This product is in no way affiliated with or endorsed by Grinding Gear Games, poe.ninja and poe.watch.

Overview

Permission to access two different services. poe.ninja and poe.watch

Installation

Install with npm:

$ npm i poe-api-manager

Install with bun:

$ bun i poe-api-manager

Getting Started

ninjaAPI

const { NinjaAPI } = require("poe-api-manager");

const ninjaAPI = new NinjaAPI("League-Name");

currencyView

What we can get here is as follows.

  • Currency

  • Fragment

  • getData() => function returns data purely.

//Example Currency
ninjaAPI.currencyView.currency.getData().then((data) => {
  console.log(data);
});
  • getData(requestedProperties) => The function filters the data as desired.

Note: Enter poe.ninja Document to access the values for the filter.

//Filtered data is returned
ninjaAPI.currencyView.currency.getData(["id", "name", "icon"]).then((data) => {
  console.log(data);
});
  • getQuickCurrency() => This function returns the chaos value from the currency name. It returns "Divine Orb" chaos as the default value. currencyTypeName default "Divine Orb"
ninjaAPI.currencyView.currency.getQuickCurrency(currencyTypeName).then((data)=> {
  console.log(data);
});

itemView

What we can get here is as follows.

  • BaseType

  • Beast

  • Delirium Orbs

  • Divination Cards

  • Essences

  • Fossils

  • Helment Enchant

  • Incubators

  • Maps

  • Oils

  • Resanators

  • Scarabs

  • Skill Gems

  • Unique Accessories

  • Unique Armours

  • Unique Flask

  • Unique Jewels

  • Unique Maps

  • Unique Weapons

  • Vials

  • Omens

  • Unique Relics

  • Cluster Jewels

  • Blighted Maps

  • Blight Ravaged Maps

  • Invitations

  • Memories

  • Coffins

  • Allflame Embers

  • getData() => function returns data purely.

//Example BaseType
ninjaAPI.itemView.baseType.getData().then((data) => {
  console.log(data);
});
  • getdata(requestedProperties) => The function filters the data as desired.

Note: Enter poe.ninja Document to access the values for the filter.

//Filtered data is returned
ninjaAPI.itemView.baseType.getData(["id", "name", "icon"]).then((data) => {
  console.log(data);
});

watchAPI

const { WatchAPI } = require("poe-api-manager");

const watchAPI = new WatchAPI("League-Name");

view

What we can get here is as follows.

  • Currency

  • Essences

  • Fossil

  • Fragment

  • Gem

  • Invitation

  • Jewel

  • Map

  • Oil

  • Scarab

  • Sextant

  • Accessory

  • Armour

  • Weapon

  • Flask

  • Base

  • Beast

  • getData() => function returns data purely.

//Example Currency
watchAPI.view.baseType.getData().then((data) => {
  console.log(data);
});

Enter poe.watch Document to access the values for the filter.

  • getdata(requestedProperties) => The function filters the data as desired.
//Filtered data is returned
watchAPI.view.currency.getData(["id", "name", "icon"]).then((data) => {
  console.log(data);
});
  • getCategory("categoryName") => The function quickly filters through specific categories.

Note: Used in accessory, armour, base, gem and weapon.

//Returns the chest category in Armor.
watchAPI.view.armour.getCategory("chest").then((data) => {
  console.log(data);
});

Utils

Utils class is a class that contains some auxiliary tools.

const { Utils } = require("poe-api-manager");
const utils = new Utils();
  • getLeagues() => Returns available league names.
utils.getLeagues().then((data) => {
  console.log(data);
});
  • filterProperties(data, properties) => It is used to filter data.
utils.filterProperties(data, ["currencyTypeName", "chaosEquivalent"])
  .then((result) => console.log(result));

Examples

const { NinjaAPI , WatchAPI } = require("poe-api-manager");

// Create NinjaAPI
const ninjaAPI = new NinjaAPI("Affliction");
//Create WatchAPI
const watchAPI = new WatchAPI("Affliction")

//We entered the filter data
const requestedProperties = ["id", "name", "icon"];

//filtered BaseType data ninjaAPI
ninjaAPI.itemView.baseType.getData(requestedProperties).then((data) => {
  console.log(data);
});

//filtered Currency data ninjaAPI
ninjaAPI.currencyView.currency.getData(requestedProperties).then((data) => {
  console.log(data);
});

// filtered Scarab data watchAPI
watchAPI.view.scarab.getData(requestedProperties).then((data) => {
  console.log(data);
});
const { NinjaAPI , WatchAPI } = require("poe-api-manager");

// Create NinjaAPI
const ninjaAPI = new NinjaAPI("Affliction");
//Create WatchAPI
const watchAPI = new WatchAPI("Affliction")

const requestedProperties = ["id", "name", "icon"];

//Using await in an async function
const fetchData = async () => {
  try {
    //Oil Data poe.ninja
    const oilData = await ninjaAPI.itemView.oil.getData(requestedProperties);


    console.log("poe.ninja Oil Data:", oilData);

    //Currency Data poe.ninja
    const currencyData = await ninjaAPI.currencyView.currency.getData(requestedProperties);

    console.log("poe.ninja Currency Data:", currencyData);

    //Scarab Data poe.watch
    const scarabData = await watchAPI.view.scarab.getData(requestedProperties)

    console.log("poe.watch Scarab Data", scarabData);
  } catch (error) {
    console.error("Error fetching data:", error);
  }
};