API ReferenceREST + Streaming Model

REST + Streaming Model

Most Conyr primitives come in two shapes: a REST query for current state and point lookups, and a WebSocket stream that pushes every update live. They serve the same data — pick REST to backfill, the stream to stay current.

DataREST queryWebSocket channel
Trades / tapeGET /v1/token/{mint}/tradestoken:{mint}:trades
Chart tickstoken:{mint}:ticks
OHLCV candlesGET /v1/token/{mint}/ohlcvtoken:{mint}:ohlcv:{view}:{tf}
Wallet PnLGET /v1/wallet/{addr}/pnlwallet:{addr}:pnl
PositionsGET /v1/wallet/{addr}/positionswallet:{addr}:positions
Wallet labelsGET /v1/wallet/{addr}/labelswallet:{addr}:labels
Token securityGET /v1/token/{mint}/suspicious-activitytoken:{mint}:security

The zero-gap pattern

Fetch the snapshot

Call the REST endpoint to load current state (open positions, the last candles, recent trades).

Subscribe to the stream

Open wss://api.conyr.ai/ws and subscribe to the matching channel for the same mint or address.

Apply events on top

Merge incoming stream events into your snapshot. Because the stream picks up from the moment you connect, there’s no gap between the backfill and the live feed.

Connecting

wss://api.conyr.ai/ws
const ws = new WebSocket("wss://api.conyr.ai/ws");
 
ws.onopen = () => {
  ws.send(JSON.stringify({
    op: "subscribe",
    channels: ["token:EPjFWd...:trades"],
  }));
};
 
ws.onmessage = (event) => {
  const msg = JSON.parse(event.data);
  if (msg.channel) console.log(`[${msg.channel}]`, msg.data);
};

Data events arrive as {"channel": "...", "data": { ... }}. The full message lifecycle, every channel pattern, and per-tier limits live in the WebSocket Protocol and Channel Catalog.

WebSocket access starts at Layer 1. See Tiers & Rate Limits for connection and subscription caps.