Timebase WebSocket API build on “classic” websocket protocol
according to RFC
6455
Timebase WebSockets API allows receiving historical data with real-time
updates.
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.
name | path |
---|---|
[WSController] | /ws/v0/{streamId}/select |
[WSController] | /ws/v0/select |
Returns messages ordered by time from the specified stream according to the specified options.
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 |
media type | data type | description |
---|---|---|
application/json | array of data rows | List of rows. |
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"
}]
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.
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 |
media type | data type | description |
---|---|---|
application/json | Array of data rows | List of rows. |
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"
}]
Select one day of data
/ws/v0/GDAX/select?from=2018-06-28T00:00:00.000Z&to=2018-06-28T23:59:59.999Z
Subcribe to live updates
/ws/v0/GDAX/select?from=2018-07-11T00:00:00.000Z&live=true
Subcribe to several streams
/ws/v0/select?streams=GDAX,BITFINEX&from=2018-07-11T00:00:00.000Z
Subcribe to several streams with specific message type
/ws/v0/select?streams=GDAX,BITFINEX&from=2018-07-11T00:00:00.000Z&types=deltix.timebase.api.messages.universal.PackageHeader