This quickstart walks you through installing the Nubra Python SDK, authenticating securely, and getting ready to stream realtime market data, place orders with just a few lines of code, and retrieve portfolio status — all in under 5 minutes.
Nubra’s APIs are designed to be developer-first: minimal setup, intuitive workflows, and consistent patterns across streaming, trading, and portfolio access. You connect once, stream instantly, and place orders without any complexity.
Installing the Nubra Python SDK (Under a Minute)#
Installation Steps#
-
Open Nubra API Docs
https://nubra.io/products/api/docs/ -
Open Python SDK Docs
Click the Python SDK card -
Copy Install Command
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple nubra-sdk -
Install the SDK
Open Command Prompt / Terminal (ensure Python is in your PATH)python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple nubra-sdk -
Done 🎉
SDK installs in under a minute
What’s Next?#
Once installed, you’re ready to:
- Initialize the Nubra SDK
- Pull live market data
- Place and manage orders
- Retrieve portfolio and positions
Authentication & Login (Under a Minute)#
Authenticate once to establish a secure session before accessing market data, trading, or portfolio APIs.
Authentication Steps#
-
Open Python SDK Docs
From Nubra API Docs, click the Python SDK card -
Navigate to Authentication
Go to the Authentication section -
Copy the Login Code
Use the provided authentication example -
Select Environment
Choose the environment you want to log into:- PROD — live market trading
- UAT — simulated market environment for testing strategies
-
Run the Code
When prompted, enter:- Registered mobile number
- OTP received on your phone
- MPIN
-
Done 🔐
You are now successfully logged in
What’s Next?#
Once authenticated, you’re ready to:
- Stream realtime market data via WebSocket
- Place UAT or live orders
- Retrieve funds, positions, and portfolio
- Build fully automated execution and monitoring systems
Realtime Market Data via WebSocket (Under a Minute)#
Stream live prices directly into your code using Nubra’s realtime WebSocket APIs.
WebSocket Streaming Steps#
-
Open Python SDK Docs
From Nubra API Docs, click the Python SDK card -
Navigate to Realtime Data
Go to the Realtime Data section -
Select a Stream Type
Nubra provides 5 realtime streams:- Index Data
- Greeks
- Option Chain
- Orderbook
- Market Moves
-
Copy the Index Data Example
Index data streams basic price and volume in realtime -
Run the Code
Execute the script and watch realtime data streaming instantly -
Done ⚡
Realtime streaming live in under a minute
What’s Next?#
Once you’ve streamed realtime data:
- With the addition of a few extra lines of code, you can store the incoming ticks and chart them in realtime or post-session
- Build signal generation and strategies on top of the stored market data
- Place orders algorithmically based on those signals
- Retrieve portfolio, positions, and execution status programmatically
Placing Your First Order (Under a Minute)#
Place a live or UAT order using Nubra’s Trading APIs with minimal code.
Order Placement Steps#
-
Open Guides & Examples
Navigate to Guides and Examples — either via the card on the page or the top navigation tab -
Go to Place Order
Open the Place Order card under Order Placement & Execution -
Select an Order Type
Choose the order flow that fits your use-case:- Individual Orders — single-leg equity, futures, or options orders
- Basket Orders — place multiple order types and instruments together in 1 single API call
- Flexi Orders — strategy-level orders for futures & options with dynamic sizing, time windows, and modification support
-
Run the Code
Execute the script and head over to the Nubra Terminal to watch the order being executed -
Done 🚀
Your first trade placed in under a minute
What’s Next?#
Once you can retrieve positions programmatically, you can:
- Build position-aware strategies
- Automate risk checks and exits
- Track real-time P&L and exposure
- Combine positions with realtime Greeks and market data
- Create fully automated execution and monitoring systems
Retrieving Positions & Portfolio (Under a Minute)#
Fetch live positions, P&L, and portfolio state programmatically using Nubra’s Portfolio APIs.
Positions & Portfolio Steps#
-
Open Python SDK Docs
From the Nubra API Docs, click the Python SDK card -
Navigate to Portfolio
Go to the Portfolio tab, which provides access to:- Funds & Margin
- Holdings
- Positions
-
Check Funds & Margin
Use the Funds API to view available balance, collateral, margin usage, MTM, and net margin available -
View Holdings
Open the Holdings section to see invested value, current value, day & overall PnL, margin benefit, and pledge availability -
Go to Positions
Navigate to the Positions section and copy the sample code -
Run the Code
Execute the script to fetch live positions, quantities, average prices, and real-time P&L -
Done 📊
Track funds, holdings, positions, and P&L programmatically in under a minute
What’s Next?#
Once you can retrieve positions programmatically, you can:
- Build position-aware strategies
- Automate risk checks and exits
- Track real-time P&L and exposure
- Combine positions with realtime Greeks and market data
- Create fully automated execution + monitoring systems
