Registry / gaming / poe-trade-fetch

poe-trade-fetch

JSON →
library1.10.1jsnpmunverified

A JavaScript/TypeScript library for interacting with the Path of Exile trading API. Version 1.10.1, actively maintained, with built-in rate limit handling, support for multiple leagues and realms, and separate methods for initial search and detailed fetch. Ships TypeScript type definitions. Differentiates from alternatives by providing a high-level abstraction for query construction and automatic rate limit management.

npm install poe-trade-fetch
INSTALL
IMPORT
SIG · POE-TRADE-FETCH
P
poe-trade-fetch
gamingjavascriptv1.10.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PoeTradeFetch
import { PoeTradeFetch } from 'poe-trade-fetch'
const PoeTradeFetch = require('poe-trade-fetch')
Package is ESM-only; CommonJS require() will not work.
RequestBodyType
import { RequestBodyType } from 'poe-trade-fetch'
import RequestBodyType from 'poe-trade-fetch'
RequestBodyType is a named export, not default.
LEAGUES_NAMES
import { LEAGUES_NAMES } from 'poe-trade-fetch'
Provides league constants like LEAGUES_NAMES.Current.

Initializes PoE Trade Fetch, performs a search for 'Prismweave' Rustic Sashes, and prints the price of the first result.

import { LEAGUES_NAMES, REALMS, PoeTradeFetch, RequestBodyType } from 'poe-trade-fetch'; const poeTradeFetch = PoeTradeFetch.createInstance({ leagueName: LEAGUES_NAMES.Current, userAgent: 'My PoE App your@mail.kek', realm: REALMS.pc, POESESSID: process.env.POESESSID ?? '', useRateLimitDelay: true }); const requestBody: RequestBodyType = { query: { status: { option: 'online' }, name: 'Prismweave', type: 'Rustic Sash', stats: [{ type: 'and', filters: [], disabled: false }], }, sort: { price: 'asc' }, }; const { result, id } = await poeTradeFetch.firsRequest(requestBody); const identifiers = result.length > 10 ? result.slice(0, 10) : result; const { result: secondResult } = await poeTradeFetch.secondRequest(identifiers, id); console.log('Price:', secondResult[0].listing.price.amount, secondResult[0].listing.price.currency);
Debug
Known issues
gotchaMethod name typo: 'firsRequest' is intentionally misspelled (missing 't' in 'first').
fix
Use 'firsRequest' as the correct method name; do not change to 'firstRequest'.
affects: >=1.0.0
gotchaThe PoE API limits initial search results; only 10 item identifiers are allowed in the second request.
fix
Always slice the result array to a maximum of 10 before passing to secondRequest.
affects: >=1.0.0
gotchaThe library requires a valid userAgent string; missing or invalid agent may cause 403 errors.
fix
Provide a descriptive user agent, e.g., 'My PoE App your@mail.kek'.
affects: >=1.0.0
gotchaThe POESESSID is optional but significantly increases the request rate limit; without it, rate limits are very restrictive.
fix
If possible, provide a valid POESESSID to avoid rate limiting.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: poe_trade_fetch_1.PoeTradeFetch is not a constructor
Attempted to use require() or construct incorrectly.
fix
Use import { PoeTradeFetch } from 'poe-trade-fetch' and call PoeTradeFetch.createInstance().
Error: Cannot find module 'poe-trade-fetch'
Package not installed or missing dependency.
fix
Run 'npm install poe-trade-fetch'.
Error: Request failed with status code 403
Missing or invalid user agent, or rate limited.
fix
Set a valid userAgent in options and ensure proper delay between requests.
TypeError: Cannot read properties of undefined (reading 'amount')
Attempted to access price on empty result or failed request.
fix
Check that secondResult array has elements before accessing listing price.
Upgrade
Version history
1.10.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
52 hits · last 30 days
node
48
OpenAI (training)
1
Resources
poe-trade-fetch — npm install poe-trade-fetch · libregistry