Skip to main content

@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​

Two ways to use the client​

Use the...When
AltradyData client directlyYou want fine-grained control over individual subscriptions and calls.
AltradyDataCacheYou 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. :::