Timebase WebSocket API


Overview

Timebase WebSocket API build on “classic” websocket protocol according to RFC 6455
Timebase WebSockets API allows receiving historical data with real-time updates.

General Considerations

All messages sent and received via WebSockets are encoded in JSON format.
All messages have a '$type' field that can be used to handle the message appropriately.
All decimal fields (including timestamps) are quoted to preserve precision.
Timestamps fields represent UTC time with milliseconds precision.
Historical messages ordered by 'timestamp' field, but real-time messages recieved 'as is'
Websocket endpoints allows to specify additional selection parameters.
Websocket endpoints require authentication accoring to Web Administrator configuration
Recommended reconnection behaviour is to 
   (1) attempt reconnection instantly up to a handful of times if the websocket is dropped randomly during normal operation but 
   (2) after maintenance or extended downtime, attempt to reconnect no more quickly than once every 5 seconds.


Resources


name path
[WSController] /ws/v0/{streamId}/select
[WSController] /ws/v0/select

/ws/v0/{streamId}/select

Returns messages ordered by time from the specified stream according to the specified options.


Request Parameters

name type description constraints example
from header Query start time (if not specified, will be used stream start time) optional 2018-06-28T09:30:00.000Z
to header Query end time (if not specified, will be used stream start time) optional 2018-07-10T00:00:00.000Z
types header Specified message types to be subscribed. If undefined, then all stream types will be subscribed. optional deltix.timebase.api.messages.universal.PackageHeader
symbols header Specified instruments (symbols) to be subscribed. If undefined, then all stream instruments will be subscribed. optional BTCEUR,ETHEUR
live header Ability to receive live updates optional true or false

Response Body

media type data type description
application/json array of data rows List of rows.

Example

Request:

SEND
destination:/ws/v0/GDAX/select
from:2018-06-28T02:54:14.670Z
symbols:BTCEUR,ETHEUR

Response:

MESSAGE
status:200
destination:/user/v1/responses
content-type:application/json;charset=UTF-8
content-length:4916

[{
  "symbol":"BTCEUR",
  "timestamp":"2018-06-28T02:54:14.670",
  "entries":
    [{
      "type":"L2EntryUpdate",
      "price":81.17,
      "size":40,
      "action":"UPDATE",
      "level":18,
      "side":"ASK"
    }],
  "packageType":"INCREMENTAL_UPDATE"
}]


/ws/v0/select

Return messages ordered by time from the specified streams according to the specified options. This endpoint is intended for streaming multiple streams at once, merged by time.


Request Parameters

name type description constraints example
streams header Specified list of streams to be subscribed. required GDAX,BITFINEX
from header Query start time. optional 2018-06-28T09:30:00.000Z
to header Query end time. optional 2018-07-10T00:00:00.000Z
types header Specified message types to be subscribed. If undefined, then all stream types will be subscribed. optional deltix.timebase.api.messages.universal.PackageHeader
symbols header Specified instruments (symbols) to be subscribed. If undefined, then all stream instruments will be subscribed. optional BTCEUR,ETHEUR
live header Ability to receive live updates optional true or false

Response Body

media type data type description
application/json Array of data rows List of rows.

Example

Request:

SEND
destination:/ws/v0/select
streams:GDAX,BITFINEX
from:2018-06-28T02:54:14.670Z
symbols:BTCEUR,ETHEUR

Response:

MESSAGE
status:200
destination:/ws/v0/select
content-type:application/json;charset=UTF-8
content-length:4916

[{
  "symbol":"BTCEUR",
  "timestamp":"2018-06-28T02:54:14.670Z",
  "entries":
    [{
      "type":"L2EntryUpdate",
      "price":81.17,
      "size":40,
      "action":"UPDATE",
      "level":18,
      "side":"ASK"
    }],
  "packageType":"INCREMENTAL_UPDATE"
}]

Additional Subscription Examples