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-util

v1.0.3

Published

A utility for the Path Of Exile API, includes stashes, ladders, characters, trade searching, etc.

Downloads

3

Readme

Installation

poe-util is a Path of Exile utility that warps around the Path of Exile official API. You can search for items, stashes, guilds, ladders, etc. This is not meant to be a final solution for anyone, although you can use it as one. It's meant to be a helper tool to get you started.

Start the installation by installing the poe-util package.

npm install poe-util

Add poe-util to your project

const poe = require('poe-util');

//example
poe.getNextStashChangeId().then((nextId) => console.log(nextId));
//This would return something like: '1103206369-1110730022-1070996087-1200613805-1152047365'

List of functions:

getFullStashTabs (Promise)

Returns an array of the maximum limit of stash tabs including the next-change-id.

getOnlyStashTabs (Promise)

Returns an array of the maximum limit of stash tabs.

getNextStashChangeID (Promise)

Returns the string of the next-change-id for stash tabs.

getAccountCharacters(account: string, realm: string) (Promise)

account: Your Path of Exile account. (MUST BE PUBLIC) realm: The platform the account you are searching is located. (ie: 'pc')

Returns the string of the next-change-id for stash tabs.

getCharacterItems(account: string, character: string) (Promise)

account: Your Path of Exile account. (MUST BE PUBLIC)

character: Your Path of Exile character that is linked to the account provided.

Returns an array of the characters items and includes full item properties.

getLadder(league: string, limit: number) (Promise)

league: The Path of Exile league you want to retrieve.

limit: The number of results you want to retrieve, default: 20, maximum: 200.

Returns an array current ladder statistics including full character information.

getPassiveSkills(account: string, character: string) (Promise)

account: Your Path of Exile account. (MUST BE PUBLIC)

character: Your Path of Exile character that is linked to the account provided.

Returns an array of IDs where each ID is equal to a node in the characters skill tree.

getItemStats() (Promise)

Returns an array with suffixes, prefixes and other mods for items.

getStaticData() (Promise)

Returns an array with static data such as images for maps, currency, map tiers, etc.

getItemData() (Promise)

Returns an array with categories, where each category is filled with the names and types of items.

Fetching Items

//Load poe-util
const poe = require('poe-util');

//Start by assigning the startItemApi
//This will assign the state inside the function
const query = poe.startItemApi();

//Use the new assigned variable to call fetchSearchResults(); and fetchItems();
//By default the Path of Exile can only search 10 itemIDs at once
//You can chain fetchItems(); to get the next 10, it's being kept track of in the state
query
  .fetchSearchResults('Headhunter', 'Standard')
  .then(query.fetchItems)
  .then((response) => console.log(response));

startItemApi() (Promise)

Starts the initial state inside the function.

fetchSearchResults(item: string, realm: string) (Promise)

item: The name of the item you want to search.

realm: The platform you want to search the item.

WARNING: The API is very picky so be sure you write the correct name. Capitalization matters.

Returns an object with the unique data of the item searched, includes queryId and unique item IDs.

fetchItems() (Promise)

The API can only send back 10 items at once, however you can chain this like pagination.

Returns an array of the items searched, includes seller information, item and others.

Roadmap

  • [x] Add item fetching and pagination.
  • [x] Add tests for the all functions.
  • [ ] Improve pagination and item fetching.
  • [ ] Implement all availble endpoints of the API as functions.
  • [ ] Improve error handlding
  • [ ] Convert package to Typescript.