"ping"{
"event": "subscribe",
"payload": {
"channels": [
"wsStockPrice:<STOCK_ID>",
"wsStrategyValue:<STRATEGY_ID>",
"wsOrders:<STRATEGY_ID>",
"wsPositions:<STRATEGY_ID>",
"wsTimelines:<STRATEGY_ID>",
"wsBotStatus:<BOT_ID>",
"wsBotAllocations:<BOT_ID>",
"wsBotActivities:<BOT_ID>"
],
"token": "<API_TOKEN>"
}
}"pong"[
{
"event": "subscribe",
"channel": "wsStockPrice:64diisPJwIqt99jyjoIGT",
"response": "Subscribed to channel."
}
][
{
"event": "error",
"response": "Request failed."
},
{
"event": "error",
"response": "Authentication failed."
},
{
"event": "error",
"channel": "wsStockPrice:64diisPJwIqt99jyjoIGT",
"response": "Failed to subscribe to channel."
},
{
"event": "error",
"channel": "wsStockPrice:64diisPJwIqt99jyjoIGT",
"response": "Channel closed."
}
][
{
"event": "wsStockPrice",
"channel": "wsStockPrice:yv4fbstPFFxgngHWPwnNq",
"response": {
"stock_id": "yv4fbstPFFxgngHWPwnNq",
"bid": "675.59",
"ask": "675.59",
"last": "675.18"
}
}
][
{
"event": "wsStrategyValue",
"channel": "wsStrategyValue:IMgszSAVzapxSQCbYZC--",
"response": {
"strategy_id": "IMgszSAVzapxSQCbYZC--",
"strategy_value": "0.99998930000000000"
}
}
][
{
"event": "wsOrders",
"channel": "wsOrders:IMgszSAVzapxSQCbYZC--",
"response": [
{
"order_id": "i9wtRL8_CsiT9krl1Zp_e",
"strategy_id": "IMgszSAVzapxSQCbYZC--",
"type": "market",
"action": "buy",
"stop_price": null,
"price": null,
"amount": "0.000010000000000",
"total": null,
"created_at": "2026-04-08T13:46:23.606Z",
"stock_id": "yv4fbstPFFxgngHWPwnNq",
"figi_composite": "BBG000BDTBL9",
"symbol": "SPY",
"name": "State Street SPDR S&P 500 ETF Trust",
"sector": "Exchange Traded Fund",
"security": "stock",
"exchange": "ARCX",
"stock": "SPY",
"peg": "USD",
"provider": "massive",
"slippage": "0.000000000000000",
"fee": "0.000000000000000",
"links": {},
"stock_status": "active",
"bid": "675.53",
"ask": "675.53",
"last": "675.18",
"order_dependencies": []
}
]
}
][
{
"event": "wsPositions",
"channel": "wsPositions:IMgszSAVzapxSQCbYZC--",
"response": [
{
"position_id": "biwu829fLOSI2enaRVuIx",
"strategy_id": "IMgszSAVzapxSQCbYZC--",
"type": "asset",
"price": "1.000000000000000",
"amount": "0.993242800000000",
"total": "0.993242800000000",
"updated_at": "2026-04-08T13:46:24.908Z",
"created_at": "2026-04-08T13:46:24.908Z",
"stock_id": "ubfhvYUsgvMIuJPwr76My",
"figi_composite": null,
"symbol": "USD",
"name": "US Dollar",
"sector": "Unallocated",
"security": "",
"exchange": "ALPHAINSIDER",
"stock": "USD",
"peg": "USD",
"provider": "alphainsider",
"slippage": "0.000000000000000",
"fee": "0.000000000000000",
"links": {},
"stock_status": "active",
"bid": "1.00",
"ask": "1.00",
"last": "1.00"
},
{
"position_id": "mfx507iaGBpuNkgYi_Oob",
"strategy_id": "IMgszSAVzapxSQCbYZC--",
"type": "asset",
"price": "675.720000000000000",
"amount": "0.000010000000000",
"total": "0.006757200000000",
"updated_at": "2026-04-08T13:46:24.908Z",
"created_at": "2026-04-08T13:46:24.908Z",
"stock_id": "yv4fbstPFFxgngHWPwnNq",
"figi_composite": "BBG000BDTBL9",
"symbol": "SPY",
"name": "State Street SPDR S&P 500 ETF Trust",
"sector": "Exchange Traded Fund",
"security": "stock",
"exchange": "ARCX",
"stock": "SPY",
"peg": "USD",
"provider": "massive",
"slippage": "0.000000000000000",
"fee": "0.000000000000000",
"links": {},
"stock_status": "active",
"bid": "675.73",
"ask": "675.73",
"last": "675.19"
}
]
}
][
{
"event": "wsTimelines",
"channel": "wsTimelines:IMgszSAVzapxSQCbYZC--",
"response": {
"timeline_id": "1",
"created_at": "2026-04-08T13:46:24.908Z",
"strategy_id": "IMgszSAVzapxSQCbYZC--",
"name": "test stocks",
"user_id": "user_1",
"likes": "0",
"liked": false,
"type": "trade",
"data": {
"history_id": "hdyS4tHfSXV3fOVaDNRPV",
"action": "buy",
"price": "675.720000000000000",
"amount": "0.000010000000000",
"fee_total": "0.000000000000000",
"total": "0.006757200000000",
"new_holdings": "0.000010000000000",
"strategy_value": "1.000000000000000",
"stock_id": "yv4fbstPFFxgngHWPwnNq",
"figi_composite": "BBG000BDTBL9",
"symbol": "SPY",
"name": "State Street SPDR S&P 500 ETF Trust",
"sector": "Exchange Traded Fund",
"security": "stock",
"exchange": "ARCX",
"stock": "SPY",
"peg": "USD",
"provider": "massive",
"slippage": "0.000000000000000",
"fee": "0.000000000000000",
"links": {},
"stock_status": "active"
}
}
}
][
{
"event": "wsBotStatus",
"channel": "wsBotStatus:FSGV8HoplnWqotw5upiyV",
"response": {
"bot_id": "FSGV8HoplnWqotw5upiyV",
"status": "on"
}
}
][
{
"event": "wsBotAllocations",
"channel": "wsBotAllocations:FSGV8HoplnWqotw5upiyV",
"response": [
{
"bot_allocation_id": "FLyLk7XLHW31SXZSMq1uS",
"bot_id": "FSGV8HoplnWqotw5upiyV",
"strategy_id": "IMgszSAVzapxSQCbYZC--",
"percent": "0.8000000480005932873330314362685522793061722242886922082356937931",
"strategy_value": "0.9999877",
"positions": [
{
"position_id": "biwu829fLOSI2enaRVuIx",
"strategy_id": "IMgszSAVzapxSQCbYZC--",
"type": "asset",
"price": "1.000000000000000",
"amount": "0.993242800000000",
"total": "0.993242800000000",
"updated_at": "2026-04-08T13:46:24.908Z",
"created_at": "2026-04-08T13:46:24.908Z",
"stock_id": "ubfhvYUsgvMIuJPwr76My",
"figi_composite": null,
"symbol": "USD",
"name": "US Dollar",
"sector": "Unallocated",
"security": "",
"exchange": "ALPHAINSIDER",
"stock": "USD",
"peg": "USD",
"provider": "alphainsider",
"slippage": "0.000000000000000",
"fee": "0.000000000000000",
"links": {},
"stock_status": "active",
"bid": "1.00",
"ask": "1.00",
"last": "1.00"
},
{
"position_id": "mfx507iaGBpuNkgYi_Oob",
"strategy_id": "IMgszSAVzapxSQCbYZC--",
"type": "asset",
"price": "675.720000000000000",
"amount": "0.000010000000000",
"total": "0.006757200000000",
"updated_at": "2026-04-08T13:46:24.908Z",
"created_at": "2026-04-08T13:46:24.908Z",
"stock_id": "yv4fbstPFFxgngHWPwnNq",
"figi_composite": "BBG000BDTBL9",
"symbol": "SPY",
"name": "State Street SPDR S&P 500 ETF Trust",
"sector": "Exchange Traded Fund",
"security": "stock",
"exchange": "ARCX",
"stock": "SPY",
"peg": "USD",
"provider": "massive",
"slippage": "0.000000000000000",
"fee": "0.000000000000000",
"links": {},
"stock_status": "active",
"bid": "674.49",
"ask": "674.53",
"last": "674.2"
}
],
"updated_at": "2026-04-08T13:57:12.784Z",
"created_at": "2026-04-08T13:57:12.784Z"
}
]
}
][
{
"event": "wsBotActivities",
"channel": "wsBotActivities:FSGV8HoplnWqotw5upiyV",
"response": {
"bot_activity_id": "2h0-0OBMXOcl5wjkoGjKf",
"bot_id": "FSGV8HoplnWqotw5upiyV",
"type": "start",
"message": "Bot started.",
"created_at": "2026-04-08T13:51:31.553Z"
}
}
]Subscribe
Subscribe to real-time updates from AlphaInsider.
wss://alphainsider.com/ws and send a subscription with the complete list of channels you want to receive. Each subscription replaces the previous list. Wait for the server to acknowledge the requested channels before treating the connection as subscribed.Send ping about every 30 seconds to keep the connection alive; the server responds with pong. After a connection loss, reconnect and subscribe again. Fix authentication or channel errors before retrying. Refresh current values through REST if you need to recover updates missed during the interruption.Strategy values and quantities follow the trading calculations. Broker values follow the bot calculations.
"ping"{
"event": "subscribe",
"payload": {
"channels": [
"wsStockPrice:<STOCK_ID>",
"wsStrategyValue:<STRATEGY_ID>",
"wsOrders:<STRATEGY_ID>",
"wsPositions:<STRATEGY_ID>",
"wsTimelines:<STRATEGY_ID>",
"wsBotStatus:<BOT_ID>",
"wsBotAllocations:<BOT_ID>",
"wsBotActivities:<BOT_ID>"
],
"token": "<API_TOKEN>"
}
}"pong"[
{
"event": "subscribe",
"channel": "wsStockPrice:64diisPJwIqt99jyjoIGT",
"response": "Subscribed to channel."
}
][
{
"event": "error",
"response": "Request failed."
},
{
"event": "error",
"response": "Authentication failed."
},
{
"event": "error",
"channel": "wsStockPrice:64diisPJwIqt99jyjoIGT",
"response": "Failed to subscribe to channel."
},
{
"event": "error",
"channel": "wsStockPrice:64diisPJwIqt99jyjoIGT",
"response": "Channel closed."
}
][
{
"event": "wsStockPrice",
"channel": "wsStockPrice:yv4fbstPFFxgngHWPwnNq",
"response": {
"stock_id": "yv4fbstPFFxgngHWPwnNq",
"bid": "675.59",
"ask": "675.59",
"last": "675.18"
}
}
][
{
"event": "wsStrategyValue",
"channel": "wsStrategyValue:IMgszSAVzapxSQCbYZC--",
"response": {
"strategy_id": "IMgszSAVzapxSQCbYZC--",
"strategy_value": "0.99998930000000000"
}
}
][
{
"event": "wsOrders",
"channel": "wsOrders:IMgszSAVzapxSQCbYZC--",
"response": [
{
"order_id": "i9wtRL8_CsiT9krl1Zp_e",
"strategy_id": "IMgszSAVzapxSQCbYZC--",
"type": "market",
"action": "buy",
"stop_price": null,
"price": null,
"amount": "0.000010000000000",
"total": null,
"created_at": "2026-04-08T13:46:23.606Z",
"stock_id": "yv4fbstPFFxgngHWPwnNq",
"figi_composite": "BBG000BDTBL9",
"symbol": "SPY",
"name": "State Street SPDR S&P 500 ETF Trust",
"sector": "Exchange Traded Fund",
"security": "stock",
"exchange": "ARCX",
"stock": "SPY",
"peg": "USD",
"provider": "massive",
"slippage": "0.000000000000000",
"fee": "0.000000000000000",
"links": {},
"stock_status": "active",
"bid": "675.53",
"ask": "675.53",
"last": "675.18",
"order_dependencies": []
}
]
}
][
{
"event": "wsPositions",
"channel": "wsPositions:IMgszSAVzapxSQCbYZC--",
"response": [
{
"position_id": "biwu829fLOSI2enaRVuIx",
"strategy_id": "IMgszSAVzapxSQCbYZC--",
"type": "asset",
"price": "1.000000000000000",
"amount": "0.993242800000000",
"total": "0.993242800000000",
"updated_at": "2026-04-08T13:46:24.908Z",
"created_at": "2026-04-08T13:46:24.908Z",
"stock_id": "ubfhvYUsgvMIuJPwr76My",
"figi_composite": null,
"symbol": "USD",
"name": "US Dollar",
"sector": "Unallocated",
"security": "",
"exchange": "ALPHAINSIDER",
"stock": "USD",
"peg": "USD",
"provider": "alphainsider",
"slippage": "0.000000000000000",
"fee": "0.000000000000000",
"links": {},
"stock_status": "active",
"bid": "1.00",
"ask": "1.00",
"last": "1.00"
},
{
"position_id": "mfx507iaGBpuNkgYi_Oob",
"strategy_id": "IMgszSAVzapxSQCbYZC--",
"type": "asset",
"price": "675.720000000000000",
"amount": "0.000010000000000",
"total": "0.006757200000000",
"updated_at": "2026-04-08T13:46:24.908Z",
"created_at": "2026-04-08T13:46:24.908Z",
"stock_id": "yv4fbstPFFxgngHWPwnNq",
"figi_composite": "BBG000BDTBL9",
"symbol": "SPY",
"name": "State Street SPDR S&P 500 ETF Trust",
"sector": "Exchange Traded Fund",
"security": "stock",
"exchange": "ARCX",
"stock": "SPY",
"peg": "USD",
"provider": "massive",
"slippage": "0.000000000000000",
"fee": "0.000000000000000",
"links": {},
"stock_status": "active",
"bid": "675.73",
"ask": "675.73",
"last": "675.19"
}
]
}
][
{
"event": "wsTimelines",
"channel": "wsTimelines:IMgszSAVzapxSQCbYZC--",
"response": {
"timeline_id": "1",
"created_at": "2026-04-08T13:46:24.908Z",
"strategy_id": "IMgszSAVzapxSQCbYZC--",
"name": "test stocks",
"user_id": "user_1",
"likes": "0",
"liked": false,
"type": "trade",
"data": {
"history_id": "hdyS4tHfSXV3fOVaDNRPV",
"action": "buy",
"price": "675.720000000000000",
"amount": "0.000010000000000",
"fee_total": "0.000000000000000",
"total": "0.006757200000000",
"new_holdings": "0.000010000000000",
"strategy_value": "1.000000000000000",
"stock_id": "yv4fbstPFFxgngHWPwnNq",
"figi_composite": "BBG000BDTBL9",
"symbol": "SPY",
"name": "State Street SPDR S&P 500 ETF Trust",
"sector": "Exchange Traded Fund",
"security": "stock",
"exchange": "ARCX",
"stock": "SPY",
"peg": "USD",
"provider": "massive",
"slippage": "0.000000000000000",
"fee": "0.000000000000000",
"links": {},
"stock_status": "active"
}
}
}
][
{
"event": "wsBotStatus",
"channel": "wsBotStatus:FSGV8HoplnWqotw5upiyV",
"response": {
"bot_id": "FSGV8HoplnWqotw5upiyV",
"status": "on"
}
}
][
{
"event": "wsBotAllocations",
"channel": "wsBotAllocations:FSGV8HoplnWqotw5upiyV",
"response": [
{
"bot_allocation_id": "FLyLk7XLHW31SXZSMq1uS",
"bot_id": "FSGV8HoplnWqotw5upiyV",
"strategy_id": "IMgszSAVzapxSQCbYZC--",
"percent": "0.8000000480005932873330314362685522793061722242886922082356937931",
"strategy_value": "0.9999877",
"positions": [
{
"position_id": "biwu829fLOSI2enaRVuIx",
"strategy_id": "IMgszSAVzapxSQCbYZC--",
"type": "asset",
"price": "1.000000000000000",
"amount": "0.993242800000000",
"total": "0.993242800000000",
"updated_at": "2026-04-08T13:46:24.908Z",
"created_at": "2026-04-08T13:46:24.908Z",
"stock_id": "ubfhvYUsgvMIuJPwr76My",
"figi_composite": null,
"symbol": "USD",
"name": "US Dollar",
"sector": "Unallocated",
"security": "",
"exchange": "ALPHAINSIDER",
"stock": "USD",
"peg": "USD",
"provider": "alphainsider",
"slippage": "0.000000000000000",
"fee": "0.000000000000000",
"links": {},
"stock_status": "active",
"bid": "1.00",
"ask": "1.00",
"last": "1.00"
},
{
"position_id": "mfx507iaGBpuNkgYi_Oob",
"strategy_id": "IMgszSAVzapxSQCbYZC--",
"type": "asset",
"price": "675.720000000000000",
"amount": "0.000010000000000",
"total": "0.006757200000000",
"updated_at": "2026-04-08T13:46:24.908Z",
"created_at": "2026-04-08T13:46:24.908Z",
"stock_id": "yv4fbstPFFxgngHWPwnNq",
"figi_composite": "BBG000BDTBL9",
"symbol": "SPY",
"name": "State Street SPDR S&P 500 ETF Trust",
"sector": "Exchange Traded Fund",
"security": "stock",
"exchange": "ARCX",
"stock": "SPY",
"peg": "USD",
"provider": "massive",
"slippage": "0.000000000000000",
"fee": "0.000000000000000",
"links": {},
"stock_status": "active",
"bid": "674.49",
"ask": "674.53",
"last": "674.2"
}
],
"updated_at": "2026-04-08T13:57:12.784Z",
"created_at": "2026-04-08T13:57:12.784Z"
}
]
}
][
{
"event": "wsBotActivities",
"channel": "wsBotActivities:FSGV8HoplnWqotw5upiyV",
"response": {
"bot_activity_id": "2h0-0OBMXOcl5wjkoGjKf",
"bot_id": "FSGV8HoplnWqotw5upiyV",
"type": "start",
"message": "Bot started.",
"created_at": "2026-04-08T13:51:31.553Z"
}
}
]Send ping about every 30 seconds to keep the connection alive.
Subscribe to one or more channels. Each request replaces the complete previous subscription list.
Server heartbeat response to a client ping.
Confirms a successful channel subscription.
Reports a server or channel error. Reconnect after recoverable errors; correct authentication or invalid channel settings before retrying those failures.
Stock prices update every second. Use an internal stock ID or STOCK:EXCHANGE, such as AAPL:XNAS. Find IDs with searchStocks or getAllStocks.
Normalized strategy values update every 5 seconds.
Open-order updates sent as changes occur. Removal can mean execution or cancellation; it does not establish a fill by itself.
Strategy position updates sent as changes occur.
Strategy timeline events sent as they occur.
Bot execution status updates sent as changes occur.
Performance-adjusted bot allocation weights sent as changes occur. Nested strategy positions remain normalized.
Bot activity events sent as they occur.