Skip to content
Sign up

Server-sent events

Stream a market

Trades, the book and the price of one instrument, pushed over a plain HTTP connection: made for browsers and dashboards.

GET/api/v1/markets/stream
curl --no-buffer \
  --url "https://reirex.com/api/v1/markets/stream?symbol=BTC" \
  --header "Accept: text/event-stream"

200 OKtext/event-stream

data: {"type": "trade", "trade": {"id": "BTC-1791994457757-5747", "t": 1791994457757, "price": 72766, "amount": 0.000745603, "side": "sell"}}

data: {"type": "quote", "price": 72765.5, "change24h": -1, "updatedAt": "2026-10-14T16:14:15.412Z"}

data: {"type": "trade", "trade": {"id": "BTC-1791994457820-5748", "t": 1791994457820, "price": 72767, "amount": 0.00214185, "side": "buy"}}

Each event is one JSON object with a type: trade for a trade, book for the order book, quote for the price. A comment line arrives every 15 seconds to keep the connection open, and browsers reconnect by themselves if it drops.

Press Try it to watch Bitcoin trade live.

Query parameters

  • symbolstringrequired

    The instrument's symbol, such as BTC, ASML, EURUSD or XAU.

Response

  • typestring

    trade, book or quote.

  • tradeobject

    On trade events: the trade.

  • bookobject

    On book events: the order book.

  • pricenumber

    On quote events: the latest price.

  • change24hnumber

    On quote events: the change over 24 hours, in percent.

  • updatedAtstring

    On quote events: when the price changed.