Skip to main content
Python function: getOHLCV()
SpecificationValue
Delivery Frequencycontinuous
Data Frequencydaily, intraday (min/hour)
Reporting LagDaily bars on market close; intraday bars in near-real-time
Coverage10,000+ U.S. equities and ETFs (NYSE, NASDAQ, AMEX, BATS)
HistorySince 2003-01-02
AvailabilityFree

Product Overview

Overview

Equity & ETF OHLCV provides standardized Open, High, Low, Close, and Volume price bars for U.S.-listed equities and exchange-traded funds. The dataset supports daily, hourly, and minute-level granularity, enabling everything from long-horizon backtesting to intraday signal research. Daily bars are maintained in an internal repository that is continuously updated and automatically backfilled from exchange-consolidated trade feeds. Intraday bars (minute and hourly) are sourced from real-time aggregated exchange data.

Data Pipeline

Daily Bars

Scalar Field maintains a repository of daily OHLCV bars sourced from consolidated exchange feeds:
  • Continuous updates: New daily bars are appended as they become available after market close.
  • Automatic backfill: If gaps are detected for any ticker, the system automatically backfills from the upstream exchange-consolidated data provider.
  • Corporate actions: Prices are adjusted for splits and dividends to produce a continuous adjusted price series.

Intraday Bars

Minute and hourly bars are constructed from real-time trade data:
  • Trade-level aggregation: OHLCV bars are built from tick-level trade data. Each trade carries “sale condition” flags that determine which OHLCV components it updates — for example, certain off-exchange trade conditions may update volume but not the high/low prices. This follows Securities Information Processor (SIP) consolidated processing guidelines.
  • Granularity: 1-minute bars are the base unit; hourly bars are aggregated from minute bars.
  • Timestamps: All intraday timestamps are in New York (Eastern) time.

Coverage

  • Universe: 10,000+ U.S.-listed equities and ETFs (NYSE, NASDAQ, AMEX, BATS, and other lit venues).
  • Daily history: Back to 2003 for most liquid names; varies by listing date for newer securities.
  • Intraday history: Approximately 2 years of minute and hourly bars.
  • Update frequency: Daily bars updated on market close; intraday bars available in near-real-time during market hours (typically 10–20 minutes after open, ending 10–20 minutes before close).

Supported Modes

ModeTriggerNotes
Daily historicalstart/end as 'YYYY-MM-DD'Timeframe defaults to 'day'. Stale parquet data is automatically backfilled.
Intraday historicalstart/end as 'YYYY-MM-DDTHH:MM:SS'Timeframe defaults to 'min'; can set 'hour'. New York timezone.
Near-real-timeSet start/end to recent datetimesReturns 1-minute bars for the requested window.

Querying the Data

Basic Usage

from scalarlib import getOHLCV

# Daily bars for multiple equities
data = getOHLCV(tickers=['AAPL', 'MSFT', 'NVDA'], start='2025-01-01', end='2025-12-31')
aapl_df = data['AAPL']

# Intraday minute bars
data = getOHLCV(tickers=['AAPL'], start='2026-03-24T09:30:00', end='2026-03-24T16:00:00')

# Hourly bars with explicit timeframe
data = getOHLCV(tickers=['SPY'], start='2025-06-16', end='2025-06-18', timeframe='hour')

# Near-real-time: last 30 minutes
from datetime import datetime, timedelta
now = datetime.now()
data = getOHLCV(
    tickers=['AAPL'],
    start=(now - timedelta(minutes=30)).strftime('%Y-%m-%dT%H:%M:%S'),
    end=now.strftime('%Y-%m-%dT%H:%M:%S')
)

Parameters

ParameterTypeRequiredDescription
tickerslist of strYesEquity/ETF ticker symbols (e.g., ['AAPL', 'SPY']).
startstrYesStart date ('YYYY-MM-DD') or datetime ('YYYY-MM-DDTHH:MM:SS', New York time).
endstrYesEnd date or datetime (same format as start).
timeframestrNo'day', 'min', or 'hour'. Default: inferred from date format — date-only defaults to daily, datetime defaults to minute.

Column Definitions

OHLCV Schema

ColumnTypeDescription
ts_recvdatetime64[ns]Bar timestamp. For daily bars, the trading date. For intraday, the bar’s start time in New York time.
tickerstringTicker symbol (e.g., AAPL, SPY).
openfloat64Opening price of the bar.
highfloat64Highest traded price during the bar.
lowfloat64Lowest traded price during the bar.
closefloat64Closing price of the bar.
volumeint64Number of shares traded during the bar.