Algo trading with Flattrade
Connect your Flattrade account to MyAlgoMate and automate your execution — one-click orders, risk controls and fast exits, no coding required.
Connecting Flattrade
MyAlgoMate connects to Flattrade through Flattrade's official API (version 2). You generate an API Key and Secret from the Flattrade client portal — supplying a Redirect URL and a static IP, both of which are mandatory — and then enter your API Key, API Secret, Client ID (UCC), Password and TOTP key into the broker login form in MyAlgoMate.
Use Flattrade with
Your Flattrade account works with all 6 of these MyAlgoMate products — plus custom automation of your own strategy.
- Stockmock and Algotest strategy automation tool (Time Based Straddle Strangle)
- Trademate
- Copy Trading Software
- TradeBridge
- Cloud Server for Algo Trading
- RMS Tool
- Custom strategy automation — your own logic, automated; you set the rules and stay in control.
Setting up Flattrade
Step 1 — Generate your Flattrade API key
Flattrade's API is free — there are no charges for access to the trading and market-data APIs, so there is no subscription to buy. You only need an active Flattrade trading account.
- Log in to the Flattrade client portal at wall.flattrade.in.
- Open the Pi menu and choose Create New API Key.
- Fill in the details. Both of the first two are mandatory — a key cannot be generated without them:
- Redirect URL — set it to https://www.myalgomate.com/
- Primary static IP — mandatory (see Step 2)
- Secondary static IP — optional, as a backup
- Client category — choose the category that matches how you trade (see the note below)
- Copy your API Key and API Secret once the key is created.
⚠️ You can hold only ONE Flattrade API key. Since 12 January 2026, if you have more than one, only the last-used key works and the others are deleted — so don't create a second key for another platform, or your MyAlgoMate connection will stop working.
Approval: when you create the key you pick a client category. If you place fewer than 10 orders per second you do not need exchange approval; above that threshold, the algo must be approved by the exchange. Your key may show as pending until the process completes.
Step 2 — Register your static IP (mandatory)
Flattrade requires a static IP to generate an API key at all, and orders can be placed, modified or cancelled only from that IP (SEBI retail algo-trading rules).
- Provide a primary static IP (mandatory). A secondary static IP is optional, as a backup.
- Which IP to use: if you run MyAlgoMate on your own machine, use your ISP's static IP; if you run it on a cloud machine, use that cloud server's static IP.
- ⚠️ Your IPs must be unique across Flattrade's clients — an IP already registered by someone else cannot be used, so use an IP that is yours alone.
- ⚠️ You can change the primary or secondary static IP only once in a calendar week — double-check it before you save.
No static IP or cloud machine yet? Our Cloud Server for Algo Trading is a cloud machine specialised for algo trading, and it comes with its own static IP you can register.
Step 3 — Enable TOTP on your Flattrade account
MyAlgoMate signs in to Flattrade for you, so it needs a TOTP key rather than a code you type in yourself.
- In your Flattrade account security settings, enable TOTP / two-factor authentication.
- When the authenticator QR code appears, save the secret key it contains — most authenticator apps show a “can't scan the code?” or manual-entry option that reveals it. This secret key is the TOTP key MyAlgoMate needs.
- Scan the QR code into your authenticator app (Google Authenticator, Authy, etc.) so you can still sign in to Flattrade yourself.
Step 4 — Enter the details in MyAlgoMate
- Open the broker login form in MyAlgoMate and enter your API Key, API Secret, Client ID (UCC), Password and TOTP key, then save.
What you need to collect
To connect Flattrade, the broker login form in MyAlgoMate needs five details:
- API Key — generated in the Flattrade client portal under Pi → Create New API Key
- API Secret — issued alongside the API Key
- Client ID (UCC) — your Flattrade client code, the one you log in with
- Password — your Flattrade trading password
- TOTP key — the secret key saved when you enabled TOTP
Two more things are set on Flattrade's side rather than entered here: the Redirect URL you supply when creating the key, and your registered static IP.
Only one API key per account
This is the Flattrade rule that catches people out. Since 12 January 2026 you can hold only one API key. If more than one exists on your account, only the last-used key continues to work and the rest are deleted. So if you generate a fresh key for another platform, your MyAlgoMate connection will stop working — and vice versa. Use one key, and reconnect MyAlgoMate if you ever regenerate it.
Order types supported on API v2
Flattrade's API v2 accepts limit and stop-loss limit orders. Cover orders and bracket orders are not allowed through the API, and IOC orders are not allowed in the commodity segment. Worth knowing before you set up a strategy that depends on those order types.
The Flattrade API is free
Flattrade does not charge for API access — the trading and market-data APIs are free to use, so there is no subscription to buy and nothing to renew. You only need an active Flattrade trading account. (Flattrade's own brokerage charges for your trades are separate and unchanged.)
Please check with Flattrade for latest terms.
Static IP — required by Flattrade
A static IP is not just a compliance step at Flattrade — you cannot generate an API key without one, and orders can be placed, modified or cancelled only from that IP. A primary static IP is mandatory and a secondary is optional as a backup. Your IPs must be unique across Flattrade's clients, so an IP already registered by another client cannot be reused, and you can change the primary or secondary IP only once in a calendar week. Use your ISP's static IP if you run MyAlgoMate locally, or your cloud machine's static IP if you run it on a server.
If you don't have a static IP, our Cloud Server for Algo Trading is a cloud machine built for algo trading and includes a static IP of your own that you can register.
Redirect URL
When you generate the API key, set the Redirect URL to https://www.myalgomate.com/
Keep your credentials private
Your API Secret, password and TOTP key are the keys to your own trading account — never share them with anyone. MyAlgoMate provides the automation technology; you set the rules and stay in control of your own trades.
Flattrade — questions
Do I need to pay for the Flattrade API?
No. Flattrade's API is free — there are no charges for the trading or market-data APIs, so there is no subscription for API access. You only need an active Flattrade trading account.
What Flattrade details does MyAlgoMate need?
Five: your API Key and API Secret generated in the Flattrade client portal, your Client ID (UCC), your Password, and your TOTP key. You enter all five in the broker login form in MyAlgoMate. Separately, you supply a Redirect URL and register a static IP when creating the key on Flattrade's side.
How many Flattrade API keys can I have?
Only one. Since 12 January 2026 an account can hold a single API key — if more than one exists, only the last-used key works and the others are deleted. If you generate a new key for another platform, your MyAlgoMate connection will stop working, so use one key and reconnect MyAlgoMate if you ever regenerate it.
Do I need a static IP for Flattrade API trading?
Yes, and at Flattrade it is required up front — you cannot even generate an API key without providing one, and orders can be placed, modified or cancelled only from that IP. A primary static IP is mandatory and a secondary is optional as a backup. IPs must be unique across Flattrade's clients, and you can change them only once in a calendar week. Use your ISP's static IP if you run MyAlgoMate on your own machine, or your cloud machine's static IP if you run it on a server. If you don't have one, our Cloud Server for Algo Trading includes a static IP.
Which order types work with Flattrade's API?
Flattrade's API v2 accepts limit and stop-loss limit orders. Cover orders and bracket orders are not allowed through the API, and IOC orders are not allowed in the commodity segment.
Do I need approval to create a Flattrade API key?
You choose a client category when creating the key. If you place fewer than 10 orders per second you do not need exchange approval; above that threshold the algo has to be approved by the exchange. Your key may show as pending until the process is complete.
What Redirect URL should I set for my Flattrade API key?
Set it to https://www.myalgomate.com/
Automate on Flattrade, the compliant way
Connect in minutes, automate without code, and stay in control — with a team that answers.

