Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

poe-api-manager

ayberkgezer127MIT1.2.23TypeScript support: included

poe.ninja and poe.watch API

poe, economy, ninja, poe.ninja, poe economy, path of exile, path of exile economy, path of exile ninja, api, poe economy api, path of exile api, poe.watch api, poe.ninja api, backend, frontend, typescript

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

    `javascript 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
- Unique Maps
- Delirium Orb
- Divination Card

- getData() => function returns data purely.
```javascript
//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);
  }
};

changelog

CHANGELOG

1.2.23

  • 🛠️[Fix] Refactor exports to use export * syntax

1.2.22

  • 🛠️[Fix] Quick fix error.

1.2.20

  • 🚀[Added] CODE_OF_CONDUCT, CONTRIBUTING, and SECURITY policies.

1.2.19

  • 🚀[Added] poe.watch API with the following features:
    • Unique Maps
    • Delirium Orb
    • Divination Card

1.2.18

  • 🛠️[Fix] Quick fix poeWatch error.
  • 🛠️[Fix] Quick fix folder structure.

1.2.17

  • 🛠️[Fix] Quick fix github actions.

1.2.16

  • 🛠️[Fix] Quick fix.

1.2.14

  • 🚀[New] Publish jsr.

1.2.13

  • 🛠️[Fix] Quick Fix.

1.2.12

  • 🚀[New] I decided to develop the main project with Typescript language. From now on, development will only continue from here.
  • 🛠️[Fix] Typescript uses.

1.2.9

  • 🚀[Added] Allflame Embers added to itemview.

1.2.8

  • 🚀[Added] Coffins added to itemview.
  • 🛠️[Fix] Fix default value for typescript requestedProperties.
  • 🛠️[Fix] Fix bun error.

1.2.2

  • 🛠️ [Fixed] Control mechanisms in API calls have been improved for better error handling.
  • 🔄 [Changed] Updated dependencies to their latest versions for improved security and performance.
  • 🚀 [Added] getQuickCurrency() has been added to the Currency class.

1.2.1

  • 🔄 [Update] Development was done with OOP. Classes have been changed.

    There was no change in the scripts.

  • 🚀[Added] Added filterProperties() to utils class.

1.0.0

  • 🚀[New] utils class
  • 🚀[New] utils getLeaguesfunction. Get league name.
  • 📝 [Update] The documentation has been updated.

0.2.8

  • 🚀[Added] poe.watch API with getCategory() function.
  • 🛠️ [Fixed] Typo in WatchAPI class
  • 📝 [Update] The documentation has been updated.

    0.2.6

  • 🎨[Added] JSDocs for easy understanding.

0.2.2

  • 🚀[Added] poe.watch API with getData() function.

0.1.0

  • 🚀[Added] poe.ninja API with the following features:
    • Omens
    • Unique Relics
    • Cluster Jewels
    • Blighted Maps
    • Blight Ravaged Maps
    • Invitations
    • Memories

0.0.1 Publish