Registry / finance / poloniex-api-node

poloniex-api-node

JSON →
library3.1.3jsnpmunverified

A Node.js wrapper for the Poloniex cryptocurrency exchange REST and WebSocket APIs. Current stable version 3.1.3 supports v2 REST and WebSocket APIs, auto-reconnection, and rate limiting. This library is unmaintained since 2023 and only supports Node.js 19.x. Compared to alternative wrappers like ccxt, it is simpler but not regularly updated and lacks TypeScript definitions.

npm install poloniex-api-node
INSTALL
IMPORT
SIG · POLONIEX-API-NODE
P
poloniex-api-node
financejavascriptv3.1.3
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.

Poloniex
import Poloniex from 'poloniex-api-node'
import { Poloniex } from 'poloniex-api-node'
Default export; named import does not work.
Poloniex
const Poloniex = require('poloniex-api-node')
CommonJS require works.

Initializes the Poloniex client with API credentials, fetches the ticker for BTC/USDT, and subscribes to real-time ticker updates via WebSocket.

import Poloniex from 'poloniex-api-node'; const key = process.env.POLONIEX_KEY ?? ''; const secret = process.env.POLONIEX_SECRET ?? ''; const poloniex = new Poloniex(key, secret); // Get ticker poloniex.returnTicker().then((ticker) => { console.log('BTC/USDT last:', ticker.USDT_BTC.last); }); // Subscribe to trades (WebSocket) poloniex.subscribe('ticker', (data) => { console.log('Ticker update:', data); }); poloniex.openWebSocket({ version: 2 });
Debug
Known issues
deprecatedPoloniex v1 API is deprecated. This library uses v2 by default.
fix
Ensure you pass { version: 2 } to openWebSocket; v1 may stop working.
affects: >=3.0.0
gotchaPoloniex constructor expects (key, secret) but both are optional; omitting them may lead to authentication errors.
fix
Always provide key and secret for authenticated endpoints.
affects: >=1.0.0
breakingChanged from callbacks to promises in v2.0.0.
fix
Use .then() or async/await instead of callbacks.
affects: >=2.0.0 <3.0.0
gotchaWebSocket auto-reconnect is enabled by default, but may cause duplicate subscriptions.
fix
Set options.autoReconnect = false if you manage reconnection manually.
affects: >=3.0.0
Errors
Common errors & fixes
Error: Poloniex API key is invalid
Missing or incorrect API key/secret
fix
Verify POLONIEX_KEY and POLONIEX_SECRET environment variables are set correctly.
TypeError: poloniex.returnTicker is not a function
Using named import instead of default import
fix
Use `import Poloniex from 'poloniex-api-node'` (default) instead of `import { Poloniex } from ...`.
Poloniex is not defined
Forgetting to import or require the module
fix
Add `import Poloniex from 'poloniex-api-node'` or `const Poloniex = require('poloniex-api-node')`.
Upgrade
Version history
3.1.3latest on npm
Audit
Dependencies
wsrequiredWebSocket client for real-time data
superagentrequiredHTTP client for REST API calls
Agent activity
38 hits · last 30 days
node
36
Resources
poloniex-api-node — npm install poloniex-api-node · libregistry