Too many requests. Further requests may result in the user being blocked

Error: 429 - {“data”:{“805”:“Too many requests. Further requests may result in the user being blocked.”},“status”:“failed”} @Hardik i have paid you guys and this happen after making code just testing for the code 5 to 6 times

import requests
import json
import pandas as pd

API endpoint

Replace with your credentials

headers = {
“access-token”: “YOUR_ACCESS_TOKEN”, # Access token generated via Dhan
“client-id”: “YOUR_CLIENT_ID”, # Your client-id from Dhan
“Content-Type”: “application/json”
}

Request payload

payload = {
“UnderlyingScrip”: 3499, # Example: NIFTY ID (replace with required security ID)
“UnderlyingSeg”: “IDX_I”, # Use NSE_EQ for stocks, IDX_I for index options
“Expiry”: “2025-08-28” # Expiry date in YYYY-MM-DD format
}

Send POST request

response = requests.post(url, headers=headers, data=json.dumps(payload))

Check response

if response.status_code == 200:
result = response.json()
option_chain = result[“data”][“oc”]

# Flatten into list of rows
rows = []
for strike, contracts in option_chain.items():
    for option_type in ["ce", "pe"]:
        if option_type in contracts:
            d = contracts[option_type]
            row = {
                "strike": float(strike),
                "type": option_type.upper(),
                "last_price": d.get("last_price"),
                "oi": d.get("oi"),
                "volume": d.get("volume"),
                "iv": d.get("implied_volatility"),
                "delta": d.get("greeks", {}).get("delta"),
                "theta": d.get("greeks", {}).get("theta"),
                "gamma": d.get("greeks", {}).get("gamma"),
                "vega": d.get("greeks", {}).get("vega"),
                "bid_price": d.get("top_bid_price"),
                "bid_qty": d.get("top_bid_quantity"),
                "ask_price": d.get("top_ask_price"),
                "ask_qty": d.get("top_ask_quantity"),
            }
            rows.append(row)

# Convert to DataFrame
df = pd.DataFrame(rows)
display(df)  # Show DataFrame nicely in Google Colab

else:
print(f"Error: {response.status_code} - {response.text}")

@Hardik sir please reply

@Hardik sir

@Tradehull_Imran sir Error: 429 - {“data”:{“805”:“Too many requests. Further requests may result in the user being blocked.”},“status”:“failed”}

Having the same issue…

Got api activated 2 days back and this…
What is the api limit please be specific before accepting any money.

Also I am well aware that my code did not violate any term…

Hello @Bishnoi

The rate limits are mentioned here: Rate Limit. Looks like you are polling Option Chain API, which can be polled only once in 3 seconds.

This is because Option Chain data doesn’t change every second (given OI which is updated by exchange at larger intervals). If you want to fetch other data like LTP or depth for the option strikes, the best way would be to use Market Quote APIs.

Hello @Hardik

From what I understand, the Option Chain API is limited to one call every three seconds. That makes sense given that components like open interest are updated less frequently by the exchange. If I only need LTP or market depth for specific option strikes, I agree that the Market Quote APIs are the better fit.

One clarification I’m still unsure about: does the “one call per three seconds” limit apply per API key across the entire Option Chain endpoint, or per symbol/instrument?

My use case is to check option chains for 15 different symbols. Can you confirm whether:

  1. These can be queried sequentially (one after another) under the same three-second global throttle for the Option Chain endpoint, or
  2. The three-second restriction is enforced per symbol, allowing multiple different symbols to be queried within the same three-second window?
1 Like

