Quick answer
Upstox’s Developer API is a free REST and WebSocket API for Indian equities, F&O, currency and commodities: orders, portfolio, market quotes, historical candles and a market-data feed. Authentication is OAuth2 with an access token that is valid until 3:30 AM the next day, so you log in daily.
Upstox API at a glance
- Pricing
- Free API
- Availability
- Indian residents with an Upstox account
- Paper trading
- Sandbox app mode for order APIs
- Integration type
- OAuth login
- In AlgoGP
- Design and backtest in AlgoGP, connect the exported code
- Auth
- OAuth2 authorization code; token valid until ~3:30 AM IST
- Price
- Free
- SDK
- Python
upstox-python-sdk, Node, Java - Data
- Quotes, candles, Protobuf market-data feed
Historical candles
Candles are keyed by instrument key (e.g. NSE_EQ|INE002A01018 for Reliance), not by trading symbol. Download the instruments file once a day to map symbols to keys, then call the historical-candle endpoint with an interval and date range.
Build an Upstox strategy with AlgoGP
AlgoGP does not connect to Upstox natively yet. Upstox authenticates with a browser OAuth login and refreshable tokens, so it needs a one-time manual login step that generated code cannot do on its own.
- 1
Design and backtest in AlgoGP
Describe the strategy to the copilot and backtest it on years of normalized history. The result does not depend on any vendor.
- 2
Export the Python project
Every project exports
strategy.py,market_data.py,brokers.pyandlive.py. The strategy only sees bars, cash, positions and orders, never a vendor’s wire format. - 3
Plug in Upstox
Implement the four adapter methods (
account,positions,submit_market_orderand a candle fetcher) with Upstox’s SDK, or keep a built-in platform for paper trading and add Upstox when you go live.
Built-in brokers for the same markets: Alpaca, Tradier, Interactive Brokers, OKX.
Upstox API: frequently asked questions
Is the Upstox API free?
Yes, for Upstox customers.
How long is an Upstox access token valid?
Until about 3:30 AM IST the next day, regardless of when it was generated.
Design and backtest your Upstox strategy first
AlgoGP turns an idea into Python and tests it on years of history before you connect it to Upstox. The exported code keeps the broker behind four small adapter methods.
- AI copilot writes and revises the rules
- Backtests with realistic costs
- Exported Python ready to wire to Upstox
Free plan, no card required.
Upstox alternatives
- Zerodha Kite Connect API GuideIndia’s largest broker: Kite Connect REST and WebSocket APIs for NSE, BSE and MCX, with an access token minted by a daily login.
- Angel One SmartAPI API GuideAngel One’s free SmartAPI for Indian equities, F&O and commodities: log in with client code, PIN and a TOTP, then trade over REST.
- Dhan (DhanHQ) API GuideDhanHQ API v2: free order APIs for Indian equities, F&O and commodities with a client id and access token; market data paid.
- FYERS API GuideFYERS API v3: free trading, quotes and history for Indian markets, with an app id, secret and a daily OAuth access token.
Independent guide. AlgoGP is not affiliated with Upstox. Limits, prices and availability change; confirm them in the official documentation. Nothing here is investment advice.