Algo trading with Upstox
Connect your Upstox account to MyAlgoMate and automate your execution — one-click orders, risk controls and fast exits, no coding required.
Does MyAlgoMate work with Upstox?
Yes. Your Upstox account works with 8 MyAlgoMate products: StockMock & AlgoTest Strategy Automation, TradeMate, Copy Trading Software, TradeBridge, Cloud Server for Algo Trading, RMS Tool, Virtual Trading Environment and Trade Scalper. In copy trading, an Upstox account can be the master or a child — see copy trading with Upstox, step by step. You connect it once with your own Upstox API details. MyAlgoMate provides the technology only — the software places the orders you set up, and gives no tips or advice.
Last updated:
Connecting Upstox
MyAlgoMate connects to Upstox through Upstox's official Developer API. You create your own app in the Upstox developer console, enable TOTP on your Upstox account, register a static IP as Upstox requires, and then enter your API Key, API Secret, Client ID, PIN and TOTP key into the broker login form in MyAlgoMate.
Use Upstox with
Your Upstox account works with all 8 of these MyAlgoMate products — plus custom automation of your own strategy.
- StockMock & AlgoTest Strategy Automation
- TradeMate
- Copy Trading Software — see Upstox copy trading (master or child, API and static IP)
- TradeBridge
- Cloud Server for Algo Trading
- RMS Tool
- Virtual Trading Environment
- Trade Scalper
- Custom strategy automation — your own logic, automated; you set the rules and stay in control.
Setting up Upstox
Step 1 — Create your app in the Upstox developer console
The Upstox Developer API is free — both the trading and data APIs are free to use, so there is no subscription to buy. You only need an active Upstox account.
- Go to account.upstox.com/developer/apps and sign in with your Upstox account.
- Create a new app and fill in:
- App Name — e.g. MyAlgoMate
- Redirect URL — set it to https://www.upstox.com
- Copy your API Key and API Secret. Keep the API Secret confidential.
⚠️ The Redirect URL must match exactly the one registered on your app. A mismatch is the usual cause of an “Invalid Credentials” error when connecting.
Step 2 — Enable TOTP and save your TOTP key
Upstox lets you use TOTP instead of an SMS OTP for 2FA. MyAlgoMate signs in for you, so it cannot receive an SMS — you need TOTP enabled and its secret key.
- In the Upstox app, tap Account → Profile → My Account → Time-based OTP (TOTP), then Enable TOTP. You can also manage it at account.upstox.com/totp.
- Enter the 6-digit OTP sent to your registered mobile number and continue.
- When the 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 and enter the generated 6-digit code to finish enabling TOTP.
Step 3 — Register your static IP (mandatory)
Upstox requires that all API orders originate from a registered static IP (SEBI retail algo-trading rules, in force since 1 April 2026). It applies to the order APIs — placing, modifying and cancelling orders, GTT orders and exiting positions. Read-only calls such as holdings and positions are exempt.
- Register one Primary static IP and, optionally, one Secondary static IP for backup and failover.
- 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.
- ⚠️ A static IP can be linked to only one customer — it cannot be shared with, or registered by, anyone else. Use an IP that is yours alone.
- ⚠️ You can change a registered static IP only once per calendar week, and changing it signs out your existing API session, so you will need to reconnect in MyAlgoMate afterwards.
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 4 — Enter the details in MyAlgoMate
- Open the broker login form in MyAlgoMate and enter your API Key, API Secret, Client ID, PIN and TOTP key, then save.
How to get your Upstox API key
- Sign in to Upstox and open Developer Apps at account.upstox.com/developer/apps (Upstox also lists it as the Apps section inside the Accounts tab).
- Create a new app and enter an app name and the Redirect URL (see the Redirect URL section below).
- Save the app. Upstox then gives you an API Key and an API Secret (Upstox’s documentation calls the API Key the client_id).
- Copy both and keep them private. Never share your API Secret or password with anyone.
- Enter the API Key and API Secret in the broker login form in MyAlgoMate, along with your Client ID, PIN and TOTP key.
Your API Key alone does not sign you in. Upstox issues a fresh access token for each trading day, which is why MyAlgoMate signs in for you with your TOTP key.
What you need to collect
To connect Upstox, the broker login form in MyAlgoMate needs five details:
- API Key — from the app you created in the Upstox developer console
- API Secret — from the same app; keep it confidential
- Client ID — your own Upstox account id, the one you sign in to Upstox with
- PIN — your Upstox 6-digit PIN
- TOTP key — the secret key you saved when enabling TOTP
One more thing is set on Upstox's side rather than entered here: you must register a static IP.
API Key and Client ID are not the same thing
Upstox's API documentation also calls the API Key a client_id, which trips people up. In MyAlgoMate they are two separate fields: the API Key is the key issued to the app you created in the developer console, while the Client ID is your own Upstox account id — the one you sign in with. Put each in its own field.
The Upstox Developer API is free
Upstox does not charge for API access — both the trading and data APIs are free to use, so there is no subscription to buy and nothing to renew. You only need an active Upstox account. (Upstox's own brokerage charges for the trades you place are separate and depend on your plan.)
Please check with Upstox for latest terms.
Why TOTP is required
Upstox offers a choice between an SMS OTP and TOTP for 2FA at login. Because MyAlgoMate signs in to your Upstox account for you, it has no way to receive an SMS — so you need TOTP enabled on your account, and you enter its secret key in MyAlgoMate. Keep the authenticator app on your phone too, so you can still sign in to Upstox yourself.
Static IP — required by Upstox
Since 1 April 2026, all Upstox API orders must originate from a registered static IP. Each user gets one Primary static IP plus an optional Secondary for backup and failover. The requirement applies to order operations — place, modify and cancel orders, GTT orders and exiting positions — while read-only calls such as holdings and positions are exempt. Two rules to keep in mind: a static IP can be linked to only one customer and cannot be shared, and you can change a registered IP only once per calendar week, which signs out your existing API session. 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 create the app, set the Redirect URL to https://www.upstox.com — and make sure it stays exactly that. Upstox checks the redirect URL on every login, so a mismatch is the usual reason a connection fails with an “Invalid Credentials” error.
Upstox API limits worth knowing
These come from Upstox’s own developer pages. Please check with Upstox for latest terms.
- Access token — Upstox access tokens expire at 3:30 AM the next day, whenever they were created. A new login is needed each day.
- Order APIs — Place, modify and cancel order calls: 10 per second, 500 per minute and 2000 per 30 minutes per user. Upstox lists 50 per second only for registered algos.
- Other APIs — Holdings, positions, funds and similar: 50 per second, 500 per minute and 2000 per 30 minutes.
- TOTP login — 1 per second, 10 per minute and 60 per 30 minutes. Upstox says going over a limit might lead to temporary suspension of access.
- Static IP — Orders must come from a registered static IP (one Primary and one optional Secondary, IPv4 or IPv6). One IP can be linked to only one customer. You can change it once per calendar week, and a change signs out your current token.
Every trading account needs its own static IP, and no MyAlgoMate software price includes one. Only our Cloud Server for Algo Trading comes with a static IP.
Why did my Upstox login fail?
Upstox shows an error code when a login does not work. These are the common ones from Upstox’s Get Token page and what to check.
- UDAPI100069 — The API Key or API Secret is wrong. Copy them again from your app without extra spaces.
- UDAPI100070 — The Redirect URL does not match the one registered on your app. Make them identical.
- UDAPI100097 — The PIN or TOTP code does not match your account. Re-check your 6-digit PIN and your TOTP key.
- UDAPI100098 — TOTP is not enabled on your Upstox account. Enable it first (see Step 2 above).
- UDAPI100099 — Too many login attempts. Wait a little and try again.
Keep your credentials private
Your API Secret, PIN 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.
Upstox — questions
Do I need to pay for the Upstox API?
No. Upstox's Developer API is free — both the trading and data APIs are free to use, so there is no subscription for API access. You only need an active Upstox account. Upstox's own brokerage charges for the trades you place are separate and depend on your plan.
What Upstox details does MyAlgoMate need?
Five: your API Key and API Secret from the app you create in the Upstox developer console, your Client ID, your PIN, and your TOTP key. You enter all five in the broker login form in MyAlgoMate. Separately, you must register a static IP on Upstox's side.
Why do I need TOTP for Upstox?
Upstox lets you choose between an SMS OTP and TOTP for 2FA. MyAlgoMate signs in to your Upstox account for you and cannot receive an SMS, so TOTP must be enabled and its secret key entered in MyAlgoMate. Keep the authenticator app on your phone as well, so you can still sign in to Upstox yourself.
Where do I find my Upstox TOTP key?
In the Upstox app, go to Account → Profile → My Account → Time-based OTP (TOTP) and choose Enable TOTP (you can also manage it at account.upstox.com/totp). Enter the OTP sent to your registered mobile, and when the 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. That secret key is what you enter in MyAlgoMate.
Do I need a static IP for Upstox API trading?
Yes — since 1 April 2026, all Upstox API orders must come from a registered static IP. You get one Primary IP and an optional Secondary for backup. It applies to order operations; read-only calls such as holdings and positions are exempt. A static IP can be linked to only one customer and cannot be shared, and you can change it only once per calendar week, which signs out your existing API session. 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.
What Redirect URL should I register on my Upstox app?
Set it to https://www.upstox.com
Why does my Upstox connection fail with “Invalid Credentials”?
That error is usually a Redirect URL mismatch. Upstox checks the redirect URL on every login, so the one registered on your app must match exactly the one being used. Open your app in the Upstox developer console and confirm the Redirect URL is https://www.upstox.com. It is also worth checking that your API Key and API Secret were copied without extra spaces.
Where do I find my Upstox API key?
In Upstox Developer Apps (account.upstox.com/developer/apps), after you create an app. Upstox gives you an API Key and an API Secret. Keep both private and never share them with anyone.
How long does the Upstox access token last?
Until 3:30 AM the next day, whenever it was created. MyAlgoMate signs in for you each day with your TOTP key, so you do not repeat the login yourself.
What are the Upstox API rate limits?
For order calls (place, modify, cancel) Upstox lists 10 per second, 500 per minute and 2000 per 30 minutes per user. Other calls such as holdings and positions are 50 per second. Please check with Upstox for latest terms.
Automate on Upstox, the compliant way
Connect in minutes, automate without code, and stay in control — with a team that answers.