Skip to main content

Datafeed API

The minimum required contract is MarketDataFeed with symbol resolution and historical Bar loading; realtime, quotes, depth, and sessions are optional capabilities layered on top.

Search 279 supported datafeed contracts below. Expand a result to see its TypeScript declaration, properties, methods, parameters, return values, and errors. Share a filtered URL or a symbol anchor when another engineer needs the same contract.

Start here

Browse the reference

Classes 1

Wraps a host-implemented MarketDataFeed behind the public MarketDataControllerApi: it validates and normalizes requests, assigns subscription ids, tracks live subscriptions for teardown, caches the feed's declared configuration, and reports effective capabilities as the intersection of what the feed declares and what it actually implements. Constructing one binds the feed as the controller's permanent authority; unimplemented feed methods surface as datafeed.unsupported SdkErrors.

Interfaces 162

Typed detail payload for analyst-rating market events, describing the analyst action plus any rating and price-target change.
One OHLCV bar in the public datafeed contract, timestamped at the bar's opening time in Unix milliseconds (UTC).
A persisted cache entry for one (symbol, interval) series. Holds the bars the cache knows about plus the boundary flags that tell the loader whether older / newer history still exists upstream.
Identifies one cached bar series: the symbol descriptor plus the chart interval its bars were fetched at. Stores serialize it to a stable <ticker>::<interval> string key.
Pluggable persistence for cached bars. Modeled on the SDK's ChartStorageAdapter: a small async interface a consumer can implement to back the cache with IndexedDB, a server, Redis, or nothing. Implementations own their own TTL / eviction; get MUST return null for entries they consider expired or missing.
Window parameters the chart passes to the datafeed's history method: the requested time range, target bar count, and the pagination direction being loaded.
Datafeed response for one history page: the bars in ascending timestamp order plus coverage flags that drive further pagination.
Common configuration shared by the built-in bar cache stores: a TTL (entries older than it read as missing), maxEntries (default 200), an optional maxBars cap across all series, an opt-in per-series bar cap keeping the most recent N, a pluggable eviction policy (LRU by default), and an injectable clock for tests.
Configuration for createCachingDatafeed: the cache policy (none, memory, or persistent) and an optional explicit store, TTL and eviction limits, a namespace for the default IndexedDB store, opt-in synthetic aggregation and empty-bar generation, the resolution rebuild policy, and an injectable clock for tests.
Resolved per-symbol session policy for a calendar-scoped series: session filtering, shading, and aggregation require a session calendar, and a missing calendar is a typed integration error — never an empty successful result.
Native interval-family policy, set via features.intervalFamilies, that widens the eligible interval set (tick-count intervals, second intervals, or additional exact intervals) before datafeed and symbol capability narrowing.
Detail payload attached to corporate-action market events (merger-acquisition, spinoff, offering, buyback, rights-redemption, reorganization, symbol-name-change, and listing-status) via MarketEvent.details. All fields are optional so feeds supply whatever the action type provides.
Request passed to MarketDataFeed.getDataWindow (and MarketDataControllerApi.getDataWindow) asking the feed for the labeled values shown in the SDK's data-window panel, optionally pinned to the current crosshair position.
Feed-supplied set of labeled values rendered in the SDK's data-window panel. The panel re-requests a snapshot as the crosshair, live bars, symbol, or interval change.
One labeled row of a data-window snapshot, supplied by the datafeed and rendered as-is by the data-window panel.
One price level on the bid or ask side of an SdkMarketDepth book snapshot.
Parameters for a one-shot market-depth read via MarketDataFeed.getDepth; also the base shape extended by DepthSubscription for streaming depth.
Identifies one streaming market-depth subscription passed to MarketDataFeed.subscribeDepth, extending DepthRequest with a subscription identity.
Typed detail block carried by dividend market events, covering the dividend classification, amount, and key calendar dates.
Typed detail block carried by earnings market events, covering the fiscal period, session timing, and EPS/revenue comparisons.
Typed detail block carried by economic-release market events describing a macroeconomic data release.
Options object form of EmptyBarGenerationSetting controlling how createCachingDatafeed synthesizes flat empty bars for missing in-session slots, including which session-calendar source determines the slots that should exist.
Exact loaded-range coverage requested from a mounted chart's own history pipeline.
Outcome of an ensureHistory call: loaded-range snapshots taken before and after the call, how much history was loaded, and why loading stopped.
Per-entry stats handed to an eviction policy. One entry == one (market-data series, interval) series. Timestamps are epoch ms.
Capacity limits handed to a BarCacheEvictionPolicy: an optional maximum number of retained (symbol, interval) series (maxEntries) and an optional maximum total bar count across all series (maxBars). With neither set, no eviction occurs.
Options for exportCsv, extending the data-export options with CSV serialization controls: a field-id column filter, an opt-in UTF-8 byte-order mark, and the line ending (CRLF by default).
Options for exportData controlling which column families are included (comparisons, indicators, volume) and an optional millisecond time range restricting the exported rows.
Columnar snapshot returned by exportData: a schema of field descriptors plus parallel numeric and display-formatted columns over a merged time axis.
One time/value sample in an external instrument series such as open interest or funding rate.
Request passed to MarketDataFeed.getExternalSeries for a derivatives-family series (open interest or funding rate) that is not derivable from OHLCV.
Response from MarketDataFeed.getExternalSeries: the series kind served and its sampled points.
Describes one exported data column: its identity, value kind, producing source, and display formatting hints. Returned in ExportedData.schema.
Type-specific details attached to regulatory-filing market events.
Bid/ask footprint options — ladders built from the datafeed's time & sales tape.
Per-element footprint color overrides; unset entries use the layer defaults.
Type-specific details attached to futures lifecycle market events: futures-roll, futures-expiry, futures-first-notice, and futures-last-trade.
Request for one page of market events for a symbol over a time window, passed to MarketDataFeed.getEvents and MarketEventProvider.getEvents; supports type and provider filtering plus cursor pagination.
Type-specific details attached to guidance market events describing company-issued financial guidance.
Options for createIndexedDbBarStore: the common BarStoreOptions (TTL, entry/bar limits, eviction policy, clock) plus an optional namespace that prefixes the database name (<namespace>-bar-cache) so instances or tenants do not collide.
One indicator plot's column in exported chart data, supplied by the chart engine to the data/CSV export pipeline with its per-time values and display attributes.
One time/value sample of an exported indicator plot inside IndicatorExportColumn.values.
Reference profile of an instrument returned by the datafeed's getInstrumentDetails operation. Extends the resolved SdkSymbolInfo with descriptive and fundamental data (exchange, sector, market cap, etc.) for host UI such as instrument-info surfaces.
Request payload for the datafeed and market-data controller getInstrumentDetails operation, identifying the instrument whose reference profile is wanted.
Canonical loaded-range state shared by the chart engine and public SDK history APIs.
Per-channel delivery-quality declaration for one market-data channel, splitting the snapshot (get/read) and stream (subscription) operations into separate MarketDataDeliveryQualityCapability contracts. Used by MarketDataQualityCapabilities for channels such as depth.
Exact quality contract for one provider operation. This is separate from method support: a mounted method with no declaration is supported but unqualified, so sequence-sensitive agents must not infer continuity.
Authorization-bound constructors for non-visual market-data products.
The host-implemented datafeed contract the chart consumes. Only loadBars is required; each optional method progressively unlocks a capability — symbol search, live streaming, quotes, depth, tape, events, sessions, news, watchlists, options — and the SDK treats unimplemented methods as unsupported.
Capability and configuration manifest a datafeed returns from MarketDataFeed.onReady, telling the chart which optional feed operations (search, marks, streaming, quotes, depth, news, and so on) it may call and how to call them. Feature UI that depends on an operation only appears when the matching flag is set.
Portable per-frame evidence. observedAt - sourceTime is the data age at receipt when sourceTime exists; its absence is an explicit lack of source freshness evidence rather than an invitation to infer it from transport.
Provider-declared quality for agent-relevant microstructure channels.
Exact sequence discontinuity observed between delivered update frames.
Inclusive source sequence range carried by one frame.
Provider-owned delivery and content contract for time-and-sales data.
One order-book frame delivered by MarketDataFeed.getDepth or a depth subscription — bid and ask levels plus optional per-frame quality evidence — feeding the depth and order-flow heatmap surfaces.
Fields shared by every market event regardless of type: source-scoped identity, event type, affected symbols, timing and precision, display copy, and optional classification data such as importance, entities, and sentiment.
The set of event-type descriptors a feed, provider, or the merged controller declares; it defines which event types exist, how their markers render, and how their detail fields format.
Payload of the market-event-catalog-change chart event, emitted whenever the merged event-type catalog changes through provider or type registration and removal.
Describes one field of an event's details payload for the built-in detail view: the payload key, its display label, and how its value formats.
A structured entity referenced by a market event — a company, person, instrument, or other named thing — with a source-defined kind and a display label.
Constraints for MarketEventsControllerApi.get and clear, selecting events by source ids, type ids, and time range; omitted fields match everything.
Names the timeline group an event type belongs to — a built-in group like news or corporate actions, or a custom group — for grouping and ordering types in the events UI.
Visual styling of an event type's chart marker badge — label, glyph, or icon content plus shape, colors, border, and size. Applied in layers: descriptor default, then feature-option override, then user display-setting override.
A dated sub-step of a market event's lifecycle (e.g. an ex-date or payable date), listed in the event's detail view.
One page of events returned by getEvents; a present nextCursor tells the controller to re-issue the request with that cursor for the next page.
A pluggable source of market events registered through MarketEventsControllerApi.registerProvider: it declares its event-type catalog, serves paged history, and can stream live updates.
Payload of the market-event-provider-error chart event, describing one provider's fetch or streaming failure; failures are reported per provider instead of rejecting the whole refresh.
Payload of the market-events-change chart event, emitted whenever the controller's event set changes; it carries the full current event list plus what caused the change.
Controller for the chart's market-events subsystem, obtained from chart.marketEvents(). Hosts use it to register providers and custom event types, manage host-owned events, query the merged set, drive the events center, and refresh from providers.
Scope options for MarketEventsControllerApi.refresh: which providers and event types to refetch, the time window, and the per-request page size.
Identifies one live event stream passed to subscribeEvents: the same parameters as a GetEventsRequest (minus the paging cursor) plus a stable subscription id.
Declares one event type for the catalog: its identity and ownership, display label, timeline group, default marker styling, detail-field formatting, and default visibility.
Actual/estimate/previous value triple used in event details — for example earnings EPS and revenue, or an economic indicator — with an optional unit or currency.
Exchange session calendar consumed by resolveMarketSessionInfo for symbols that are not 24x7 or 24x5: a timezone, wall-clock daily hours, and an optional per-day resolver for holidays and early closes. Without a resolveDay resolver, weekdays are open and weekends closed.
Authorization-bound market-session computations, providers, and feed decorators.
Details payload for trading-halt and trading-resumption market events: the halt code, its reason, and the expected resumption time.
Range request passed to MarketDataFeed.getMarks (and, as TimeScaleMarksRequest, to getTimescaleMarks) asking for marks covering a symbol, interval, and time span.
One headline returned by the datafeed's getNews. The built-in news control and news rail panel render these items for the chart's active symbol.
Query passed to the datafeed's getNews describing which headlines to load. The built-in news control issues one with the chart's current symbol and a default item limit.
One option contract row within an OptionSeriesSnapshot — identity (code, expiration, strike, right), quote and size fields, greeks, and provenance metadata as delivered by the options datafeed. Also exported under the OptionContract alias.
Request for an option-chain snapshot. expiration narrows to a single expiry when provided.
Option facts carried by a resolved chart symbol that charts an option contract. The exact resource identity round-trips through the selection so hosts never reconstruct it from OCC or provider string parsing.
Request for refreshed option quotes/greeks for a symbol (optionally one expiry).
One option contract row within an OptionSeriesSnapshot — identity (code, expiration, strike, right), quote and size fields, greeks, and provenance metadata as delivered by the options datafeed. Also exported under the OptionContract alias.
Canonical option-series payload returned by the options endpoints: the contract list for an underlying together with its expiration and strike axes, quote freshness, and per-field provenance and availability metadata.
One sampled order-book column handed to the chart's heatmap layer.
Render payload for the in-chart heatmap layer (mirrors the engine contract).
Host-facing switches for the in-chart order-flow liquidity heatmap.
Visual controls for the liquidity heat field. All of these apply live — changing them never restarts the book sampler.
Decomposed form of a chart interval token as produced by parseChartInterval, pairing the canonical token with its span, unit, and semantic kind.
Exact event, market, and tradable-outcome facts carried by a resolved prediction-contract symbol. Providers originate this contract; tickets and brokers transport it without parsing ticker text or inferring an outcome from order side.
Cash amount paid by one winning prediction contract after authoritative resolution.
Provider-authored rules used to determine a prediction market's winning outcome.
Describes how a symbol's prices should be formatted for display. Mirrors common charting-library price-format fields so feeds can express decimal, fractional, fraction-of-a-fraction, pip, and variable-tick pricing. - Decimal: priceScale is 10^n where n is the number of decimals; the tick size is minMove / priceScale. - Fractional: fractional is true and priceScale is 2^n (the number of fractions, e.g. 32). Rendered as x'yy (e.g. 133'21). - Fraction of a fraction: additionally minMove2 > 0 splits each fraction, rendered as x'yy'z (e.g. ZB futures 119'16'2).
One symbol's quote snapshot delivered by MarketDataFeed.getQuotes and subscribeQuotes, feeding legend quote fields, watchlist rows, and the extended-hours price line.
Parameters for a one-shot quote read via MarketDataFeed.getQuotes.
Describes a streaming quote subscription passed to MarketDataFeed.subscribeQuotes: which symbols to quote and which of them need the fastest update cadence.
Describes a live-bar stream passed to MarketDataFeed.subscribeRealTimeBars: the symbol and interval to stream, optional transport routing hints, and the feed-invoked cache-reset signal.
Transport routing hints for real-time streams, set via the widget/per-chart realtime option and passed through to the feed on each RealTimeBarSubscription.transport.
Declarative resolution support for a symbol. A more compact alternative to listing every interval in supportedIntervals. Multipliers default to a sensible per-band set when a has* flag is set without a list.
The resolved form of a symbol selection produced by the SDK's shared resolver and consumed by history, realtime, calendars, controller state, engine state, drawings, alerts, and trading. The resolver validates and stamps the exact market-data series identity at the resolution boundary, so it is always present here.
Inputs for resolveEnabledChartIntervals, combining feed-level interval support, per-symbol declarations, and a host override into one interval resolution.
One order-book frame delivered by MarketDataFeed.getDepth or a depth subscription — bid and ask levels plus optional per-frame quality evidence — feeding the depth and order-flow heatmap surfaces.
Resolved instrument descriptor returned by datafeed symbol resolution and carried wherever a symbol travels in the SDK — identity, display fields, price formatting, session and resolution capabilities, and entitlement flags.
Session calendar returned by a SessionAggregationCalendarProvider: the concrete session windows (plus optional week anchor) used to build session-aligned aggregated bars instead of fixed UTC buckets.
UTC epoch-ms range for which a session calendar is authoritative. Consumers can distinguish a covered closed period from a range whose calendar has not loaded yet.
Parameters handed to a SessionAggregationCalendarProvider when session windows are needed to aggregate one symbol's bars across a time range.
One concrete trading-session window inside a SessionAggregationCalendar — UTC open/close bounds plus optional trading day, state, and close event — whose boundaries intraday aggregation buckets align to.
The resolved status of one trading day in a market session calendar: open or closed, with optional holiday naming and early-close flags that switch the day onto the calendar's early-close hours.
Wall-clock daily session boundaries for a market calendar, expressed in the calendar's timezone; the optional entries add pre-market and after-hours windows and early-close variants.
The UTC time range buildSessionCalendar compiles a schedule for; session windows overlapping the range are included in the resulting calendar.
A source-owned action attached to one exact session close. Consumers act on this identity directly and must not derive it from session names or clocks.
A MarketDataFeed whose session visibility can be changed in place. Include states apply immediately to history loads and live realtime subscriptions; subscribers are notified so chart surfaces can refetch the visible series.
A typed, observable session-filter failure. History failures reject the load; realtime failures are asynchronous, so they surface here instead of silently queueing bars forever.
Options for createSessionFilterDatafeed. Filtering is strict: a bar is kept only when it falls inside a calendar window whose state is in include. Bars in uncovered time are dropped, so an incomplete calendar shows up immediately instead of silently passing extended-hours data through.
Current session status for a symbol delivered by MarketDataFeed.subscribeSessionInfo: the state in effect plus upcoming session windows, feeding the toolbar session badge and its countdown.
Options for createSessionInfoProvider: how far ahead upcoming session windows are collected (default 7 days) and an injectable epoch-ms clock (default Date.now), primarily for tests.
Identifies the symbol a session-status request targets; the base shape extended by SessionInfoSubscription for streaming session info.
  • Realtime Bars — update versus append semantics and correction handling
  • Resolutions — which intervals you serve natively and which the SDK derives
  • Market Data Types — mapping your backend payloads onto these contracts