getQuote(instruments) - upper limit on number of instruments

vijayonkite
is there any upper limit on number of instruments I can pass to this api ?
Tagged:
  • salim_chisty
    There are defined limits on the number of instruments you can pass to the REST quote endpoints:
    - Full market quotes (/quote): Supports up to 500 instruments per request.
    - OHLC quotes (/quote/ohlc): Supports up to 1000 instruments per request.
    - LTP quotes (/quote/ltp): Supports up to 1000 instruments per request.

    For live ticks, you should use WebSocket market quotes. You can subscribe to up to 3000 instruments on a single WebSocket connection and receive live quotes. A single API key allows up to 3 WebSocket connections.

    Please refer to the API documentation here for more details.
  • vijayonkite
    Thanks for your response. Any idea why below exception would be thrown.


    java.lang.IllegalStateException: closed
    at okio.RealBufferedSource.select(RealBufferedSource.kt:220)
    at okhttp3.internal.Util.readBomAsCharset(Util.kt:256)
    at okhttp3.ResponseBody.string(ResponseBody.kt:187)
    at com.zerodhatech.kiteconnect.kitehttp.KiteResponseHandler.handle(KiteResponseHandler.java:24)
    at com.zerodhatech.kiteconnect.kitehttp.KiteRequestHandler.getRequest(KiteRequestHandler.java:152)
    at com.zerodhatech.kiteconnect.KiteConnect.getQuote(KiteConnect.java:726)
  • Nivas
    This could be because of the non-JSON response from the server, like when a Cloudflare error is thrown.
    You can catch the exception and retry.

    You may add delays between API calls to respect rate limits (Kite's quote API allows 1 request/second)
  • vijayonkite
    Thank you. I was passing more than 500 instruments to the getQuote API, after I reduced to less than 500, this exception disappeared.
Sign In or Register to comment.