Get Historical Stock Prices

Retrieve historical daily stock price data for any publicly traded company. Each record includes the open, high, low, close, adjusted close, volume, VWAP (volume-weighted average price), and daily change metrics. Results are sorted by date in descending order by default.

Use the date_start and date_end parameters to filter to a specific date range, or set a limit to control how many trading days are returned. Add format=excel to get tab-separated values compatible with Google Sheets IMPORTDATA() and Excel.

GEThttps://api.roic.ai/v2/stock-prices/{identifier}
Request
curl "https://api.roic.ai/v2/stock-prices/AAPL?apikey=YOUR_API_KEY"
Response
200 OK
[
  {
    "date": "2024-12-20",
    "open": 254.77,
    "high": 255.27,
    "low": 248.68,
    "close": 249.79,
    "adj_close": 249.45,
    "volume": 57620328,
    "unadjusted_volume": 57620328,
    "change": -4.98,
    "change_percent": -1.954,
    "vwap": 251.22,
    "label": "December 20, 24"
  }
]

Parameters

Path parameters

identifierstringrequired

Company identifier — supports ticker symbol (e.g., AAPL), CIK, CUSIP, or ISIN.

Example: AAPL

Query parameters

limitnumber

Maximum number of price records to return.

Default: 100
date_startstring

Filter results starting from this date (YYYY-MM-DD format).

Example: 2020-01-01
date_endstring

Filter results ending at this date (YYYY-MM-DD format).

Example: 2024-12-31
orderstring

Sort order for time-series data.

Default: DESCValues: ASCDESC
formatstring

Response format. Use json for JSON (default) or excel for tab-separated values compatible with Google Sheets and Excel.

Default: jsonValues: jsonexcel

Response

Response fields

datestring

The trading day the prices refer to, in YYYY-MM-DD format.

opennumber

Price of the first trade of the regular session, in the listing currency.

highnumber

Highest price traded during the session.

lownumber

Lowest price traded during the session.

closenumber

Price of the last trade of the regular session. Not adjusted for splits or dividends that happened afterwards.

adj_closenumber

Closing price retroactively adjusted for stock splits and dividends. Use this series for return calculations and long-horizon charts.

volumenumber

Total number of shares traded during the session, adjusted for later stock splits.

unadjusted_volumenumber

Number of shares traded during the session as originally reported, before any split adjustment.

changenumber

Absolute change of the closing price versus the previous trading day's close, in the listing currency. Negative on down days.

change_percentnumber

Percentage change of the closing price versus the previous trading day's close, e.g. -1.954 for a 1.954% decline.

vwapnumber

Volume-weighted average price of the session: total traded value divided by total volume. Commonly used as an execution benchmark.

labelstring

Preformatted, human-readable version of the trading date, e.g. December 20, 24. Use it for display only; parse date instead.

Use Cases

  • Stock price charts. Build candlestick or line charts using daily OHLCV data for any date range
  • Trading strategy backtests. Download years of historical prices to test buy/sell signals against real market data
  • Adjusted close analysis. Use the adj_close field for accurate long-term return calculations that account for stock splits and dividends
  • Spreadsheet imports. Use format=excel with Google Sheets IMPORTDATA() to pull price history directly into your financial models
  • Technical indicators. Compute moving averages, RSI, MACD, Bollinger Bands, and other indicators from daily OHLCV data
  • Event studies. Analyze price action around earnings calls, FDA approvals, product launches, or macroeconomic events
  • Volatility analysis. Calculate historical volatility, average true range, and other risk metrics from high/low/close data