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.
https://api.roic.ai/v2/stock-prices/{identifier}Parameters
Path Parameters
identifierstringrequiredCompany identifier — supports ticker symbol (e.g., `AAPL`), CIK, CUSIP, or ISIN.
AAPLQuery Parameters
apikeystringrequiredYour API key for authentication.
limitnumberoptionalMaximum number of price records to return.
100date_startstringoptionalFilter results starting from this date (YYYY-MM-DD format).
2020-01-01date_endstringoptionalFilter results ending at this date (YYYY-MM-DD format).
2024-12-31orderstringoptionalSort order for time-series data.
DESCValues: ASC, DESCformatstringoptionalResponse format. Use `json` for JSON (default) or `excel` for tab-separated values compatible with Google Sheets and Excel.
jsonValues: json, excelCode Examples
curl "https://api.roic.ai/v2/stock-prices/AAPL?apikey=YOUR_API_KEY"Response
[
{
"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_closefield for accurate long-term return calculations that account for stock splits and dividends - Spreadsheet imports. Use
format=excelwith Google SheetsIMPORTDATA()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
Related Endpoints
- Latest Stock Price - Get the most recent trading day's price without a date range
- Income Statement - Pair price data with fundamental financial results
- Valuation Multiples - Get P/E, P/S, EV/EBITDA, and other valuation ratios alongside price data