No results for ""
Historical Data
All TD.Historical calls go inside TD.onStart (or an async function called from it) and must be awaited. These are REST calls — call once, never loop or poll (Rule 17).
records[0] is always the header row in every response below. Data rows start at records[1].1. getBars — Bars for a time range
const data = await TD.Historical.getBars({
symbol: "RELIANCE",
from: "2026-06-19 11:58:00",
to: "2026-06-19 12:00:00",
interval: "1min",
});
Always check data.status === "Success" before using records. Error statuses include "error fetching data", "Invalid interval", and "Symbol does not exist" — each still returns the header row only.
{
"status": "Success",
"records": [
["Timestamp","Open","High","Low","Close","Volume","OpenInterest"],
["2026-06-19T11:58:00", 1327.7, 1327.7, 1327.3, 1327.3, 4646, 0],
["2026-06-19T11:59:00", 1327.3, 1327.6, 1327.3, 1327.5, 7502, 0]
]
}
2. getLastNBars — Last N bars
const data = await TD.Historical.getLastNBars({
symbol: "RELIANCE",
nbars: 20,
interval: "1min",
});
If nbars: 0, only the last single bar is returned. Response and error shapes are the same as getBars.
3. getLastNTicks — Last N ticks
const data = await TD.Historical.getLastNTicks({
symbol: "RELIANCE",
nticks: 20,
bidask: true, // false to exclude bid/ask columns
});
{
"status": "Success",
"records": [
["Timestamp","LTP","TickVolume","OpenInterest","Bid","BidQty","Ask","AskQty"],
["2026-06-19T12:13:56", 1326.1, 1413, 0, 1325.9, 93, 1326.1, 69]
]
}
{
"status": "Success",
"records": [
["Timestamp","LTP","TickVolume","OpenInterest"],
["2026-06-19T12:15:25", 1326.2, 16, 0]
]
}
4. getTicks — Ticks for a time range
Same as getLastNTicks but with from / to instead of nticks.
const data = await TD.Historical.getTicks({
symbol: "RELIANCE",
from: "2026-06-19 09:15:00",
to: "2026-06-19 09:16:00",
bidask: true,
});
5. getTopNGainers / getTopNLosers
"NSEEQ" (NSE) or "BSEEQ" (BSE). Do NOT use "EQ" — that's reserved for Analytics calls (Rule 14).const gainers = await TD.Historical.getTopNGainers({
segment: "NSEEQ",
topn: 5,
});
const losers = await TD.Historical.getTopNLosers({
segment: "NSEEQ",
topn: 5,
});
{
"status": "Success",
"records": [
["Symbol","SymbolID","Timestamp","Open","High","Low","Close","Volume",
"Turnover","PrevClose","Change","ChangePer","Series","Exchange"],
["INFY", 100000717, "2026-06-19T00:00:00", 1062.3, 1066, 1030, 1042.2,
26840317, 673013760, 1127.5, -85.3, -7.57, "EQ", "NSE"]
]
}
6. getTopNVolumeGainers
"NSEEQ" segment is available for this call.const data = await TD.Historical.getTopNVolumeGainers({
segment: "NSEEQ",
topn: 5,
});
// Response and error shapes are the same as getTopNGainers
Empowering traders and analysts with high-performance real-time market data directly within their spreadsheets.
Resources
Support
© 2026 TrueData Market Data Services LLP. All rights reserved.