Hi everyone,
I’m facing a strange issue with the Dhan API and wanted to check if anyone else is experiencing this or has a fix.
Error
Exceeded 30 redirects
Happening across multiple endpoints:
-
get_fund_limits
-
intraday_minute_data
-
get_positions
-
get_trade_book
What I Debugged
I tested this outside my app (pure Python requests) and here’s what I found:
- Calling:
https://api.dhan.co/v2/fundlimit
Returns:
301 Moved Permanently
Location: https://api.dhan.co:443/v2/
- Then calling:
https://api.dhan.co:443/v2/
Again returns:
301 → https://api.dhan.co:443/v2/
This creates an infinite redirect loop, so any HTTP client eventually fails with:
Exceeded 30 redirects
Debug output:
Key Observations
-
Happens even without using dhanhq SDK
-
Happens regardless of token / headers
-
Response headers show:
-
server: awselb/2.0 -
via: CloudFront
-
So this looks like a CloudFront / ELB routing issue, not an application bug.
What I Tried
-
Disabled redirects → confirmed loop
-
Tried multiple endpoints → same behavior
-
Tested POST/GET → same result
-
Removed headers/token → same result
-
DNS resolves to CloudFront → confirms edge routing
Questions
-
Is anyone else facing this right now?
-
Is this region-specific (India / ISP issue)?
-
Any known alternate base URL for Dhan API?
-
Any workaround (VPN / different DNS / headers)?