WebSockets

Real-time streams, one socket.

Open a single connection and subscribe to tickers, order books and trades from any market. Updates push straight from the matching engine, REST and WebSocket share the same field names.

subscribe.js
// Stream live tickers over WebSocket
const ws = new WebSocket("wss://ws.coinray.io/v2");

ws.onopen = () => ws.send(JSON.stringify({
  type:    "subscribe",
  channel: "ticker",
  symbol:  "BINANCE_BTC_USDT"
}));

ws.onmessage = (e) => console.log(JSON.parse(e.data));
// {
//   channel: "ticker",
//   symbol: "BINANCE_BTC_USDT",
//   price: "63204.15",
//   bid: "63203.90",
//   ask: "63204.40",
//   time: 1719830400
// }
How it works

Subscribe once. Get every update.

Send a subscribe frame for the channels you want, then read messages as the market moves, no polling, no per-exchange plumbing.

  • One connection covers tickers, order books and trades
  • Same SYMBOL format and schema as the REST API
  • Low-latency delivery from the matching engine
  • Scoped API keys with per-key revocation
Messages

Every tick, as it happens.

Each message carries the channel, market and payload, parse once and route it wherever your app needs it.

message.json
// Stream live tickers over WebSocket
const ws = new WebSocket("wss://ws.coinray.io/v2");

ws.onopen = () => ws.send(JSON.stringify({
  type:    "subscribe",
  channel: "ticker",
  symbol:  "BINANCE_BTC_USDT"
}));

ws.onmessage = (e) => console.log(JSON.parse(e.data));
// {
//   channel: "ticker",
//   symbol: "BINANCE_BTC_USDT",
//   price: "63204.15",
//   bid: "63203.90",
//   ask: "63204.40",
//   time: 1719830400
// }

Ship with real-time crypto data today

Plans from €79/month with metered overage. Pick a tier and start building on the unified API.