Unable to fetch historical data for some scripts

aswin1231
in reference to this https://kite.trade/forum/discussion/13777/unable-to-fetch-historical-data-for-some-scripts/p1
today is Tuesday and i am trying to get historical data of past 7 days using
const result = await kc.getHistoricalData(instrument.instrument_token, interval, fromDate, toDate, false, false);

I am getting same error for some instruments when i am trying to get historical data.
{
status: 'error',
message: 'invalid token',
data: null,
error_type: 'InputException'
}


one few are failing.

{
instrument_token: '136104452',
exchange_token: '531658',
tradingsymbol: 'ABATEAS',
name: 'ABATE AS INDUSTRIES',
last_price: 0n,
expiry: '',
strike: 0n,
tick_size: 0.01,
lot_size: 1n,
instrument_type: 'EQ',
segment: 'BSE',
exchange: 'BSE'
}

{
instrument_token: '138848516',
exchange_token: '542377',
tradingsymbol: 'AARSHYAM',
name: 'AAR SHYAM INDIA INVESTMENT COM',
last_price: 0n,
expiry: '',
strike: 0n,
tick_size: 0.01,
lot_size: 1n,
instrument_type: 'EQ',
segment: 'BSE',
exchange: 'BSE'
}

and so on
  • rakeshr
    instrument_token: '136104452',
    instrument_token: '138848516',
    Both of these instruments are not available in the today's instrument file. You need to get the current trading instruments from the instrument file.
  • aswin1231
    thank you @rakeshr

    So, i need to leave those in the future too or i need to get instruments daily and query accordingly?
  • rakeshr
    i need to get instruments daily and query accordingly?
    Yes, you can fetch the instrument list at the start of the day and filter out the trading instruments accordingly.
  • aswin1231
    thank you @rakeshr . I will do
This discussion has been closed.