Current Price¶
current_price() returns a lightweight latest-price snapshot for one instrument without order book depth. Use it when you only need the latest traded price, previous close, and percentage change.
When To Use This Page¶
Use this page when you need to:
- fetch a quick latest-price snapshot for one symbol
- show top-line prices in dashboards or simple monitoring tools
- check price movement from the previous close
- avoid the heavier market-quote response when depth is not needed
LLM guidance
Prefer current_price() over full market-quote methods when only the latest price, previous close, and percentage change are needed. Use market quotes only when you need richer quote detail or depth-related fields.
Basic Usage¶
from nubra_python_sdk.marketdata.market_data import MarketData
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True)
market_data = MarketData(nubra)
nifty_price = market_data.current_price("NIFTY")
reliance_price = market_data.current_price("RELIANCE")
print(nifty_price)
print(reliance_price)
Accessing Response Fields¶
print(f"Message: {nifty_price.message}")
print(f"Exchange: {nifty_price.exchange}")
print(f"Current Price: {nifty_price.price}")
print(f"Previous Close: {nifty_price.prev_close}")
print(f"Change (%): {nifty_price.change}")
SDK Surface¶
from nubra_python_sdk.marketdata.market_data import MarketData
MarketData.current_price(instrument: str, exchange=None)
Request Contract¶
| Parameter | Type | Required | Example | Meaning |
|---|---|---|---|---|
instrument |
str |
yes | NIFTY, RELIANCE |
instrument symbol |
exchange |
enum-like | no | NSE |
exchange override |
Response Contract¶
| Field | Type | Nullable | Unit | Meaning |
|---|---|---|---|---|
message |
str |
no | n/a | response label |
exchange |
str |
yes | n/a | exchange name |
price |
int |
yes | exchange-native integer | latest traded price |
prev_close |
int |
yes | exchange-native integer | previous close |
change |
float |
yes | percent | percentage change from previous close |
Reference Response Shape¶
class CurrentPrice(BaseModel):
change: Optional[float] = None
message: str
exchange: Optional[str] = None
prev_close: Optional[int] = None
price: Optional[int] = None
Sample Response¶
change=0.22052865 message='current price' exchange='NSE' prev_close=2566560 price=2572220
change=0.047984645 message='current price' exchange='NSE' prev_close=145880 price=145950
Implementation Notes¶
changerepresents percentage movement from the previous close.- If your UI needs decimal display values, convert them in the display layer.
Important Rules
- Use
current_price()for lightweight latest-price checks, not for full quote depth. priceandprev_closeare returned in exchange-native integer units such as paise for NSE instruments.- This is a snapshot response, not a realtime streaming feed.
- Use the correct symbol for the current environment and exchange.
- Resolve instruments first when you are unsure about symbol correctness or downstream trading usage.
- If you need richer quote detail or order-book depth, use Market Quotes instead.
What To Read Next¶
The most common next pages are: