Market Data FAQ

Frequently Asked Questions

Stocks

What's the difference between IEX and SIP data?

SIP is short for Securities Information Processor. All US exchanges are mandated by the regulators to report their activities (trades and quotes) to the consolidated tape. This is what we call SIP data.

IEX (Investors Exchange) is a single stock exchange.

Our free market data offering includes live data only from the IEX exchange:

wss://stream.data.alpaca.markets/v2/iex

The Algo Trader Plus subscription on the other hand offers SIP data:

wss://stream.data.alpaca.markets/v2/sip

On the historical endpoints you can use the feed parameter to switch between the two data feeds:

$ curl -s -H "APCA-API-KEY-ID: ${APCA_API_KEY_ID}" -H "APCA-API-SECRET-KEY: ${APCA_API_SECRET_KEY}" \
  "https://data.alpaca.markets/v2/stocks/AAPL/bars?feed=sip&timeframe=1Day&start=2023-09-29&limit=1" | jq .
{
  "bars": [
    {
      "t": "2023-09-29T04:00:00Z",
      "o": 172.02,
      "h": 173.07,
      "l": 170.341,
      "c": 171.21,
      "v": 51861083,
      "n": 535134,
      "vw": 171.599691
    }
  ],
  "symbol": "AAPL",
  "next_page_token": "QUFQTHxEfDIwMjMtMDktMjlUMDQ6MDA6MDAuMDAwMDAwMDAwWg=="
}
$ curl -s -H "APCA-API-KEY-ID: ${APCA_API_KEY_ID}" -H "APCA-API-SECRET-KEY: ${APCA_API_SECRET_KEY}" \
  "https://data.alpaca.markets/v2/stocks/AAPL/bars?feed=iex&timeframe=1Day&start=2023-09-29&limit=1" | jq .
{
  "bars": [
    {
      "t": "2023-09-29T04:00:00Z",
      "o": 172.015,
      "h": 173.06,
      "l": 170.36,
      "c": 171.29,
      "v": 923134,
      "n": 12630,
      "vw": 171.716432
    }
  ],
  "symbol": "AAPL",
  "next_page_token": null
}

In this example (2023-09-29 Apple daily bar) you can clearly see the difference between the two feeds: there were 12 630 eligible trades on the IEX exchange that day and more than 535 136 trade in total across all exchanges (naturally including IEX). Similar difference can be seen between the volumes.

All the latest endpoints (including the snapshot endpoint) require a subscription to be used with the SIP feed. And for historical queries, the end parameter must be at least 15 minutes old to query SIP data without a subscription. The default value for feed is always the "best" available feed based on the user's subscription.

$  curl -s -H "APCA-API-KEY-ID: ${APCA_API_KEY_ID}" -H "APCA-API-SECRET-KEY: ${APCA_API_SECRET_KEY}" \
  "https://data.alpaca.markets/v2/stocks/AAPL/trades/latest" | jq .
{
  "symbol": "AAPL",
  "trade": {
    "t": "2023-09-29T19:59:59.246196362Z",
    "x": "V",  // << IEX exchange code
    "p": 171.29,
    "s": 172,
    "c": [
      "@"
    ],
    "i": 12727,
    "z": "C"
  }
}
$ curl -H "APCA-API-KEY-ID: ${APCA_API_KEY_ID}" -H "APCA-API-SECRET-KEY: ${APCA_API_SECRET_KEY}" \
  "https://data.alpaca.markets/v2/stocks/AAPL/trades/latest?feed=sip"
{"code":42210000,"message":"subscription does not permit querying recent SIP data"}

In this example we're querying the latest AAPL trade without a subscription. We can see that the default feed in this case is iex. If we try to query the SIP feed, we get an error. To fix that error, we need to subscribe to Algo Trader Plus.

Why can't I find market data for a particular symbol (e.g. CGRNQ)?

OTC: Make sure the symbol is not traded in OTC using the assets endpoint https://api.alpaca.markets/v2/assets/CGRNQ returns

{
  "id": "dc2d8be9-33b5-4a32-8f57-5b7d209d2c82",
  "class": "us_equity",
  "exchange": "OTC", // << This symbol is traded in OTC
  "symbol": "CGRNQ",
  "name": "CAPSTONE GREEN ENERGY CORP COM PAR $.001",
  "status": "active",
  "tradable": false,
  "marginable": false,
  "maintenance_margin_requirement": 100,
  "shortable": true,
  "easy_to_borrow": true,
  "fractionable": true,
  "attributes": []
}

Market data for OTC symbols can only be queried with a special subscription currently only available for broker partners. If you do have the subscription, you can use feed=otc to query the data.

Halt: Make sure the symbol isn't halted, or wasn't halted at the time you're querying. You can check the current halts or the historical halts on the Nasdaq website. For example the symbol SVA has been halted since 2019-02-22.

Crypto

Why are there crypto bars with 0 volume / trade count?

Our crypto market data reflects trades and quotes from our own Alpaca exchange. Due to the volatility of some currencies, including lack of trade volume at any given time, we include the quote midpoint prices to offer a better data experience. If in a bar no trade happens, the volume will be 0, but the prices will be determined by the quote prices.