Skip to main content
GET
TypeScript

Authorizations

Authorization
string
header
required

The Venue key (trdrs_vk_sandbox_… or trdrs_vk_production_…), in preview. It belongs to one venue in one environment and carries the scopes it was created with. The venue's verified owner creates it while signed in. It works on the /api/venues/{venueId} routes and, with trader:read or trader:trade, on the account, market, trading and Connect routes, reading the venue's own traders' accounts and Connect, routing their orders and connecting their own accounts, each request naming its trader in x-trdrs-trader. A trdrs_sk_… key can't be used in its place. It reaches its venue's routes and its venue's own traders, and the owner manages keys from a signed-in session. Keep it on your server.

Path Parameters

venueId
string<uuid>
required

Query Parameters

instruments
string
required

The markets, by instrument id, comma separated: 1 to 50 on your menu.

timeframe
enum<string>

The bars to stream. Without it the stream sends quotes alone.

Available options:
1m,
5m,
15m,
1h,
4h,
1d

Response

An open event stream. Each event's name is its event: line, and its data: line is the body.

  • quote { instrumentId, status, unpriced, book, last }: a market's price now, as the markets read states it.
  • bar { instrumentId, timeframe, bar }: a market's bar at the stream's timeframe, bar shaped as the bars read states it.
  • heartbeat {}: sent while the stream is open.
  • error { code }: the stream is ending. session_expired: your sign-in, your key or your access to the venue ended.

A dropped connection carries no event, and the browser reconnects on its own.

The stream may end with a reconnect event, { code, afterMs }: the engine serving it is restarting for a release, or the trader it serves moved to another engine, and the stream closes right after the event. code is engine_draining. Open the stream again after afterMs milliseconds, which is never more than 1,000: another engine serves it, and it opens as any connection does. It is not an error, so keep what you show until the new stream's first events arrive. The event sets the stream's retry: to afterMs too, so an EventSource that reconnects on its own follows it.

The response is of type string.