Broker API IP whitelisting explained: how it works and why it breaks
June 26, 2026 · 3 min read
Most brokers only let your API requests through from a pre-approved IP address. Here is what IP whitelisting actually is, why your bot keeps getting locked out, and how to fix it for good.
Short answer: IP whitelisting is a security rule on your broker's side that only accepts API requests coming from a network address you have pre-registered. Requests from any other address are rejected, even with the correct API key. It breaks when your IP changes, because the address your bot connects from no longer matches the one on the whitelist. The fix is to connect from a single fixed address that never changes.
If your algo keeps getting locked out for no obvious reason, whitelisting is almost always the cause. Here is exactly what is happening.
What IP whitelisting actually is
When you place orders through a broker's API, every request carries two things the broker checks:
- Your credentials (API key, token, secret) — proves who you are.
- Your source IP address — proves where the request came from.
Whitelisting is the second check. The broker keeps a short list of addresses it trusts for your account, and silently drops anything that arrives from an address not on that list. This is a deliberate safety layer: even if your API key leaks, an attacker cannot trade from their own machine, because their IP is not whitelisted.
It is the same idea SEBI's algo framework pushes brokers toward — orders should originate from a known, static source, not from wherever a bot happens to be running that day.
Why your bot keeps getting locked out
The credentials rarely change. The IP address does. That mismatch is what kicks your bot off.
Most home and office internet connections use a dynamic IP: your provider hands you an address from a pool and rotates it whenever your router reconnects, the lease expires, or the ISP reshuffles. Common triggers:
- A power cut or router restart.
- Your ISP's nightly DHCP lease renewal.
- Switching networks (home to mobile hotspot to office).
- The ISP moving you to a different address with no warning.
The moment your address changes, every API request starts arriving from an IP that is not on the whitelist. The broker rejects them. Your orders fail, your bot looks "broken," and nothing in your code is actually wrong.
How brokers handle whitelisting
It varies, but the pattern is consistent:
- Single static IP required. Many brokers let you register one fixed address per API app and expect it to stay constant.
- Manual re-approval. Some require you to log in and update the address each time it changes, which is hopeless if your IP rotates daily.
- Whitelist propagation delay. Changes can take minutes to hours to take effect, so even a correct update means downtime.
None of these are friendly to a dynamic address. They all assume you are connecting from one stable place.
The fix: connect from one fixed address
The whole problem disappears if the address your bot connects from never changes. That is exactly what a static IP for algo trading gives you: one dedicated address that you whitelist with your broker once and never touch again.
With a fixed source address:
- You register it on the whitelist a single time.
- Power cuts, reconnects, and ISP changes no longer matter.
- Your code keeps connecting from the same place, every session.
If you are still not sure whitelisting applies to your setup, start with do you need a static IP for algo trading. When you are ready to actually set one up, see how to get a static IP for your trading API.
What TrueIP offers
TrueIP gives you one dedicated, SEBI compliant IPv6 address per account, hosted in Mumbai for low latency to Indian exchanges. You whitelist it with your broker once and it stays the same for good, so your bot never gets locked out by a changing address again. Free while we grow the network, with IPv4 available at cost for brokers that still require it.
Tired of your bot getting kicked off the whitelist? Get a free static IP here.
Keep reading
How to get a static IP for your trading API (step by step)
A practical guide to getting a fixed IP address for your broker API and whitelisting it correctly, plus the options that work and the ones that quietly cost you more than they should.
ReadDo you need a static IP for algo trading? A straight answer
If you place orders through a broker API in India, you almost certainly need a static IP. Here is when it is required, when it is not, and why a dynamic home IP breaks your bot.
Read