npm install intrinio-realtime --save
var IntrinioRealtime =// Create an IntrinioRealtime instancevar ir =username: "INTRINIO_API_USERNAME"password: "INTRINIO_API_PASSWORD"provider: "iex"// Listen for quotesir// Join channelsir
Currently, Intrinio offers realtime data from the following providers:
Each has distinct price channels and quote formats, but a very similar API.
Each data provider has a different format for their quote data.
NOTE: Messages from QUOOD reflect changes in market data. Not all fields will be present in every message. Upon subscribing to a channel, you will receive one quote and one trade message containing all fields of the latest data available.
ticker: "AAPL.NB"root_ticker: "AAPL"protocol_id: 301last_price_4d: 1594850trade_volume: 100trade_exchange: "t"change_price_4d: 24950percent_change_4d: 15892trade_time: 1508165070052up_down: "v"vwap_4d: 1588482total_volume: 10209883day_high_4d: 1596600day_high_time: 1508164532269day_low_4d: 1576500day_low_time: 1508160605345prev_close_4d: 1569900volume_plus: 6333150ext_last_price_4d: 1579000ext_trade_volume: 100ext_trade_exchange: "t"ext_change_price_4d: 9100ext_percent_change_4d: 5796ext_trade_time: 1508160600567ext_up_down: "-"open_price_4d: 1582200open_volume: 100open_time: 1508141103583rtl: 30660is_halted: falseis_short_restricted: false
ticker: "AAPL.NB"root_ticker: "AAPL"bid_size: 500ask_size: 600bid_price_4d: 1594800ask_price_4d: 1594900ask_exchange: "t"bid_exchange: "t"quote_time: 1508165070850protocol_id: 302rtl: 129739
type: 'ask'timestamp: 14934095093932788ticker: 'GE'size: 13750price: 2897
last- represents the last traded price
bid- represents the top-of-book bid price
ask- represents the top-of-book ask price
lasttrade, or total volume of orders at the top-of-book
To receive price quotes from QUODD, you need to instruct the client to "join" a channel. A channel can be
To receive price quotes from the Intrinio Real-Time API, you need to instruct the client to "join" a channel. A channel can be
$lobby) where all price quotes for all securities are posted
$lobby_last_price) where only last price quotes for all securities are posted
Special access is required for both lobby channels. Contact us for more information.
constructor(options) - Creates a new instance of the IntrinioRealtime client.
options: An object with
providerproperties corresponding to your Intrinio API Username and Password and either "iex" or "quodd" providers.
var ir =username: "INTRINIO_API_USERNAME"password: "INTRINIO_API_PASSWORD"provider: "iex"
destroy() - Closes the WebSocket, stops the self-healing and heartbeat intervals. You MUST call this to dispose of the client.
onError(callback) - Invokes the given callback when a fatal error is encountered. If no callback has been registered and no
error event listener has been registered, the error will be thrown.
callback- The callback to invoke. The error will be passed as an argument to the callback.
onQuote(callback) - Invokes the given callback when a quote has been received.
callback- The callback to invoke. The quote will be passed as an argument to the callback.
join(...channels) - Joins the given channels. This can be called at any time. The client will automatically register joined channels and establish the proper subscriptions with the WebSocket connection.
channels- An argument list or array of channels to join. See Channels section above for more details.
leave(...channels) - Leaves the given channels.
channels- An argument list or array of channels to leave.
leaveAll() - Leaves all joined channels.
listConnectedChannels() - Returns the list of joined channels. Recently joined channels may not appear in this list immediately.
connect - Emitted when connected to the websocket successfully.
quote - Emitted when a new quote has been received.
error - Emitted when a fatal error is encountered. If no
onError callback has been registered and no event listener has been registered, the error will be thrown.