> ## Documentation Index
> Fetch the complete documentation index at: https://docs.llmquantdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Equity Historical Prices

> Daily OHLCV bars for US equities — recent N or arbitrary date range, with adjusted close, dividends, and splits.

<Note icon="sparkles">
  **Available as MCP tool**: `equity_historical_prices` — call directly from Claude / Cursor / any MCP client. See [MCP Server](/en/integration/mcp-server) for the 60-second setup.
</Note>

<Badge color="green" icon="circle-check">Live</Badge>
 
<Badge color="gray" size="sm">free · daily bars</Badge>

## What it does for your agent

`equity_historical_prices` returns daily OHLCV bars for a single US equity (NYSE / NASDAQ), plus `adjusted_close`, `dividend`, and `stock_split` per bar. Use it as the **historical pricing primitive** an agent reaches for whenever it needs returns, drawdowns, or backtest data — not for the latest tick.

Two query modes share one endpoint: pass `limit` to get the most recent N closed days, or pass `start_date + end_date` for an exact window. Only **closed trading days** are returned — the in-progress day is never included.

## Response

<ResponseField name="data" type="EquityHistoricalResult" required>
  <Expandable title="EquityHistoricalResult fields">
    <ResponseField name="ticker" type="string" required>
      The stock ticker symbol (e.g. `AAPL`).
    </ResponseField>

    <ResponseField name="interval" type="string" required>
      Always `"1d"` — only daily bars are supported.
    </ResponseField>

    <ResponseField name="prices" type="EquityDailyBar[]" required>
      Daily bars in chronological order. Closed trading days only.

      <Expandable title="EquityDailyBar fields">
        <ResponseField name="open" type="number" required>Opening price.</ResponseField>
        <ResponseField name="high" type="number" required>High price.</ResponseField>
        <ResponseField name="low" type="number" required>Low price.</ResponseField>
        <ResponseField name="close" type="number" required>Closing price.</ResponseField>
        <ResponseField name="volume" type="number" required>Trading volume.</ResponseField>
        <ResponseField name="adjusted_close" type="number" required>Split- and dividend-adjusted close. Use this for return calculations.</ResponseField>
        <ResponseField name="dividend" type="number" required>Dividend amount paid on this date (`0` if none).</ResponseField>
        <ResponseField name="stock_split" type="number" required>Stock split ratio on this date (`0` if none).</ResponseField>
        <ResponseField name="time" type="string" required>Trading date (`YYYY-MM-DD`).</ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="meta.creditsUsed" type="number">Always `0` — this endpoint is free.</ResponseField>
<ResponseField name="meta.remainingCredits" type="number">Account credits remaining.</ResponseField>

```json title="200 OK · equity_historical_prices" expandable theme={null}
{
  "data": {
    "ticker": "AAPL",
    "interval": "1d",
    "prices": [
      {
        "open": 178.50,
        "high": 182.30,
        "low": 177.80,
        "close": 181.20,
        "volume": 52340000,
        "adjusted_close": 181.20,
        "dividend": 0.24,
        "stock_split": 0,
        "time": "2025-03-28"
      },
      {
        "open": 181.00,
        "high": 183.50,
        "low": 180.20,
        "close": 182.90,
        "volume": 48120000,
        "adjusted_close": 182.90,
        "dividend": 0,
        "stock_split": 0,
        "time": "2025-03-31"
      }
    ]
  },
  "meta": { "creditsUsed": 0, "remainingCredits": 99 }
}
```

## Notes

<Tip>
  For **return calculations**, always use `adjusted_close` — it bakes in dividends and splits. Plain `close` is only safe when you're rendering raw price charts.
</Tip>

<Tip>
  The first request for a ticker + range can be slower. Subsequent identical queries usually return faster.
</Tip>

<Tip>
  Use `data.prices.length` when you need the returned bar count; `meta` is reserved for credits and optional notices.
</Tip>

<Warning>
  **US equities only** (NYSE / NASDAQ). No ADRs of non-US listings, no international markets.
</Warning>

<Warning>
  **Daily interval only.** Minute-level (`1m`, `5m`, `15m`) bars are not exposed. For `1h` regular-session bars, use [`equity_intraday_prices`](/en/api/prices/equity-intraday).
</Warning>

