Index Data¶
The index realtime stream delivers continuously updating market data for indices, equities, and some derivative symbols through WebSocket callbacks.
When To Use This Page¶
Use this page when you need to:
- subscribe to streaming index values
- receive tick-driven updates for supported stock symbols
- monitor top-line realtime values without order-book depth
LLM guidance
This is a realtime stream, not a snapshot response. Use this page when you need continuously updating top-line values for indices, equities, or supported derivative symbols. If you only need one-time reads, use Current Price.
Basic Usage¶
from nubra_python_sdk.ticker import websocketdata
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
nubra = InitNubraSdk(NubraEnv.PROD, env_creds=True)
def on_index_data(msg):
print("[INDEX]", msg)
def on_connect(msg):
print("[status]", msg)
def on_close(reason):
print(f"Closed: {reason}")
def on_error(err):
print(f"Error: {err}")
socket = websocketdata.NubraDataSocket(
client=nubra,
on_index_data=on_index_data,
on_connect=on_connect,
on_close=on_close,
on_error=on_error,
)
socket.connect()
socket.subscribe(
["NIFTY", "RELIANCE26FEBFUT", "NIFTY2612026000CE"],
data_type="index",
exchange="NSE",
)
socket.keep_running()
Subscription Contract¶
| Parameter | Type | Required | Meaning |
|---|---|---|---|
symbols |
list[str] |
yes | index or supported symbol identifiers |
data_type |
str |
yes | must be index |
exchange |
str |
no | exchange override, defaults to NSE if supported by the stream |
Response Shape¶
class IndexDataWrapper:
indexname: str
exchange: str
timestamp: int
index_value: int
high_index_value: int
low_index_value: int
volume: int
changepercent: float
tick_volume: int
prev_close: int
volume_oi: int | None
Response Contract¶
| Field | Type | Meaning |
|---|---|---|
indexname |
str |
subscribed symbol or index name |
exchange |
str |
exchange name |
timestamp |
int |
event timestamp |
index_value |
int |
current streamed value |
high_index_value |
int |
session high |
low_index_value |
int |
session low |
volume |
int |
traded volume |
changepercent |
float |
percentage change from previous close |
tick_volume |
int |
tick-activity count |
prev_close |
int |
previous close |
volume_oi |
int |
OI-related value when present |
Implementation Notes¶
- Despite the name, the
indexstream can emit updates for more than just benchmark indices. - Use dedicated callbacks when you want stream-specific processing.
- Numeric values are returned in exchange-native units where applicable.
Important Rules
- This is a realtime stream, not a snapshot API.
- The
indexstream name does not mean only benchmark indices are supported. - Use the correct symbol format for the instrument you subscribe to.
- Respect session subscription-weight limits. Review Subscription Limits.