Skip to main content
Connect to:
wss://builder.ostium.io/v1/prices/stream
Subscribe:
{
  "type": "subscribe",
  "pairs": ["BTC-USD", "ETH-USD"]
}
SDK equivalent:
const stream = client.streamPrices([0, 1]);

Message schemas

Subscribe:
interface SubscribeMessage {
  type: 'subscribe';
  pairs: string[];
}
Unsubscribe:
interface UnsubscribeMessage {
  type: 'unsubscribe';
  pairs: string[];
}
Snapshot:
interface SnapshotMessage {
  type: 'snapshot';
  data: PriceTick[];
}
Tick:
interface TickMessage {
  type: 'tick';
  data: PriceTick;
}

interface PairSchedule {
  id: number;
  alwaysOpen?: boolean;
  timezone?: string;
  openingHours?: string[];
}

interface PriceTick {
  feed_id: string;
  pair: string;
  from: string;
  to: string;
  bid: number;
  mid: number;
  ask: number;
  isMarketOpen: boolean;
  isDayTradingClosed: boolean;
  secondsToToggleIsDayTradingClosed: number;
  timestampSeconds: number;
  schedule?: PairSchedule;
}