v1

latestOpenAPI 3.1.02026-07-2655154175.6 KB
History

OHLCV price bars for a symbol and resolution

TradingView UDF history bars for one symbol at one resolution, covering [from, to) (Unix seconds; to is exclusive). Returns column arrays (t, o, h, l, c, v) of equal length, oldest-first. When the window holds no bars the response is a 200 with { "s": "no_data" } (plus nextTime pointing at the nearest earlier bar when one exists), per the UDF contract. Equity bars also carry sided-volume columns (bv/sv/uv = buy / sell / unclassified) where available.

Cache-Control tracks data freshness: today max-age=2, the prior session max-age=60, older complete days immutable.

get/v1/history

Query parameters

symbolstring required
Example:SPY

Ticker (e.g. SPY).

resolution'1' | '2' | '3' | '5' | '15' | '30' | '60' | '240' | '480' | 'D' | 'W' required
Example:D

Bar size. Intraday minutes or D/W.

frominteger required
Example:1748131200

Window start, Unix seconds (UTC).

tointeger required
Example:1748736000

Window end, Unix seconds (UTC).

countbackinteger

When set, return exactly this many bars ending at to (takes precedence over from, per the UDF spec).

extendedboolean

Include extended-hours (pre / post-market) bars. Default is regular trading hours only (09:30–16:00 ET).

Response

Bars, or a no_data marker — both 200 per UDF.

OR