Issue while extracting/generating FnO Quotes

maxhiten
Hi,

1.) Is it necessary to activate FnO segment to retrieve FnO quotes because I can easily access any of them in my watchlist and see all prices, volumes etc. Or
2.) I tried with all string formats but still Quotes api returning 0:
a) BANKNIFTYAPR46500CE
b) NSE:BANKNIFTYAPR46500CE
c) BANKNIFTY APR 46500 CE

Tagged:
  • tuxred
    I hope you are using the correct prefix ... e.g. it should be "NFO:BANKNIFTYAPR46500CE"
  • maxhiten
    I tried with NFO also but it was showing different error:

    Unexpected content type text/html StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:
    {
    Date: Tue, 17 Mar 2026 13:55:07 GMT
    Transfer-Encoding: chunked
    Connection: keep-alive
    CF-RAY: 9ddc7e528b3c3ebe-DEL
    Cache-Control: no-cache
    cf-cache-status: DYNAMIC
    Strict-Transport-Security: max-age=15552000; includeSubDomains
    Server: cloudflare
    Alt-Svc: h3=":443"
    Content-Type: text/html
    }
  • salim_chisty
    The correct trading should be "NFO: BANKNIFTY24APR46500CE". You can use the correct instrument token/tradingsymbol from the latest instrument file.
  • maxhiten
    I found that the Error is coming in very diff scenario:
    1.) All FnO instruments loaded correctly e.g. 5000.
    2.) Then I am requesting for quotes in the batch of 500 instruments each time.
    3.) Then out of multiple batches, it is passing only few 500 and showing that error for remaining 500s.
  • maxhiten
    @sujith Please help. I am not an expert like other developers. Try to understand.
  • salim_chisty
    Kindly verify that the correct parameters are being passed in the request and ensure that the quote rate limit (1 request per second) is not being exceeded.

    If the issue persists, enable debug mode and share the complete stack trace. Ensure that sensitive details such as the API key and access token are removed before sharing.
  • maxhiten
    maxhiten edited March 20
    Nothing wrong with parameters as similar parameters (string array of 500 instruments) are getting passed successfully sometimes. Below is the stack trace as per code:

    at KiteConnect.Kite.Request(String Route, String Method, Object Params, Dictionary`2 QueryParams, Boolean json)
    at KiteConnect.Kite.Get(String Route, Dictionary`2 Params, Dictionary`2 QueryParams)
    at KiteConnect.Kite.GetQuote(String[] InstrumentId)
    at KiteConnectSample.Trade.getquotes(Int32 from, Int32 to) in D:\Code\Program.cs:line 381
  • maxhiten
    maxhiten edited March 20


    If you look at above screenshot, it is giving values to string instruments but showing null because of that error for other similar instruments.
  • Nivas
    The quote endpoint is rate-limited (~1 request per second). If requests are made in quick succession or in parallel, this can lead to intermittent failures even with valid inputs.
    To help us investigate further, please enable debug logging and share:
    • Complete exception message
    • HTTP status code (if available)
    • Number of instruments in the failing request
    • Whether requests are being made sequentially or in parallel
    We also need the API endpoint being called, along with the parameters passed and the raw API response received for that request. These details will be available when debug logging is enabled and will help us identify the issue and assist accordingly. Please share the complete debug logs.
  • maxhiten
    First 4-5 requests are getting failed automatically one after another. Then few requests are getting passed one after another. So, I don't think it is related to rate limited. Below is the error message which I had shared earlier too:

    Unexpected content type text/html StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:
    {
    Date: Mon, 23 Mar 2026 07:54:14 GMT
    Transfer-Encoding: chunked
    Connection: keep-alive
    CF-RAY: 9e0bddefb8c1baa7-DEL
    Cache-Control: no-cache
    cf-cache-status: DYNAMIC
    Strict-Transport-Security: max-age=15552000; includeSubDomains
    Server: cloudflare
    Alt-Svc: h3=":443"
    Content-Type: text/html
    }

    Every time I am trying to pass 500 instruments to quote api as shown below:

    string[] stocks = result.Select(i => i.ToString()).ToArray(); //stocks contains string array of 500 instruments
    Dictionary quote1 = kite.GetQuote(InstrumentId: stocks);
  • Nivas
    Try the following:
    • Add a slight delay between API calls to avoid burst requests
    • Log and verify the exact number of instruments being sent in each request (based on debug logs)
    • Reduce the number of instruments per request (e.g., try with 100–200) and check if the issue persists
    If the issue still persists, please share the raw request details from the debug logs so we can investigate further.
Sign In or Register to comment.