ab is chiz ko kese solve kare sir @Hardik hm chate h ki hamra order hmare price pe hi execute ho naki ltp pe these are the order details [
{
“dhanClientId”: “######”,
“orderId”: “432508285067971”,
“exchangeOrderId”: “2700000023817728”,
“correlationId”: “order_041016”,
“orderStatus”: “TRADED”,
“transactionType”: “BUY”,
“exchangeSegment”: “NSE_FNO”,
“productType”: “INTRADAY”,
“orderType”: “LIMIT”,
“validity”: “DAY”,
“tradingSymbol”: “ICICIBANK”,
“securityId”: “92677”,
“quantity”: 700,
“remainingQuantity”: 0,
“ltp”: 26.10,
“price”: 27.10,
“afterMarketOrder”: false,
“legName”: “ENTRY_LEG”,
“createTime”: “2025-08-28 09:40:16”,
“updateTime”: “2025-08-28 09:40:16”,
“exchangeTime”: “2025-08-28 09:40:16”,
“omsErrorDescription”: “TRADE CONFIRMED”,
“algoId”: “432508285067971”,
“legDetails”: [
{
“orderId”: “432508285067971”,
“legName”: “STOP_LOSS_LEG”,
“transactionType”: “SELL”,
“remainingQuantity”: 0,
“price”: 25.85,
“orderStatus”: “CANCELLED”,
“trailingJump”: 0.0
},
{
“orderId”: “432508285067971”,
“legName”: “TARGET_LEG”,
“transactionType”: “SELL”,
“remainingQuantity”: 0,
“price”: 28.50,
“orderStatus”: “TRADED”,
“trailingJump”: 0.0
}
],
“averageTradedPrice”: 0.0,
“filledQty”: 700
},
{
“dhanClientId”: “#########”,
“orderId”: “732508285080471”,
“exchangeOrderId”: “2500000012814733”,
“correlationId”: “order_040455”,
“orderStatus”: “TRADED”,
“transactionType”: “BUY”,
“exchangeSegment”: “NSE_FNO”,
“productType”: “INTRADAY”,
“orderType”: “LIMIT”,
“validity”: “DAY”,
“tradingSymbol”: “RELIANCE”,
“securityId”: “129575”,
“quantity”: 500,
“remainingQuantity”: 0,
“ltp”: 26.65,
“price”: 27.20,
“afterMarketOrder”: false,
“legName”: “ENTRY_LEG”,
“createTime”: “2025-08-28 09:34:55”,
“updateTime”: “2025-08-28 09:34:55”,
“exchangeTime”: “2025-08-28 09:34:55”,
“omsErrorDescription”: “TRADE CONFIRMED”,
“algoId”: “732508285080471”,
“legDetails”: [
{
“orderId”: “732508285080471”,
“legName”: “STOP_LOSS_LEG”,
“transactionType”: “SELL”,
“remainingQuantity”: 0,
“price”: 25.15,
“orderStatus”: “TRADED”,
“trailingJump”: 0.0
},
{
“orderId”: “732508285080471”,
“legName”: “TARGET_LEG”,
“transactionType”: “SELL”,
“remainingQuantity”: 0,
“price”: 28.60,
“orderStatus”: “CANCELLED”,
“trailingJump”: 0.0
}
],
“averageTradedPrice”: 0.0,
“filledQty”: 500
}
]

@Hardik sir

@Madiya_Khatri sir help

@Hardik sir kuch to solution do

I am getting the same issue how to place trigger in super order.

How to place trigger in super order no document of super order shows how to set trigger

can you share the request code also…
usse bhe dekna padega

Hey @Bishnoi

Yes, the first assumption is true. The rate limit is on the API endpoint itself, and not at a per symbol basis.

On the Super Order, are you talking about the entry leg executing at different price or the stop loss/target leg?

Hello Team,

Could you please clarify the WebSocket connection limits for the DhanHQ Python library?

Specifically:

  1. How many concurrent WebSocket connections are allowed per account / API key / IP?
  2. Is there a limit on connections from multiple servers (e.g., two or more backend hosts connecting at the same time)?
  3. Are there any rate limits or reconnection/heartbeat requirements I should follow to avoid throttling or disconnections?
  4. If multiple connections are allowed, is there a recommended maximum for production stability?

Context: I’m running separate services (strategy engine, market data logger, and alerting) on different servers, each needing a live feed.

Thanks! @Hardik

Hello @Dev_Goswami2

Sure, answering your queries here:

  1. You can create upto 5 concurrent connections on a user account level.
  2. No, there is no such restrictions
  3. Yes, you need to ensure pong is sent to every ping - which is sent once every 10 seconds
  4. No, you can seamlessly establish 5 connections, each with 5000 instruments.


@Hardik please check


@Hardik please check and tell me why am i getting this error

Hey @Dev_Goswami2

Can you confirm for which instrument are you trying to place an order? The quantity should be multiple of lot sizes, do ensure the same.