Broadcast
Live market data over WebSocket. Connect to wss://livefeed.blinkx.in and receive real-time ticks for subscribed instruments.
Connection Flow
- Obtain
api_keyandaccess_tokenfrom BlinkX GET https://api.blinkx.in/instruments— gettoken+exchangefor each instrument- Connect to
wss://livefeed.blinkx.in/ws?api_key=<key>&access_token=<token> - Send subscribe message with instrument keys
- Receive live ticks as long as connected
- Change mode or unsubscribe at any time
Step 1 — Get Instruments
Fetch available instruments to get the token and exchange values needed for subscription.
curl --location 'https://api.blinkx.in/instruments' \
--header 'Authorization: token <your_api_key>:<your_access_token>'
Each instrument has a token and exchange field. Combine them as {token}_{exchange} to form the instrument key used in all WebSocket messages.
Step 2 — Connect
wss://livefeed.blinkx.in/ws?api_key=<your_api_key>&access_token=<your_access_token>
If credentials are invalid the connection is rejected immediately:
{ "code": 401, "error": "No Session found for this api key." }
{ "code": 401, "error": "Please login again." }
Step 3 — Subscribe
All WebSocket messages use the format {"a": "<action>", "p": <payload>}.
Send a list of instrument keys to subscribe:
{
"a": "s",
"p": ["1234_NSE", "5678_BSE", "9999_NFO"]
}
Supported exchanges: NSE, BSE, NFO, BFO, NCD, MFO
On subscribe, the server immediately sends a full snapshot of current market data, then continuously pushes live updates.
Response:
{
"a": "Subscribe",
"p": {
"Status": [
"Client myApp session abc123 successfully subscribed 1234_NSE",
"Stock not present in Stock Store 9999_NFO"
]
}
}
Step 4 — Receive Live Data
The server pushes only changed fields on every tick. The ik field (instrument key) is always present.
There are 3 modes:
Mode: ALL (default)
Full OHLC, volumes, OI, upper/lower circuits, and 5-level bid/ask market depth.
Use for: trading terminals, order placement screens, full market watch.
{
"ik": "1234_NSE",
"ltp": 2345.50,
"t": 1712500000000,
"o": 2300.00,
"h": 2360.00,
"l": 2290.00,
"c": 2310.00,
"v": 1500000,
"ltq": 10,
"ltt": 1712499990000,
"atp": 2340.00,
"tbq": 50000,
"tsq": 45000,
"tt": 32000,
"52h": 2800.00,
"52l": 1900.00,
"uc": 2530.00,
"lc": 2115.00,
"oi": 120000,
"oih": 130000,
"oil": 110000,
"poi": 115000,
"bq1": 500, "bp1": 2345.00, "bo1": 3,
"bq2": 800, "bp2": 2344.50, "bo2": 5,
"bq3": 1200, "bp3": 2344.00, "bo3": 8,
"bq4": 300, "bp4": 2343.50, "bo4": 2,
"bq5": 600, "bp5": 2343.00, "bo5": 4,
"aq1": 400, "ap1": 2345.50, "ao1": 2,
"aq2": 700, "ap2": 2346.00, "ao2": 6,
"aq3": 900, "ap3": 2346.50, "ao3": 7,
"aq4": 200, "ap4": 2347.00, "ao4": 1,
"aq5": 500, "ap5": 2347.50, "ao5": 3
}
Mode: QUOTE (q)
OHLC, volume, and buy/sell totals. No market depth.
Use for: portfolio screens, watchlists, charts.
{
"ik": "1234_NSE",
"ltp": 2345.50,
"o": 2300.00,
"h": 2360.00,
"l": 2290.00,
"c": 2310.00,
"v": 1500000,
"ltq": 10,
"atp": 2340.00,
"tbq": 50000,
"tsq": 45000
}
Mode: LTP (l)
Only the last traded price. Lowest bandwidth.
Use for: price alerts, dashboards, large watchlists where depth is not needed.
{
"ik": "1234_NSE",
"ltp": 2345.50
}
Step 5 — Change Mode
Switch mode for already-subscribed instruments at any time — no need to unsubscribe first.
{
"a": "m",
"p": ["l", ["1234_NSE", "5678_BSE"]]
}
| Value | Mode |
|---|---|
"l" | LTP only |
"q" | Quote (OHLC + volumes, no depth) |
| anything else | ALL (full depth) |
Response:
{
"a": "Mode",
"p": {
"Status": ["Client myApp new mode is LTP subscribed 1234_NSE"]
}
}
Step 6 — Unsubscribe
{
"a": "u",
"p": ["1234_NSE", "5678_BSE"]
}
Response:
{
"a": "UnSubscribe",
"p": {
"Status": ["Client myApp successfully unsubscribed for 1234_NSE"]
}
}
Step 7 — Heartbeat
The server sends a heartbeat every 10 seconds:
{
"a": "HeartBeat",
"p": { "timestamp": "1712500000000" }
}
If heartbeats stop arriving, treat the connection as dead and reconnect.
Field Reference
All Modes
| Field | Description |
|---|---|
ik | Instrument key ({token}_{exchange}) |
ltp | Last traded price |
Quote + ALL Mode
| Field | Description |
|---|---|
t | Tick timestamp (epoch ms) |
o | Open price |
h | High price |
l | Low price |
c | Previous day close price |
v | Volume traded today |
ltq | Last trade quantity |
ltt | Last trade time (epoch ms) |
atp | Average traded price |
tbq | Total buy quantity |
tsq | Total sell quantity |
tt | Total trades |
52h | 52-week high |
52l | 52-week low |
uc | Upper circuit |
lc | Lower circuit |
bt | Book type |
ts | Trading status |
ALL Mode Only
| Field | Description |
|---|---|
bq1–bq5 | Bid quantities (level 1–5) |
bp1–bp5 | Bid prices (level 1–5) |
bo1–bo5 | Bid order count (level 1–5) |
aq1–aq5 | Ask (offer) quantities (level 1–5) |
ap1–ap5 | Ask (offer) prices (level 1–5) |
ao1–ao5 | Ask (offer) order count (level 1–5) |
oi | Open interest |
oih | Day high OI |
oil | Day low OI |
poi | Previous day OI |
mc | Market capitalisation |
Instrument Info (initial snapshot only)
| Field | Description |
|---|---|
s | Symbol |
bs | Base symbol |
ds | Display symbol |
ss | Stream symbol |
e | Exchange |
to | Token |
tsi | Tick size |
ls | Lot size |
Action Reference
a value | Direction | Purpose |
|---|---|---|
s | Client → Server | Subscribe to instruments |
u | Client → Server | Unsubscribe from instruments |
m | Client → Server | Change feed mode |
HeartBeat | Server → Client | Keepalive ping (every 10s) |
Subscribe | Server → Client | Subscription confirmation |
UnSubscribe | Server → Client | Unsubscription confirmation |
Mode | Server → Client | Mode change confirmation |
| (tick update) | Server → Client | Live price update (contains ik) |
Error Codes
| Code | Meaning |
|---|---|
401 | Invalid api_key, incorrect access_token, or session not found |
500 | Server configuration error |