Does Alpaca have NBBO quotes from *all* exchanges?

It looks like the sip feed only returns the NBBO bid/ask prices and sizes from a single exchange. Is there any way to get a full list of all exchanges currently offering the NBBO bid/ask price (and their lot sizes)?

For example, a stocks/quotes/latest API call for AAPL only ever returns just one exchange for bid and one for ask (e.g., “Q” and “N”), even though that bid/ask is also available on other exchanges simultaneously:

{
  "quotes": {
    "AAPL": {
      "ap": 168.24,
      "as": 3,
      "ax": "Q",
      "bp": 168.23,
      "bs": 1,
      "bx": "N",
      "c": [
        "R"
      ],
      "t": "2024-04-17T19:37:14.162228769Z",
      "z": "C"
    }
  }
}

For comparison, Interactive Brokers displays a “Consolidated Snapshot” (and available in their API as a “regulatory snapshot”) that shows all exchanges where AAPL’s NBBO bid/ask prices are available along with the cumulative bid/ask sizes across all those exchanges (e.g., in the red rectangles below, the Bid is available on exchanges P, Q and Ask is on exchanges J, P, Q, Z, N, U with 300 x 700 in cumulative lot sizes):

I’d like to get this info from Alpaca if possible. If not, is there any way to know how Alpaca’s SIP feed picks the single exchange it chooses to return?

Many thanks in advance, this API is a pleasure to use thanks to its simplicity. I’d love to build more on it! But I’m finding it a bit tricky to make complex order decisions when I can’t see how much bid/ask is available in the market at order construction time.

Thanks again for any help!

@adamo The Alpaca real time quotes are indeed full market National Best Bid Offer (NBBO) and include all exchanges and trading venues posting displayed quotes. Note full market real time quotes are only available if one subscribes to the paid Market Data plan. The Free Market Data plan offers real time quotes but only from the IEX exchange (ie not NBBO). Historical quotes older than 15 minutes are full market NBBO quotes on either plan.

That’s great news! All the API calls I’ve ever made only ever have a single exchange code for bid/ask. I can’t seem to get a response that includes all exchanges and their bid/ask sizes.

Could you provide a sample API response that shows all exchanges (instead of just one at a time)? The docs also seem to indicate that the response’s ax and bx values are only single letters, so I’m not sure what that even looks like.

Thanks for the prompt respone!

@adamo The response from a call to latest quote returns exactly one bid and one ask which is the ‘best’ bid and ask across all exchanges and other trading venues displaying quotes (which is where the term National Best Bid Offer NBBO comes from). So you are correct that ax and bx will have exactly one exchange code. Alpaca doesn’t provide any other quotes than NBBO which by definition will be from the single best exchange and doesn’t provide any ‘market depth’ quotes.

Here is an example request and the associated response

GET https://data.alpaca.markets/v2/stocks/quotes/latest?symbols=IBM,SPY&feed=sip
{
    "quotes": {
        "SPY": {
            "ap": 500.78,
            "as": 9,
            "ax": "Z",
            "bp": 500.68,
            "bs": 2,
            "bx": "P",
            "c": [
                "R"
            ],
            "t": "2024-04-17T21:10:53.255131648Z",
            "z": "B"
        },
        "IBM": {
            "ap": 183.3,
            "as": 5,
            "ax": "P",
            "bp": 183.01,
            "bs": 2,
            "bx": "K",
            "c": [
                "R"
            ],
            "t": "2024-04-17T20:51:42.010893568Z",
            "z": "A"
        }
    }
}

Ah ok, I misunderstood your previous response. Thanks for confirming it’s just the single exchange.

Is there any way at all to replicate that IBKR feature I mentioned with Alpaca (where you get all exchanges where those NBBO bid/asks are currently available, instead of just the “best” one)?

@adamo Alpaca doesn’t have any other quote details than the ‘best’ NBBO quote as shown above. Technically, the quote will be the best AND the latest. If any of the quote attributes change, for example size or exchange, that will become the latest NBBO quote even though the bid/ask price may remain unchanged.

Great thanks again. One more question if you don’t mind: Do you know what the definition of “best” is in this context? If, say, the NBBO price for AAPL is $168.24 and it’s currently available on 5 exchanges at that price, which one is Alpaca / SIP feed returning? The first exchange to get that price? The latest one?

@adamo The NBBO quote is the best AND the latest. If for example exchange P submits a quote and then several milliseconds later exchange Z submit the identical quote (except of course now the exchange will be Z) then that last quote from exchange Z becomes the NBBO quote.

1 Like