Error while receiving LTP

vishwash_yadav
Calling kite.GetLTP(new string[] { "NSE:ICICIBANK" });

Getting KeyNotFound error.
Yesterday it was working.

Please help me on this.
  • tonystark
    Can you try initializing kite like:

    Kite kite = new Kite(MyAPIKey, Debug: true);

    Please post the logs here.
  • vishwash_yadav
    vishwash_yadav edited December 2017
    Getting this Output

    DEBUG: GET https://api.kite.trade/quote/ltp?i=NSE:HINDZINC&api_key={apikey}&access_token={access_token}

    Exception thrown: 'System.Collections.Generic.KeyNotFoundException' in mscorlib.dll
    DEBUG: 200 {"status":"success","data":{}}
  • vishwash_yadav
    Is there any Update.
    We are paying 2000/month and if that is not working in Business Hours(9:15-3:30), what is the benefits of investing 2000/month.
  • sujith
    Hi,
    We just tried it and it seems to be working fine.
    This is the following response
    {"status":"success","data":{"NSE:ICICIBANK":{"instrument_token":1270529,"last_price":309.55}}}

    {"status":"success","data":{"NSE:HINDZINC":{"instrument_token":364545,"last_price":298.5}}}

    Is this consistent or intermittent?

  • vishwash_yadav
    It's Intermittent, from 9:15-9:25 it didn't work. After 9:25 it's started working automatically.
  • sujith
    The way it works is if there is data it will return data but if data doesn't exist then the server returns empty JSON object.
    We will change the response to send JSON with the key of the request param and value will be empty.
    We will update .NET client soon which will return an empty dictionary and you can to do the check at your end before accessing the data.
  • vishwash_yadav
    That's ok, but i need response with data all the time as i am passing correct Stock symbol. If there is wrong parameter sent i should not get any data any time, but the case is for the StockSymbol sometimes i am getting error, sometimes not. Please fix it, at least it should work in first hour.
  • sujith
    We tried it yesterday. We didn't come across this issue. We will keep an eye on this. You can let us know if you come across a pattern to debug this scenario.
Sign In or Register to comment.