Skip to content

WebSockets · Futures

Futures quotes stream

Futures best bid and offer.
WS/v1/ws/futures/quoteswsFuturesQuotes
On this page

Every change of the best bid and offer of a product or dated contract. The first event after subscribing is the current quote.

Connect and subscribe

Open wss://api.ordermap.si/v1/ws/futures/quotes?symbols=ES with your key in the Authorization header, then send a subscribe message. Up to 25 symbols per connection. One connection per account per stream; streams need API Pro. The protocol, limits and close codes are in WebSockets.

Node.js

import WebSocket from "ws";

const ws = new WebSocket("wss://api.ordermap.si/v1/ws/futures/quotes?symbols=ES", {
  headers: { Authorization: `Bearer ${process.env.ORDERMAP_API_KEY}` },
});

ws.on("open", () => ws.send(JSON.stringify({ action: "subscribe", symbols: ["ES"] })));
ws.on("message", (raw) => {
  const message = JSON.parse(raw.toString());
  if (message.type === "event") console.log(message.seq, message.data);
  if (message.type === "gap") console.warn("continuity lost: refetch the range over REST", message);
});
ws.on("close", (code, reason) => console.log("closed", code, reason.toString()));

Subscribe message

{"action":"subscribe","symbols":["ES"]}

Subscription parameters

1 parameter, none required. Send them in the query string of the upgrade request, or as the filters of a subscribe message.

ParameterType and limitsDescription
symbolsqueryoptionalarray<string>comma-separated in one parameter1 to 25 itemseach at most 128 characterspattern ^[A-Za-z][A-Za-z0-9.]{0,9}$Symbols to subscribe to (up to 25).

Event

Each event is one message: {"type":"event","event_type":"futures.quotes","seq":N,"data":{...}}.

data of futures.quotes

  • asknumber | nullrequiredBest ask price; null when there is none.
  • ask_sizeintegerrequiredContracts at the best ask.
  • ask_ticksstring | nullrequiredBest ask in ticks, as an integer string.
  • bidnumber | nullrequiredBest bid price; null when there is none.
  • bid_sizeintegerrequiredContracts at the best bid.
  • bid_ticksstring | nullrequiredBest bid in ticks, as an integer string.
  • contractstringrequiredDated contract.
  • symbolstringrequiredThe symbol subscribed to.
  • timestampintegerunix-msrequiredTime of the quote. Unix epoch milliseconds (UTC).
  • validbooleanrequiredFalse when the quote was cleared (market closed, disconnect or crossed book).

Example event

{
  "type": "event",
  "event_type": "futures.quotes",
  "seq": 1,
  "data": {
    "ask": 5801.25,
    "ask_size": 7,
    "ask_ticks": "23205",
    "bid": 5801,
    "bid_size": 12,
    "bid_ticks": "23204",
    "contract": "ESZ6",
    "symbol": "ES",
    "timestamp": 1792161000123,
    "valid": true
  }
}

Before the upgrade

Errors before the upgrade are ordinary JSON errors; after it, problems arrive as messages and close codes (see WebSockets).

StatusMeaningBody
101Switching protocols: WebSocket protocol ordermap.v1.Switching protocols
400Invalid handshake parameters.Error object
401Missing or invalid API key (Authorization, X-API-Key or, from a browser, the ordermap.key. subprotocol).Error object
403The plan has no streaming (streaming_not_in_plan), the dataset is not released, or the account is suspended.Error object
409stream_connection_limit: one live connection per account per event type.Retry-AfterError object
426The request is not a WebSocket upgrade.Error object
429Rate limit or WebSocket cooldown.Retry-AfterError object
503stream_unavailable: the stream is not enabled or its source is down; retry after Retry-After seconds.Retry-AfterError object

Authenticated responses carry the X-RateLimit-* headers (see rate limits); 429 and 503 add Retry-After.