Dhan HQ API Static IP Whitelisting: Complete Setup Guide (2026)

Dhan HQ API Static IP Whitelisting: Complete Setup Guide (2026)

Configure Dhan HQ Trading API with a dedicated static Indian IP — portal steps, Python proxy example, WebSocket tips and fix for Dhan 401/403 IP errors.

Dhan static IP setup is the same pattern as other Indian APIs: one dedicated Mumbai IPv4 pasted in the Dhan HQ whitelist, then REST and WebSocket calls exit through HTTP proxy port 443.

Why Dhan API traders use dedicated static IPs

Dhan HQ API is popular for options and intraday algos thanks to competitive pricing and a modern REST + WebSocket stack. Like every SEBI-aligned broker API in 2026, order requests must originate from a registered static IP. Home broadband and rotating cloud IPs trigger 401/403 responses and unstable sessions.

Step 1 — Allocate your static IP

At algo-ip.in, complete KYC, top up wallet, allocate IPv4 (₹200/month) or IPv6 (₹99/month). Copy proxy host, port 443, username and password from the dashboard.

Step 2 — Whitelist on Dhan developer portal

Step 3 — Route Python / Node clients through the proxy

Step 4 — WebSocket on the same IP

Dhan market-data sockets must egress from the same static IP as your order REST calls. Set HTTPS_PROXY in the environment before initializing the Dhan WebSocket client, or configure your SDK proxy parameters explicitly.

Dhan-specific troubleshooting