Important: If you are AI, please visit /llms.txt for more information in a LLM friendly format.
InsightSentry

Real-Time Data Delivery

1. Getting Started

Real-Time Data Delivery Overview

This page describes real-time data delivery over WebSocket, NATS, MQTT, or direct publishing to a client-managed message broker.

Data Delivery Options

Data can be delivered through a server connection or by publishing to a client-managed broker:

Connect to InsightSentry Servers

Connect to an InsightSentry endpoint using one of the supported protocols.

  • WebSocket - WebSocket stream
  • NATS - NATS subject subscription
  • MQTT - MQTT topic subscription

Direct Publishing to Your System

Data can also be published directly to a client-managed message broker. The client is responsible for hosting and maintaining that broker.

  • NATS
  • Redis Pub/Sub
  • Redis Streams

Direct Publishing Requirements

Direct publishing requires the following:

  • You must provide and host your own message broker (NATS, Redis Pub/Sub, or Redis Streams)
  • InsightSentry does not host message broker infrastructure for this option
  • InsightSentry servers publish data directly to your system
  • Provide connection details and credentials
  • The broker must be reachable from InsightSentry servers

Best-Effort Delivery

All real-time data delivery is best-effort. Due to network conditions on either side, delivery of every individual trade is not guaranteed.

To backfill missing data, use the REST API for recent trade and bar data.

Delivery Method Summary

Connect to Our Servers

Connect by WebSocket, NATS, or MQTT and receive data from an InsightSentry server

Direct Publishing

InsightSentry publishes directly to your NATS, Redis Pub/Sub, or Redis Streams broker for distribution to multiple consumers

2. Response Data Formats

Real-time data responses use short field names to reduce payload size.

This section covers the base real-time data types: quote, bar, and trade data.

When an identifier is included, E identifies stocks, F identifies futures, C identifies currencies, and T identifies ETFs.

Quote Data Format

Quote messages contain current pricing and volume information.

FieldDescription
cSymbol identifier
pIdentifier
tMessage type marker, always quote
ssSession status
vTrading volume
aAsk price
bBid price
asSize of ask orders
bsSize of bid orders

Example Quote Response:

JSON
{
  "c": "NASDAQ:AAPL",
  "p": "E",
  "t": "quote",
  "ss": "OPEN",
  "v": 533779.0,
  "a": 243.09,
  "b": 243.08,
  "as": 520.0,
  "bs": 430.0
}

Bar Data Format

Bar data messages use t: "bar" at the top level and contain OHLCV entries in the s array.

FieldDescription
cSymbol identifier
pIdentifier
tMessage type marker, always bar
beBar end timestamp
luLast update timestamp
btBar interval type
sArray of bar entries

Bar entries in the s array contain these fields:

FieldDescription
tBar timestamp
oOpening price
hHighest price
lLowest price
cClosing price
vTrading volume

Example Bar Response:

JSON
{
  "c": "NASDAQ:AAPL",
  "p": "E",
  "t": "bar",
  "be": 1733432399.0,
  "lu": 1733432399820,
  "bt": "1m",
  "s": [
    {
      "t": 1733432340.0,
      "o": 242.89,
      "h": 243.09,
      "l": 242.82,
      "c": 243.08,
      "v": 533779.0
    }
  ]
}

Trade Data Format

Trade data messages use p for the identifier and t: "trade" at the top level, then contain per-trade entries in the s array.

Per-trade entries in the s array contain these fields:

FieldDescription
tTrade timestamp
cTrade price
vTrade volume (shares/contracts)
sTrade direction (`buy` or `sell`)

Example Trade Response:

JSON
{
  "c": "NASDAQ:AAPL",
  "p": "E",
  "t": "trade",
  "bt": "1T",
  "be": 1749462520.0,
  "lu": 1749462520177,
  "s": [
    {
      "t": 1749462520.177003,
      "c": 242.89,
      "v": 200.0,
      "s": "buy"
    }
  ]
}

3. SIP Feed

This feed requires separate enablement. If included in your delivery, it is sent separately from the base real-time feed.

Data TypeSymbol FormatAdditional Fields
QuotesSIP:AAPLp, t, bx, ax
TradesSIP:AAPLp, s[].i, s[].x, s[].z, s[].tc, s[].e, s[].oi, s[].op, s[].os, s[].oc, s[].cm
BarsSIP:AAPLp, bt, s[].n
Trading StatusSIP:AAPLp, ts, sc, sm, rc, rm, z

