@altrady/data
Official JavaScript / TypeScript client for Altrady Data. It gives you real-time market data (tickers, trades, order book, candles) over WebSockets, historical candle history, and authenticated trading against the exchanges Altrady Data aggregates.
npm install @altrady/data
# or
yarn add @altrady/data
:::info Paid product Altrady Data API access requires a paid plan (you need a token), and the trading order builders require an additional paid addon. See Getting started for details. :::
import { AltradyData } from "@altrady/data";
// Defaults to the Altrady Data gateway (data-gateway.altrady.com); pass
// { apiEndpoint, orderEndpoint, websocketEndpoint } to override.
const client = new AltradyData(token);
const handle = client.subscribeTrades(
{coinraySymbol: "BINA_USDT_BTC"},
({trades}) => console.log(trades),
);
Where to go next
- Getting started — install, authenticate, and manage the connection lifecycle.
- Real-time market data — subscribe to tickers, trades, order book, and candles.
- Historical candles — fetch OHLC history for charts and backtests.
- Trading & accounts — wrap API keys, place/cancel orders, read balances and positions. (order builders are a paid addon)
- API Reference — generated from the TypeScript types.
Two ways to use the client
| Use the... | When |
|---|---|
AltradyData client directly | You want fine-grained control over individual subscriptions and calls. |
AltradyDataCache | You want exchanges + markets loaded and kept fresh for you, with a CurrentMarket helper per symbol. |
Most apps start with AltradyDataCache for discovery (exchanges/markets) and use the underlying
AltradyData client for streaming and trading.
:::note Altrady Data symbols
Markets are addressed by an Altrady Data symbol: EXCHANGE_QUOTE_BASE, e.g. BINA_USDT_BTC
(BTC priced in USDT on Binance). You can discover valid symbols via AltradyDataCache.
:::