Historical Bars
Retrieves historical OHLCV (Open, High, Low, Close, Volume) price bars for a specified symbol across various timeframes. Returns time-series candlestick data essential for technical analysis, backtesting, and chart visualization.
Use Case: Build price charts, analyze historical trends, and perform technical analysis on stocks and securities with customizable time intervals.
Documentation Index
Fetch the complete documentation index at: https://finance.dev/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
OAuth2 Bearer token: obtain an access token from the token endpoint and send it in the Authorization header.
Query Parameters
Symbol to fetch bars for. Use the exact symbol returned by symbol search, such as AAPL for equities or the selected chart symbol for futures/options.
Candle size. Use minute values such as 1, 5, or 60 for intraday charts, D or 1D for daily charts, W or 1W for weekly charts, and M, 1M, 3M, 6M, or 12M for monthly views.
1, 3, 5, 15, 30, 45, 60, 120, 180, 240, D, W, M, 1D, 1W, 1M, 3M, 6M, 12M Start of the chart window as a Unix timestamp. Send seconds; millisecond timestamps are accepted and converted automatically.
x >= 1End of the chart window as a Unix timestamp. Must be greater than from. Send seconds; millisecond timestamps are accepted and converted automatically.
x >= 1TradingView compatibility flag. Omit or send a non-zero value for the first chart request; send 0 for follow-up history requests.
Set to true when the chart should include eligible pre-market and after-hours bars. Leave false for regular session charts.
Response
Historical bars in TradingView UDF format. Always returns 200; check s (status): ok = data in t, o, h, l, c, v; no_data = no bars; error = errmsg contains reason (e.g. invalid resolution or time range).
Historical chart data returned as parallel arrays. Values at the same index belong to the same bar, so t[0], o[0], h[0], l[0], c[0], and v[0] describe one candle.
Response status. ok means chart arrays are usable; no_data means the symbol or range returned no bars; error means read errmsg.
ok, no_data, error Close price for each bar. Use the value at the same index as t for chart candles and performance calculations.
Human-readable error message. Present only when s is error or no_data; show it when no chart can be rendered.
Highest traded price during each bar interval. Use it for candle wicks and intraperiod range.
Lowest traded price during each bar interval. Use it for candle wicks and intraperiod range.
Next available bar timestamp when the requested range has more data. Use it for pagination or loading older chart data.
Open price for each bar interval. Use the value at the same index as t for candle bodies.
Bar timestamps in Unix seconds. Each timestamp index lines up with open, high, low, close, and volume arrays.
Trading volume for each bar interval. Use the value at the same index as t for volume charts.