Financial Data API

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}

Parameters

Path Parameters

identifierstringrequired

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

Example: AAPL

Query Parameters

apikeystringrequired

Your API key for authentication.

limitnumberoptional

Maximum number of price records to return.

Default: 100
date_startstringoptional

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

Example: 2020-01-01
date_endstringoptional

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

Example: 2024-12-31
orderstringoptional

Sort order for time-series data.

Default: DESCValues: ASC, DESC
formatstringoptional

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

Default: jsonValues: json, excel

Code Examples

curl "https://api.roic.ai/v2/stock-prices/AAPL?apikey=YOUR_API_KEY"

Response

Response200 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"
  }
]

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