Skip to main content

Endpoint

GET https://api.llmquantdata.com/api/equity/historical

Authentication

Authorization: Bearer YOUR_API_KEY

Parameters

Required

ticker
string
required
The stock ticker symbol (e.g. AAPL, MSFT, GOOGL).

Optional

start_date
string
Start of date range (YYYY-MM-DD, e.g. 2025-04-01). Must be used together with end_date.
end_date
string
End of date range (YYYY-MM-DD). Must be used together with start_date.
limit
integer
Maximum number of bars to return. Default 30, max 200. When start_date/end_date are provided, limit acts as a safety cap only.

Query Modes

This endpoint supports two mutually exclusive query modes:
ModeParametersBehavior
Recentlimit only (or omit for default)Returns the most recent N closed trading days
Rangestart_date + end_dateReturns all closed trading days within the date range
Passing only start_date or only end_date returns a 400 error.

Response

data
object
meta
object

Credits

Each call consumes 1 credit, regardless of the number of bars returned.

Code Examples

import requests

headers = {"Authorization": "Bearer YOUR_API_KEY"}

# Get the last 30 daily bars for AAPL
response = requests.get(
    "https://api.llmquantdata.com/api/equity/historical",
    headers=headers,
    params={
        "ticker": "AAPL",
        "limit": 30,
    },
)

data = response.json()
for bar in data["data"]["prices"]:
    print(f"{bar['time']}  O={bar['open']}  H={bar['high']}  L={bar['low']}  C={bar['close']}  V={bar['volume']}")

Example Response

{
  "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": {
    "count": 2,
    "creditsUsed": 1,
    "remainingCredits": 99
  }
}

Notes

  • US equities only — NYSE and NASDAQ listed stocks.
  • Daily interval only — minute-level data is not available.
  • Closed trading days only — the current trading day is not included until market close.
  • No real-time quotes — use this endpoint for historical data, not latest prices.
  • First request latency — the first query for a given ticker + range may be slower as data is fetched from yfinance and cached. Subsequent queries for the same range return instantly.
  • Data source — powered by yfinance (unofficial); approximately 98% success rate.