☰
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
14.1K
All Categories
0
Incidents
157
Node JS client
41
Go client
795
.Net API client
385
Kite Publisher
537
.Net / VBA / Excel (3rd party)
463
Algorithms and Strategies
1K
Java client
1.1K
API clients
407
PHP client
4.1K
Python client
349
Mobile and Desktop apps
1.4K
Market data (WebSockets)
3.4K
General
In this Discussion
September 2024
dearsatya
getHistoricalData: Always getting Error 'Invalid token' for every token including 256265
dearsatya
September 2024
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 2024
Resolved. I was passing JSON instead of simple parameters.
This discussion has been closed.