get_price_history
Fetch historical OHLCV price bars for trend analysis, covering pre-market, regular, and after-hours sessions, with previous close and total gain/loss.
Instructions
Get historical OHLCV price bars for a symbol over a time period.
Returns open/high/low/close/volume bars split into pre-market, regular, and after-hours sessions, plus previous close and total gain/loss. Use this for trend analysis and historical prices — get_quotes returns the current price only, and get_history is account activity, not prices.
Args:
symbol: Ticker symbol (e.g. "AAPL").
period: Time window to retrieve (e.g. "YEAR", "TEN_YEARS", "ALL").
instrument_type: EQUITY, CRYPTO, OPTION, or INDEX. Default EQUITY.
aggregation: Optional bar size. Prefer omitting it — the server then
picks an appropriate size for the period. Only a subset of sizes
is valid per period (finer/coarser sizes are rejected); if you set
an invalid one, the error lists the valid options.
purchase_date: Required only when period is "SINCE_PURCHASE".
Format "YYYY-MM-DD".
trading_session_toggle: Which sessions to include on the DAY equity
chart. Omit for the default (REGULAR_AND_EXTENDED_HOURS,
04:00–20:00 ET). REGULAR_HOURS limits to 09:30–16:00. ALL_SESSIONS
returns a full midnight-to-midnight chart including the overnight
ATS sessions, adding preMarketOvernight (00:00–04:00) and
postMarketOvernight (20:00–24:00) to the response.
ipo_date: Optional IPO / first-trade date of the asset. Format
"YYYY-MM-DD". When the asset is younger than the requested period,
the server fetches a finer aggregation over the available post-IPO
history (so the chart isn't a straight diagonal) and adds a
leadingFill object to the response describing the flat lead-in
to draw for the pre-IPO portion (startTimestamp, endTimestamp,
value, count, includedInTotalExpectedBars). Omit for unchanged
behavior. Ignored for the DAY chart; leadingFill is also never
emitted for the ALL / SINCE_PURCHASE periods.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| period | Yes | ||
| symbol | Yes | ||
| ipo_date | No | ||
| aggregation | No | ||
| purchase_date | No | ||
| instrument_type | No | EQUITY | |
| trading_session_toggle | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |