API Call Limit - Any change recently?

sabyasm
sabyasm edited February 2019 in General
Since last week or so, has there been any change in the number of API calls we can make per minute?
My application didn't have any change at all - however, it seems there is now a limit on how many orders we can make per min or (~100/minuite). I don't think any change has been made on orders/sec etc ...

I could see 100 orders go through within 30 seconds and then "too many requests" start popping.

@sujith @tonystark
  • sujith
    Are you placing order only or fetching orderbook also with that or are you making any other call?
  • sabyasm
    sabyasm edited February 2019
    @sujith - thanks!

    Single request - updating SL for open orders. 2 parallel thread to update a list of 'n' orders. The threads waits till there is an API response (so I don't consciously try to push x number of orders per seconds). Usually this api call/response could process 5-6 orders per second.

    Other than this - sometime there is 1 websocket runs in background in a separate process.

    The same piece of code worked fine for more than 5-6 months without any "too many request" error.

    This makes me wonder - if there has been something new implemented at the API rate limit front?
    2019-01-31 10:24:33.454 - INFO - sl_adjustment - update_sl: 190131000893955 has been modified successfully.
    2019-01-31 10:24:33.468 - INFO - sl_adjustment - update_sl: 190131000888027 has been modified successfully.
    2019-01-31 10:24:33.656 - INFO - sl_adjustment - update_sl: 190131000897226 has been modified successfully.
    2019-01-31 10:24:33.812 - INFO - sl_adjustment - update_sl: 190131000885356 has been modified successfully.
    2019-01-31 10:24:33.938 - INFO - sl_adjustment - update_sl: 190131000888813 has been modified successfully.
    2019-01-31 10:24:33.940 - INFO - sl_adjustment - update_sl: 190131000894131 has been modified successfully.
    2019-01-31 10:24:34.167 - INFO - sl_adjustment - update_sl: 190131000897404 has been modified successfully.
    2019-01-31 10:24:34.300 - INFO - sl_adjustment - update_sl: 190131000885555 has been modified successfully.
    2019-01-31 10:24:34.396 - INFO - sl_adjustment - update_sl: 190131000894285 has been modified successfully.
    2019-01-31 10:24:34.403 - INFO - sl_adjustment - update_sl: 190131000889018 has been modified successfully.
    2019-01-31 10:24:34.623 - INFO - sl_adjustment - update_sl: 190131000897571 has been modified successfully.
    2019-01-31 10:24:34.765 - INFO - sl_adjustment - update_sl: 190131000885734 has been modified successfully.
    2019-01-31 10:24:34.881 - INFO - sl_adjustment - update_sl: 190131000889221 has been modified successfully.
    2019-01-31 10:24:35.092 - INFO - sl_adjustment - update_sl: 190131000897729 has been modified successfully.

    2019-01-31 10:24:38.227 - ERROR - sl_adjustment - update_sl: 190131000885889 failed to modify. Error message: Too many requests
    2019-01-31 10:24:38.337 - ERROR - sl_adjustment - update_sl: 190131000889374 failed to modify. Error message: Too many requests
    2019-01-31 10:24:38.550 - INFO - sl_adjustment - update_sl: 190131000886064 has been modified successfully.
    2019-01-31 10:24:38.555 - ERROR - sl_adjustment - update_sl: 190131000897895 failed to modify. Error message: Too many requests
    2019-01-31 10:24:38.700 - ERROR - sl_adjustment - update_sl: 190131000894443 failed to modify. Error message: Too many requests
    2019-01-31 10:24:41.647 - ERROR - sl_adjustment - update_sl: 190131000892357 failed to modify. Error message: Too many requests
    2019-01-31 10:24:42.011 - ERROR - sl_adjustment - update_sl: 190131000894624 failed to modify. Error message: Too many requests
    2019-01-31 10:24:42.041 - ERROR - sl_adjustment - update_sl: 190131000886227 failed to modify. Error message: Too many requests
    2019-01-31 10:24:42.342 - INFO - sl_adjustment - update_sl: 190131000894770 has been modified successfully.
    2019-01-31 10:24:42.348 - INFO - sl_adjustment - update_sl: 190131000886408 has been modified successfully.
    2019-01-31 10:24:45.718 - ERROR - sl_adjustment - update_sl: 190131000892523 failed to modify. Error message: Too many requests
    2019-01-31 10:24:45.789 - ERROR - sl_adjustment - update_sl: 190131000886619 failed to modify. Error message: Too many requests
    2019-01-31 10:24:45.836 - ERROR - sl_adjustment - update_sl: 190131000894947 failed to modify. Error message: Too many requests
    2019-01-31 10:24:46.024 - INFO - sl_adjustment - update_sl: 190131000892719 has been modified successfully.
    2019-01-31 10:24:46.119 - INFO - sl_adjustment - update_sl: 190131000886804 has been modified successfully.
  • sujith
    Can you private message the api_key? We will check and get back to you.
  • sabyasm
    @sujith Any luck on this? PMed you the details couple of days back.
  • Vivek
    Vivek edited February 2019
    @sabyasm I have looked in to your requests and it seems like your are consistently sending more than 200 write requests per minute (mostly PUT request) hence you are getting rate limited.
  • sabyasm
    @Vivek - thanks for looking!

    200 request per min roughly translates to 3request/sec. Whereas the limit mentioned earlier was

    Quote API - 1r/s
    Order place API - 5r/s
    Historical API - 3r/s
    All other endpoints - 10r/s

    https://kite.trade/forum/discussion/2760/no-of-request-to-api#latest

    As I mentioned, I haven't made any change in my code since last 4 months. If I understand you correctly, I should be able to place ~300 write request/min and ~600 other requests (like update SL or close orders) per min - which I could do till couple of weeks back without any issue.

    Has anything changed?
  • Vivek
    @sabyasm Yeah rate limits have been slightly tweaked recently. Instead of having per second based rate limit we switched to per minute for write calls (POST, PUT and DELETE). Get calls still have the same per second rate limits. We will increase the write rate limits to 300 per minute for now but soon we will publish a revised rate limits for all calls.
  • sabyasm
    sabyasm edited February 2019
    @Vivek Thanks for the reply.

    While I appreciate all your help and try to be a civil user by sticking under the prescribed rate limit, it infuriates me to spend countless hours to debug the application and be in the receiving end to know that the change was made without any formal notification.

    I am an early adopter for kite platform and and it supported your development effort wholeheartedly. If the rate limit needs to be set to something ridiculous like 1 order/minute I will still be fine (bit disappointed maybe) . But being a paid user for your product, I should expect to be notified with some time to make the necessary change not not after 2 weeks of forum follow-up.

    I hope you understand.
  • Vivek
    @sabyasm We regret the situation we got here, will make sure such changes will be informed before its made.
Sign In or Register to comment.