Why Kite Historical not given all token Data, While Zerodha acc. is showing that Trading Symbol Data

1krishnagupta
I'm fetching data of Some Trading Symbols, which I'm getting through the Instrument file, I'm Using Kite. historical Api for Fetching Data, I'm using a token. SO I'm getting some Trading Symbol Data But Some trading Symbol Data is not conveying. While Which trading Symbol Data I'm not getting that trading Symbol Data Chart is Showing on Zerodha Account.
So I'm fetching - NIFTY22NOVFUT Data which Instrument_toekn is - 13669122, this symbol data I'm not getting through Kite. historical. as well as some NIFTY November Option data is also not getting.
and some other Options and Future data are received.

So my question is Why this is Happening,
Kite Historical Api fetching some Instrument Data or Some Not.
  • rakeshr
    So I'm fetching - NIFTY22NOVFUT Data which Instrument_toekn is - 13669122, this symbol data I'm not getting through Kite. historical.
    I just checked historical data for same instrument token: 13669122, it's coming fine. Maybe you to re-check on correct from_date and to_date.
  • 1krishnagupta
    date = "02082022"    # Date format should be - DDMMYYYY 
    from_time = "09:16:00" # Time format should be - HH:MM:SS
    end_time = "15:30:00"
    from_date = f"{date} {from_time}"
    end_date = f"{date} {end_time}"
    from_date = datetime.strptime(from_date, '%d%m%Y %H:%M:%S')
    end_date = datetime.strptime(end_date, '%d%m%Y %H:%M:%S')

    historical_data = kite.historical_data(instrument_token=str(13669122),from_date=from_date, to_date=end_date,interval='minute', oi=True)
    token_df = pd.DataFrame(historical_data)
    display(token_df)
    This is my code, Still it is not fetching data for 13669122. While I'm using correct time, And This same code working for other tokens.

    In this code I'm fetching different token data and it is giving me data -
    date = "02082022"    # Date format should be - DDMMYYYY 
    from_time = "09:16:00" # Time format should be - HH:MM:SS
    end_time = "15:30:00"
    from_date = f"{date} {from_time}"
    end_date = f"{date} {end_time}"
    from_date = datetime.strptime(from_date, '%d%m%Y %H:%M:%S')
    end_date = datetime.strptime(end_date, '%d%m%Y %H:%M:%S')

    historical_data = kite.historical_data(instrument_token=str(15000066),from_date=from_date, to_date=end_date,interval='minute', oi=True)
    token_df = pd.DataFrame(historical_data)
    display(token_df)

    See here is output for different token data
  • 1krishnagupta
    @rakeshr Please check my code, what am i doing wrong?
  • rakeshr
    date = "02082022"
    This contract(NIFTY22NOVFUT) was not open on the date that you are requesting. NFO always only has 3 months contract open.
  • 1krishnagupta
    Thank You For your Correct information.
Sign In or Register to comment.