<Warning>
  **No real-time quote.** The current trading day is excluded until market close. For latest price, this tool isn't the right primitive.
</Warning>

<Warning>
  Coverage is broad but not guaranteed. A handful of less-liquid tickers may occasionally return empty.
</Warning>

## Direct invocation

<Accordion title="HTTP / SDK examples" icon="terminal">
  <CodeGroup>
    ```typescript MCP (Claude / Cursor) theme={null}
    // Recent mode — last 30 trading days
    {
      "method": "tools/call",
      "params": {
        "name": "equity_historical_prices",
        "arguments": { "ticker": "AAPL", "limit": 30 }
      }
    }

    // Range mode — explicit window
    {
      "method": "tools/call",
      "params": {
        "name": "equity_historical_prices",
        "arguments": {
          "ticker": "MSFT",
          "start_date": "2025-04-01",
          "end_date": "2025-04-30"
        }
      }
    }
    ```

    ```python Python (HTTP) theme={null}
    import os, requests

    headers = {"Authorization": f"Bearer {os.environ['LLMQUANT_API_KEY']}"}

    # Recent mode
    resp = requests.get(
        "https://api.llmquantdata.com/api/equity/historical",
        headers=headers,
        params={"ticker": "AAPL", "limit": 30},
    ).json()
    for bar in resp["data"]["prices"]:
        print(f"{bar['time']}  C={bar['close']:.2f}  V={bar['volume']}")

    # Range mode
    resp = requests.get(
        "https://api.llmquantdata.com/api/equity/historical",
        headers=headers,
        params={
            "ticker": "MSFT",
            "start_date": "2025-04-01",
            "end_date": "2025-04-30",
        },
    ).json()
    print(f"Range mode returned {len(resp['data']['prices'])} bars")
    ```

    ```bash cURL theme={null}
    # Recent mode
    curl "https://api.llmquantdata.com/api/equity/historical?ticker=AAPL&limit=30" \
      -H "Authorization: Bearer $LLMQUANT_API_KEY"

    # Range mode
    curl "https://api.llmquantdata.com/api/equity/historical?ticker=MSFT&start_date=2025-04-01&end_date=2025-04-30" \
      -H "Authorization: Bearer $LLMQUANT_API_KEY"
    ```
  </CodeGroup>
</Accordion>

## Full parameter reference

<Accordion title="equity_historical_prices — request parameters" icon="sliders">
  <ParamField query="ticker" type="string" required>
    US equity ticker (e.g. `AAPL`, `MSFT`, `BRK.B`, `^GSPC` for S\&P 500 index).
  </ParamField>

  <Tabs>
    <Tab title="Recent mode">
      Pass `limit` only (or omit it for the default). Returns the most recent N closed trading days.

      <ParamField query="limit" type="integer" default={30}>
        Number of recent trading days. Default `30`. Max `200`.
      </ParamField>
    </Tab>

    <Tab title="Range mode">
      Pass `start_date` and `end_date` together. Returns all closed trading days in the inclusive range.

      <ParamField query="start_date" type="string" required>
        Start of date range in `YYYY-MM-DD` (e.g. `2025-04-01`). Must be paired with `end_date`.
      </ParamField>

      <ParamField query="end_date" type="string" required>
        End of date range in `YYYY-MM-DD`. Must be paired with `start_date`.
      </ParamField>

      <ParamField query="limit" type="integer">
        Optional safety cap on returned bars. Default `30`, max `200`. In Range mode `limit` is only a guard; the date window drives selection.
      </ParamField>

      <Warning>
        Passing only `start_date` or only `end_date` returns a `400` error.
      </Warning>
    </Tab>
  </Tabs>
</Accordion>

## Related

<Columns cols={2}>
  <Card title="Equity Intraday Prices" icon="clock" href="/en/api/prices/equity-intraday">
    `1h` regular-session bars for the same US equities — the short-lookback companion.
  </Card>

  <Card title="Crypto Historical Klines" icon="chart-line" href="/en/api/prices/crypto-historical">
    Same shape (Recent / Range modes) for crypto pairs at sub-daily intervals.
  </Card>

  <Card title="MCP Server setup" icon="plug" href="/en/integration/mcp-server">
    Connect Claude / Cursor / any harness in 60 seconds.
  </Card>
</Columns>
