☰
Login
Signup
Home
›
Node JS client
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Register
Categories
Recent Discussions
Activity
Categories
13.8K
All Categories
0
Incidents
154
Node JS client
40
Go client
793
.Net API client
378
Kite Publisher
537
.Net / VBA / Excel (3rd party)
457
Algorithms and Strategies
993
Java client
1.1K
API clients
404
PHP client
4K
Python client
346
Mobile and Desktop apps
1.4K
Market data (WebSockets)
3.3K
General
In this Discussion
September 20
dearsatya
getHistoricalData: Always getting Error 'Invalid token' for every token including 256265
dearsatya
September 20
in
Node JS client
const { KiteConnect } = require("kiteconnect");
const fs = require("fs");
const kc = new KiteConnect({
api_key: 'xyz',
});
kc.setAccessToken('RXLPoCPLly0Qle3wbKx1g7YT0uygwItz');
async function fetchHistoricalData() {
try {
const data = await kc.getHistoricalData({
instrument_token: '256265',
interval: 'minute',
from_date: "2024-09-18 09:15:00",
to_date: "2024-09-19 15:30:00",
continuous: false,
oi: false,
});
// const instr = await kc.getInstruments('NSE');
console.log("Historical Data: ", data);
} catch (error) {
console.error("Error fetching historical data: ", error);
}
}
Output:
Error fetching historical data: {
status: 'error',
message: 'invalid token',
data: null,
error_type: 'InputException'
}
Tagged:
node.js
getHistoricalData
invalid token
dearsatya
September 20
Resolved. I was passing JSON instead of simple parameters.
This discussion has been closed.