Skip to content

Live bars (SSE)

The V1.1 streaming contract.

A V1.1 Server-Sent Events connection multiplexes resolved instruments from one source with the same period, adjustment and aggregation.

Endpoint

GET /api/v1/market-data/sources/{sourceId}/stream?instruments=tradingview%3ANASDAQ%3AAAPL&period=daily&adjustment=none&barAggregation=original
Accept: text/event-stream

Pass comma-separated stable IDs in instruments. The barAggregation parameter is optional. The separate /sources/{sourceId}/quotes endpoint uses the same IDs for sources that advertise quotes.

The first data frame is hello. A fresh connection uses a fresh snapshot. The chart connection manager owns reconnection.

Frames

typeFields
helloseq: number ts: number instruments: ReadonlyArray<string> snapshotSize: number period?: KLinePeriod adjustment?: KLineAdjustment barAggregation?: BarAggregation
snapshotseq: number ts: number instrumentId: string bars: ReadonlyArray<StreamBar>
barseq: number ts: number instrumentId: string state: 'forming' | 'closed' bar: StreamBar
quoteseq: number ts: number instrumentId: string quote: StreamQuote
statusseq: number ts: number instrumentId: string status: StreamStatus detail?: string
pingseq: number ts: number
errorseq: number ts: number code: StreamErrorCode message: string retryable: boolean instrumentId?: string

StreamBar

FieldType
timestampnumber
opennumber
highnumber
lownumber
closenumber
volume?number
turnover?number

Instrument status values: live, market-closed, no-data, upstream-error.

On this page