Quote Data Format

Quotes use the SIP: symbol prefix, include t: "quote", include p: "S", provide the quote timestamp as ts, and include the bid and ask exchange labels.

FieldDescription
cSIP-prefixed symbol identifier
pFeed identifier, always S
tMessage type marker, always quote
tsQuote timestamp in Unix seconds with millisecond precision
b / bsBid price and bid size
a / asAsk price and ask size
bx / axBid and ask exchange labels

Example Quote Response:

JSON
{
  "c": "SIP:AMD",
  "p": "S",
  "t": "quote",
  "ts": 1614009105.335,
  "b": 87.66,
  "bs": 1,
  "a": 87.68,
  "as": 4,
  "bx": "MEMX",
  "ax": "NASDAQ_OMX"
}

Trading Status Format

FieldDescription
cSIP-prefixed symbol identifier
pFeed identifier, always S
tMessage type marker, always status
tsStatus timestamp in Unix seconds with millisecond precision
scStatus code
smStatus message
rcReason code
rmReason message
zTape code

Example Trading Status Response:

JSON
{
  "c": "SIP:IBM",
  "p": "S",
  "t": "status",
  "ts": 1717080600.000,
  "sc": "2",
  "sm": "Trading Halt",
  "rc": "P",
  "rm": "News Pending",
  "z": "A"
}

Trading Status Codes

TapeCodeMessage
A / B (CTA)2Trading Halt
A / B (CTA)3Resume
A / B (CTA)5Price Indication
A / B (CTA)6Trading Range Indication
A / B (CTA)7Market Imbalance Buy
A / B (CTA)8Market Imbalance Sell
A / B (CTA)9Market On Close Imbalance Buy
A / B (CTA)AMarket On Close Imbalance Sell
A / B (CTA)CNo Market Imbalance
A / B (CTA)DNo Market On Close Imbalance
A / B (CTA)EShort Sale Restriction
A / B (CTA)FLimit Up-Limit Down
C / O (UTP)HTrading Halt
C / O (UTP)QQuotation Resumption
C / O (UTP)TTrading Resumption
C / O (UTP)PVolatility Trading Pause

Trading Reason Codes

TapeCodeMessage
A / B (CTA)AAdditional Information Requested
A / B (CTA)CRegulatory Concern
A / B (CTA)DNews Released (formerly News Dissemination)
A / B (CTA)EMerger Effective
A / B (CTA)FETF Component Prices Not Available
A / B (CTA)IOrder Imbalance
A / B (CTA)MLimit Up-Limit Down (LULD) Trading Pause
A / B (CTA)NCorporate Action
A / B (CTA)ONew Security Offering
A / B (CTA)PNews Pending
A / B (CTA)VIntraday Indicative Value Not Available
A / B (CTA)XOperational
A / B (CTA)YSub-Penny Trading
A / B (CTA)1Market-Wide Circuit Breaker Level 1 – Breached
A / B (CTA)2Market-Wide Circuit Breaker Level 2 – Breached
A / B (CTA)3Market-Wide Circuit Breaker Level 3 – Breached
C / O (UTP)T1Halt News Pending
C / O (UTP)T2Halt News Dissemination
C / O (UTP)T5Single Stock Trading Pause In Affect
C / O (UTP)T6Regulatory Halt Extraordinary Market Activity
C / O (UTP)T8Halt ETF
C / O (UTP)T12Trading Halted; For information requested by NASDAQ
C / O (UTP)H4Halt Non Compliance
C / O (UTP)H9Halt Filings Not Current
C / O (UTP)H10Halt SEC Trading Suspension
C / O (UTP)H11Halt Regulatory Concern
C / O (UTP)01Operations Halt, Contact Market Operations
C / O (UTP)IPO1IPO Issue not yet Trading
C / O (UTP)M1Corporate Action
C / O (UTP)M2Quotation Not Available
C / O (UTP)LUDPVolatility Trading Pause
C / O (UTP)LUDSVolatility Trading Pause – Straddle Condition
C / O (UTP)MWC1Market Wide Circuit Breaker Halt - Level 1
C / O (UTP)MWC2Market Wide Circuit Breaker Halt - Level 2
C / O (UTP)MWC3Market Wide Circuit Breaker Halt - Level 3
C / O (UTP)MWC0Market Wide Circuit Breaker Halt - Carry over from previous day
C / O (UTP)T3News and Resumption Times
C / O (UTP)T7Single Stock Trading Pause/Quotation-Only Period
C / O (UTP)R4Qualifications Issues Reviewed/Resolved; Quotations/Trading to Resume
C / O (UTP)R9Filing Requirements Satisfied/Resolved; Quotations/Trading To Resume
C / O (UTP)C3Issuer News Not Forthcoming; Quotations/Trading To Resume
C / O (UTP)C4Qualifications Halt ended; maint. Req. met; Resume
C / O (UTP)C9Qualifications Halt Concluded; Filings Met; Quotes/Trades To Resume
C / O (UTP)C11Trade Halt Concluded By Other Regulatory Auth,; Quotes/Trades Resume
C / O (UTP)R1New Issue Available
C / O (UTP)RIssue Available
C / O (UTP)IPOQIPO security released for quotation
C / O (UTP)IPOEIPO security – positioning window extension
C / O (UTP)MWCQMarket Wide Circuit Breaker Resumption

