Getting Started

Getting Started

To start streaming real-time stock prices from IEX via WebSocket, use one of our Real-Time SDKs:

Example SDK Code

Here is a brief example of how to stream real-time stock prices from IEX using our NodeJS Real-Time SDK:

'use strict';
var IntrinioRealtime = require('intrinio-realtime')

// Create an IntrinioRealtime instance
var ir = new IntrinioRealtime({
  api_key: "INTRINIO_API_KEY",
  provider: "iex"
})

// Listen for quotes
ir.onQuote(quote => {
  var { ticker, type, price, size, timestamp } = quote
  console.log("QUOTE: ", ticker, type, price, size, timestamp)
})

// Join channels
ir.join("AAPL", "MSFT", "GE")

Channels

In order to stream real-time stock prices, you must "join" a channel. The channels you join will determine which stock price quotes our SDK will send to you. Channels can be:

  • a security ticker, such as AAPL MSFT or GOOG
  • the lobby channel $lobby , which streams stock price quotes for all securities traded on IEX
  • the last price lobby channel $lobby_last_price , which streams only "last"-type stock price quotes for all securities traded on IEX

Note: The $lobby and $lobby_last_price channels require special access. Contact us for information.

Leaving Channels

In order to remain under your concurrent connection limit, you may have to "leave" channels you no longer want to receive stock price quotes from.

Limits

Depending on your subscription, the following limits may apply to your usage of our Real-Time SDKs for streaming stock price quotes from IEX:

Limit Type Example Explanation
Concurrent Connections 100 You may join up to 100 security channels at a time.
Daily Connection Limit 10,000 You may join different channels up to 10,000 times per day, typically resetting at 2 AM EST.
Firehose Enabled You may access the $lobby and $lobby_last_price channels.

Message Format

Here is a sample stock price quote and the corresponding field definitions.


                        
  • type - the quote type
    • "last" - represents the last traded price
    • "bid" - represents the top-of-book bid price
    • "ask" - represents the top-of-book ask price
  • timestamp - a Unix timestamp (with microsecond precision)
  • ticker - the ticker of the security
  • size - the size of the last trade, or total volume of orders at the top-of-book bid or ask price
  • price - the price in USD

Quotes on Connection

Upon connecting, the system will send you the last recorded IEX bid/ask/last quotes, even during off-hours. So you will notice that the first quote update will come through immediately upon connection, and it will have an older timestamp. All quotes afterwards are live updates.

Handling Large Numbers of Quotes

Each Real-Time SDK has a method for handling large numbers of quotes, typically by using a queue pattern. This is to prevent your system's memory from being overloaded by quotes not yet handled by your code. For more details, refer to the specific documentation for your chosen Real-Time SDK.