POST
https://prv.gateway.indexer.biya.io
/
injective_spot_exchange_rpc.InjectiveSpotExchangeRPC
/
StreamMarkets
StreamMarkets
curl --request POST \
  --url https://prv.gateway.indexer.biya.io/injective_spot_exchange_rpc.InjectiveSpotExchangeRPC/StreamMarkets \
  --header 'Content-Type: application/json' \
  --data '
{
  "market_ids": [
    {}
  ]
}
'
Stream live updates of selected spot markets. This is a server-side streaming endpoint that continuously sends market updates.
This is a streaming endpoint that requires WebSocket or Server-Sent Events support. The connection will remain open and receive updates in real-time.
market_ids
array
List of market IDs for updates streaming. Empty array means ‘ALL’ spot markets (optional)

Response

The response is a stream of StreamMarketsResponse objects:
{
  "market": {
    "market_id": "string",
    "market_status": "string",
    "ticker": "string",
    "base_denom": "string",
    "quote_denom": "string",
    ...
  },
  "operation_type": "string",
  "timestamp": "number"
}

cURL Example

gRPC-Web streaming endpoints require WebSocket support. Standard curl cannot handle streaming responses. Use one of the following approaches:
Using grpcurl (if gRPC-Web is supported):
grpcurl -plaintext -d '{"market_ids": ["0x..."]}' \
  localhost:8088 \
  injective_spot_exchange_rpc.InjectiveSpotExchangeRPC/StreamMarkets
Using WebSocket client (JavaScript):
const ws = new WebSocket('ws://localhost:8088/injective_spot_exchange_rpc.InjectiveSpotExchangeRPC/StreamMarkets');
ws.onopen = () => {
  ws.send(JSON.stringify({ market_ids: ["0x..."] }));
};
ws.onmessage = (event) => {
  console.log('Received:', JSON.parse(event.data));
};
Using curl with WebSocket (requires websocat or similar tool):
# Install websocat first: cargo install websocat
echo '{"market_ids": ["0x..."]}' | websocat ws://localhost:8088/injective_spot_exchange_rpc.InjectiveSpotExchangeRPC/StreamMarkets
Using wscat (Node.js WebSocket client):
# Install wscat: npm install -g wscat
wscat -c ws://localhost:8088/injective_spot_exchange_rpc.InjectiveSpotExchangeRPC/StreamMarkets
# Then send: {"market_ids": ["0x..."]}