Getting "NetworkException Too many requests" when making calls for equity minute data

mb12
hi, is there a daily limit for making historical data api calls? Like in our case we are maintaining the per second rate limit within our code, but after few historical api calls when we make a call for equity minute data e.g. for AARTIIND, we get this error "NetworkException Too many requests" and it keeps repeating for all equity instruments. The same does not happen for day equity data or minute/day options / futures data. It happens only for equity minute data.
Is there a daily api call limit? And if so, what is it exactly and is it only for equity minute data?
  • sujith
    There is no restriction on fetching data per day. There is only 3 requests per second limit on historical data API. Can you enable debug logs for pykiteconnect and share the complete stacktrace here?

    PS: Make sure to remove app and client specific tokens from the logs.
  • sujith
    Can you private message the api_key? We will verify and get back to you.
  • sujith
    We didn't find any logs with 429 http status code. Can you run in debug mode and share the complete stacktrace on private message? Make sure to include IP address as well.
  • mb12
    Thanks for asking about debug logs :) having seen the debug logs i could figure out that our rate limit was not at the level of kiteconnect.historical_data() calls but at the encompassing function for fetching data, so if we try to fetch minute data for a really long duration say from 1995, it would make multiple calls to historical_data() within the function based on how much can be fetched per call, and this in turn violated the rate limit for zerodha :) Just fixed it to apply rate limits at kiteconect.historical_data() calls by having a wrapper rate limited function :)
  • mb12
    you could mark this defect as closed. thanks & sorry for the trouble.
This discussion has been closed.