Skip to main content
GET
https://stocks-dev.up.railway.app
/
api
/
v1
/
stock
/
{symbol}
/
history
Stock Price History
curl --request GET \
  --url https://stocks-dev.up.railway.app/api/v1/stock/{symbol}/history
{
  "symbol": "<string>",
  "historical": [
    {
      "date": "<string>",
      "open": 123,
      "high": 123,
      "low": 123,
      "close": 123,
      "adjClose": 123,
      "volume": 123,
      "unadjustedVolume": 123,
      "change": 123,
      "changePercent": 123,
      "vwap": 123
    }
  ],
  "outputsize": "<string>",
  "source": "<string>",
  "timestamp": "<string>"
}

Overview

Retrieve comprehensive historical stock price data including open, high, low, close prices, and trading volume. This endpoint provides daily time series data essential for technical analysis, backtesting strategies, and understanding price trends.
Historical price data is fundamental for technical analysis, pattern recognition, and quantitative trading strategies. The data includes adjusted prices for dividends and stock splits.

Parameters

symbol
string
required
Stock ticker symbol (e.g., AAPL, MSFT, GOOGL, TSLA)
outputsize
string
default:"compact"
Data range: “compact” (latest 100 data points) or “full” (up to 20 years)
from
string
Start date in YYYY-MM-DD format (optional, for custom date range)
to
string
End date in YYYY-MM-DD format (optional, for custom date range)

Response

symbol
string
The stock ticker symbol
historical
array
Array of historical price data (most recent first)
outputsize
string
Data range returned
source
string
Data source identifier (“YFinance” or “FMP”)
timestamp
string
ISO timestamp of the response

Examples

curl "https://stocks-dev.up.railway.app/api/v1/stock/AAPL/history?outputsize=compact"

Response Example

{
  "symbol": "AAPL",
  "historical": [
    {
      "date": "2025-06-28",
      "open": 199.50,
      "high": 202.15,
      "low": 198.80,
      "close": 201.08,
      "adjClose": 201.08,
      "volume": 52147890,
      "unadjustedVolume": 52147890,
      "change": 1.58,
      "changePercent": 0.79,
      "vwap": 200.45
    },
    {
      "date": "2025-06-27",
      "open": 201.20,
      "high": 203.45,
      "low": 199.10,
      "close": 199.50,
      "adjClose": 199.50,
      "volume": 48235671,
      "unadjustedVolume": 48235671,
      "change": -1.70,
      "changePercent": -0.85,
      "vwap": 201.12
    },
    {
      "date": "2025-06-26",
      "open": 198.75,
      "high": 201.90,
      "low": 198.25,
      "close": 201.20,
      "adjClose": 201.20,
      "volume": 55892134,
      "unadjustedVolume": 55892134,
      "change": 2.45,
      "changePercent": 1.23,
      "vwap": 200.15
    }
  ],
  "outputsize": "compact",
  "source": "YFinance",
  "timestamp": "2025-06-28T21:00:15.123456"
}

Understanding Historical Data

OHLC Data Explained:
  • Open: First traded price of the day
  • High: Highest price during trading session
  • Low: Lowest price during trading session
  • Close: Last traded price of the day
  • Adjusted Close: Price adjusted for dividends and stock splits
Volume Metrics:
  • Volume: Number of shares traded
  • VWAP: Volume Weighted Average Price
  • Volume Patterns: High volume often confirms price movements
  • Relative Volume: Compare to average daily volume
Corporate Actions:
  • Stock Splits: Prices adjusted to maintain continuity
  • Dividends: Ex-dividend adjustments in historical prices
  • Spin-offs: Complex adjustments for corporate restructuring
  • Rights Issues: Adjustments for new share issuances

Use Cases

Technical Analysis

Chart Patterns
  • Support/resistance levels
  • Moving averages
  • Trend analysis
  • Pattern recognition

Backtesting

Strategy Testing
  • Historical performance
  • Risk metrics calculation
  • Strategy optimization
  • Performance attribution

Risk Management

Volatility Analysis
  • Historical volatility
  • Value at Risk (VaR)
  • Drawdown analysis
  • Correlation studies

Quantitative Analysis

Statistical Models
  • Return distributions
  • Momentum indicators
  • Mean reversion tests
  • Factor analysis

Technical Indicators

Common Calculations:
  • Simple Moving Average: Average price over N periods
  • Volatility: Standard deviation of returns
  • RSI: Relative Strength Index for momentum
  • Bollinger Bands: Price bands based on standard deviation
Analysis Tips:
  • Use adjusted prices for accurate calculations
  • Consider volume confirmation for price moves
  • Look for patterns in volume and price together
  • Account for market holidays and gaps
Data Considerations:
  • Historical data may have survivorship bias
  • Corporate actions can affect calculations
  • Market hours and timezone considerations
  • Data quality varies by source and symbol

Error Responses

{
  "error": "404: Failed to fetch historical data for INVALID"
}
{
  "error": "Invalid date range",
  "detail": "Start date must be before end date"
}
{
  "error": "No historical data available",
  "detail": "No trading data found for the specified period"
}

MCP Protocol Usage

For AI agents using the Model Context Protocol:
{
  "method": "tools/call",
  "params": {
    "name": "get_time_series_daily",
    "arguments": {
      "symbol": "AAPL",
      "outputsize": "compact"
    }
  }
}