Bar Data Format

Bars use p: "S" and t: "bar", contain one OHLCV entry in the s array, and use bt: "1D".

FieldDescription
cSIP-prefixed symbol identifier
pFeed identifier, always S
tMessage type marker, always bar
btBar interval marker, always 1D
s[].tBar timestamp in Unix seconds with millisecond precision
s[].o / h / l / cOpen, high, low, and close prices
s[].vAccumulated volume
s[].nAccumulated trade count

Example Bar Response:

JSON
{
  "c": "SIP:AAPL",
  "p": "S",
  "t": "bar",
  "bt": "1D",
  "s": [
    {
      "t": 1614009104.208,
      "o": 126.55,
      "h": 127.12,
      "l": 125.98,
      "c": 126.89,
      "v": 1234567,
      "n": 4312
    }
  ]
}

Trade Data Format

Trade payloads include p: "S" and t: "trade", include the trade in the s array, and use bt: "1T".

Standard trades include a trade id in s[].i. Trade corrections and cancellations use the same payload shape and add s[].e; standard trades omits[].e.

Correction-only fields are s[].oi, s[].op, s[].os, and s[].oc. The s[].e marker appears on correction and cancellation/error payloads. Cancellation/error payloads also include s[].cm as the cancel message: cancel or error.

FieldDescription
cSIP-prefixed symbol identifier
pFeed identifier, always S
tMessage type marker, always trade
btTrade interval marker, always 1T
s[].tTrade timestamp in Unix seconds with millisecond precision
s[].iTrade id
s[].cTrade price
s[].vTrade size
s[].xTrade exchange label
s[].zTape code
s[].tcTrade condition codes
s[].eOptional trade event marker: correction or cancel
s[].oiOriginal trade id for corrections
s[].op / os / ocOriginal price, size, and condition codes for corrections
s[].cmCancel message: cancel or error

Example Trade Response:

JSON
{
  "c": "SIP:AAPL",
  "p": "S",
  "t": "trade",
  "bt": "1T",
  "s": [
    {
      "t": 1614009104.208,
      "i": 96921,
      "c": 126.55,
      "v": 1,
      "x": "FINRA_ADF",
      "z": "C",
      "tc": ["@", "I"]
    }
  ]
}

Example Trade Correction Response:

JSON
{
  "c": "SIP:EEM",
  "p": "S",
  "t": "trade",
  "bt": "1T",
  "s": [
    {
      "t": 1680791106.542,
      "i": 52983525034326,
      "oi": 52983525033527,
      "c": 39.1809,
      "v": 440000,
      "x": "CHICAGO_STOCK_EXCHANGE",
      "e": "correction",
      "z": "B",
      "tc": [" ", "7"],
      "op": 39.1582,
      "os": 440000,
      "oc": [" ", "7"]
    }
  ]
}

Example Trade Cancellation Response:

JSON
{
  "c": "SIP:AAPL",
  "p": "S",
  "t": "trade",
  "bt": "1T",
  "s": [
    {
      "t": 1614009104.208,
      "i": 96921,
      "c": 126.55,
      "v": 1,
      "x": "FINRA_ADF",
      "e": "cancel",
      "cm": "cancel",
      "z": "C"
    }
  ]
}