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.
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)
- 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.
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)
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)