"Per Hour Rate Limit Exceeded For Non Trading API

I have placed a buy order for apolloshop at “time”: “2023-10-17 09:15:08.895845”
and got the orderid = 112310172406

Then before placing a sell order every few seconds i am trying to check the orderstatus using

df_orders_from_dhan = dhan.get_order_by_id(orderid)

i am getting this error:

“status”: “failure”,
“remarks”: {
“error_code”: “HTTP429”,
“message”: “Per Hour Rate Limit Exceeded For Non Trading API”
“data”: “”

Please help how to go about and prevent this error.
Before placing a sell order i am trying to make sure buy orderstatus is traded
and then place sell order. Please help.

I have also referred to this link:

where u have specified to check the rate limits.

Ideally before placing the sell order we would like to make sure the buy order is executed/traded. For this we would ideally like to poll and get the status. Is there any alternative for this. Please help.

according to the error “message”: “Per Hour Rate Limit Exceeded For Non Trading API”,

you are making too many requests per hour. you can limit this by adding time.sleep() between requests according to rate limits.

But ideally we would like to check the status of the order every second for our target and place a sell order immediately as the price can go down or otherwise . How do you suggest we handle this. Please help.

if you are checking every second, you are making 3600 calls per hour.
The actual rate limit by dhan is 1000 (Non trading apis)
So as I see there is no other option, you can add 4 sec sleep time before making next call. this will result in 900 calls per hour.

1 Like

@saisaigraph Yes, the approach and analysis by @kedar is correct here.

Also, assuming you have multiple orders pending, you cannot check for each order every second to get the update. That would be an unwanted exploitation, hence the rate limits.

We are going to introduce an alternate to this very soon, which will solve for this. For now, you can keep a buffer between each subsequent API poll.

1 Like

In the 4 secs gap you are proposing if the target is reached in the first second and changed immediately to below target in the next second then we are at a loss right. Any suggestions please.

Desperately waiting for this solution. By when you are expecting this to be released.
Any additional suggestions in the meantime would be of great help.


We are planning to ship this at the end of the month itself. Will keep you informed.

1 Like

Thanks Hardik. Any other alternatives in the meantime please post. EOM is still a couple of weeks away.

Just a follow up to see if this is done Hardik.

When can we expect this feature to be shipped. For me as well, this feature is much needed.

Hello @saisaigraph @kbkalyani56,

This has been released on beta. You can check it out here: Postback - DhanHQ Ver 1.0 / API Document.

Do let us know your feedback.

@Hardik Is there any guide on how to use thisfeature using the python module?

1 Like

I am also interested in this please.