Get Stock Bars
get_stock_barsFetch historical OHLCV price bars for stocks with customizable timeframe, date range, and adjustment options, enabling price trend analysis and trading strategy backtesting.
Instructions
Retrieve historical price bars (OHLCV) for one or more stocks.
When start is omitted, it is automatically computed as now minus the days/hours/minutes lookback.
Args: symbols: Comma-separated tickers (e.g. "AAPL" or "AAPL,MSFT,GOOG"). timeframe: Bar aggregation period — "1Min", "5Min", "15Min", "30Min", "1Hour", "1Day", "1Week", or "1Month". start: Inclusive start time (RFC 3339). Omit to use relative lookback. end: Inclusive end time (RFC 3339). Omit for current time. days: Days to look back when start is omitted (default 5). hours: Additional hours in the lookback (default 0). minutes: Additional minutes in the lookback (default 0). limit: Max total data points returned across all symbols, 1–10000 (default 1000). adjustment: Price adjustment — "raw", "split", "dividend", "spin-off", or "all". Comma-separated combos allowed (e.g. "split,dividend"). Default "raw". feed: Data feed — "sip" (all US exchanges, default, paid), "iex" (IEX only, free tier), "otc", or "boats". currency: Price currency (ISO 4217, e.g. "USD"). Default USD. sort: Timestamp sort order — "asc" (default) or "desc". asof: As-of date (YYYY-MM-DD) for point-in-time symbol mapping. Useful for backtesting with historical ticker changes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | ||
| asof | No | ||
| days | No | ||
| feed | No | ||
| sort | No | asc | |
| hours | No | ||
| limit | No | ||
| start | No | ||
| minutes | No | ||
| symbols | Yes | ||
| currency | No | ||
| timeframe | No | 1Day | |
| adjustment | No | raw |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||