Welcome to the OpenAlgo REST API Documentation. This comprehensive guide covers all API endpoints available for algorithmic trading operations.
Local Host : http://127.0.0.1:5000/api/v1
Ngrok Domain : https://<your-ngrok-domain>.ngrok-free.app/api/v1
Custom Domain: https://<your-custom-domain>/api/v1All API endpoints require authentication using an API key. Include your API key in the request body:
{
"apikey": "<your_app_apikey>"
}Execute and manage trading orders across all supported exchanges.
| Endpoint | Description |
|---|---|
| PlaceOrder | Place a new order |
| PlaceSmartOrder | Place position-aware smart order |
| OptionsOrder | Place options order with offset |
| OptionsMultiOrder | Place multi-leg options order |
| BasketOrder | Place multiple orders simultaneously |
| SplitOrder | Split large order into smaller chunks |
| ModifyOrder | Modify an existing order |
| CancelOrder | Cancel a specific order |
| CancelAllOrder | Cancel all open orders |
| ClosePosition | Close all open positions |
| PlaceGTTOrder | Place a SINGLE or OCO GTT (Good Till Triggered) order |
| ModifyGTTOrder | Modify an active GTT trigger |
| CancelGTTOrder | Cancel an active GTT trigger |
| GTTOrderBook | List active GTT triggers |
Query order status and position information.
| Endpoint | Description |
|---|---|
| OrderStatus | Get current status of an order |
| OpenPosition | Get open position for a symbol |
Access real-time and historical market data.
| Endpoint | Description |
|---|---|
| Quotes | Get market quotes for a symbol |
| MultiQuotes | Get quotes for multiple symbols |
| Depth | Get market depth (Level 2) data |
| History | Get historical OHLCV data |
| Intervals | Get available time intervals |
Symbol lookup, search, and instrument data.
| Endpoint | Description |
|---|---|
| Symbol | Get detailed symbol information |
| Search | Search for symbols |
| Expiry | Get expiry dates for F&O |
| Instruments | Get all instruments list |
Options-specific operations and analytics.
| Endpoint | Description |
|---|---|
| OptionSymbol | Get option symbol by offset |
| OptionChain | Get full option chain data |
| SyntheticFuture | Calculate synthetic futures price |
| OptionGreeks | Calculate option Greeks and IV |
Account information, funds, and portfolio data.
| Endpoint | Description |
|---|---|
| Funds | Get account funds information |
| Margin | Calculate margin requirement |
| OrderBook | Get all orders for the day |
| TradeBook | Get all trades for the day |
| PositionBook | Get all current positions |
| Holdings | Get portfolio holdings |
Market timing and holiday information.
| Endpoint | Description |
|---|---|
| Holidays | Get market holidays for a year |
| Timings | Get market timings for a date |
| CheckHoliday | Check if a date is a holiday |
Sandbox/analyzer mode for testing.
| Endpoint | Description |
|---|---|
| AnalyzerStatus | Get analyzer mode status |
| AnalyzerToggle | Toggle analyzer mode on/off |
Real-time market data streaming.
| Endpoint | Description |
|---|---|
| LTP | Subscribe to last traded price |
| Quote | Subscribe to quote updates |
| Depth | Subscribe to market depth |
Send trade alerts via WhatsApp. Send-only public surface — pairing,
start/stop, config, users, broadcast, stats, and preferences are all
admin-only and live behind the session-authed /whatsapp web UI. A
leaked API key cannot create, mutate, or enumerate the device session.
| Endpoint | Description |
|---|---|
| Overview | Architecture, security model, command reference |
| Notify | Send text / image / document to self, one user, or up to 5 recipients |
| Code | Description |
|---|---|
| NSE | National Stock Exchange (Equity) |
| BSE | Bombay Stock Exchange (Equity) |
| NFO | NSE Futures & Options |
| BFO | BSE Futures & Options |
| CDS | Currency Derivatives (NSE) |
| BCD | Currency Derivatives (BSE) |
| MCX | Multi Commodity Exchange |
| NCO | NSE Commodities (futures + options, Zerodha only) |
| NSE_INDEX | NSE Index (for options trading) |
| BSE_INDEX | BSE Index (for options trading) |
| GLOBAL_INDEX | Global indices (US30, JAPAN225, HANGSENG, GIFTNIFTY, etc.) — quote-only, Zerodha only |
| Code | Description |
|---|---|
| MIS | Margin Intraday Square-off |
| CNC | Cash and Carry (Equity Delivery) |
| NRML | Normal (F&O Overnight) |
| Code | Description |
|---|---|
| MARKET | Market order |
| LIMIT | Limit order |
| SL | Stop-loss limit order |
| SL-M | Stop-loss market order |
| Code | Description |
|---|---|
| BUY | Buy order |
| SELL | Sell order |
SYMBOL
Example: RELIANCE, SBIN, TCS
[SYMBOL][DD][MMM][YY]FUT
Example: NIFTY30JAN25FUT, BANKNIFTY27FEB25FUT
[SYMBOL][DD][MMM][YY][STRIKE][CE/PE]
Example: NIFTY30JAN2525000CE, BANKNIFTY27FEB2552000PE
All API responses follow a consistent JSON format:
{
"status": "success",
"data": { ... }
}{
"status": "error",
"message": "Error description"
}| Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad Request (validation error) |
| 403 | Forbidden (invalid API key) |
| 404 | Not Found |
| 429 | Rate Limit Exceeded |
| 500 | Internal Server Error |
OpenAlgo implements differentiated rate limiting for various API operations:
| API Type | Rate Limit |
|---|---|
| Order Management | 10 per second |
| Smart Orders | 2 per second |
| General APIs | 50 per second |
| Webhooks | 100 per minute |
For detailed rate limiting information including configuration options, see Rate Limiting.
OpenAlgo provides official SDKs for popular programming languages:
- Python:
pip install openalgo - Node.js: Coming soon
- Java: Coming soon
- Documentation: https://docs.openalgo.in
- GitHub: https://github.com/marketcalls/openalgo
- Discord: https://www.openalgo.in/discord