Subscribe
REQUESTwss://wss.prime.kraken.com/ws/v1
subscribe
Send a subscription request to begin a stream of data. An example request that subscribes to data.
Request
- Request Schema
- Example
Request ID - will be echoed back in the response structure.
subscribeRequest type for initializing a subscription.
Optional user generated tag to attach to stream data.
Streams to subscribe to.
Subscription name (e.g., "Security", "MarketDataSnapshot", "ExecutionReport").
Any required or optional parameters described for the subscription names.
An ISO-8601 UTC string of the form 2019-02-13T05:17:32.000000Z.
{
"reqid": 1,
"type": "subscribe",
"streams": [
{
"name": "MarketDataSnapshot",
"Symbol": "BTC-USD"
}
],
"ts": "2019-02-13T05:17:32.000000Z"
}
Response
- Response Schema
- Example
A number that relates this response to a request.
The sequence number for this response per request. seqNum begins at 1 on the first message with this reqid and increments by one for each message sent on this reqid.
The type of message sent. This document describes all valid message types.
An optional tag from the stream request.
An ISO-8601 UTC string of the form 2019-02-13T05:17:32.000000Z.
If this is initial data for a request, the initial flag will be set.
"Update" or "Remove" - tells the client if the given entity should be removed or added/updated.
The total number of records for this stream.
Array of response data structured per subscription type.
If paging, tag for next page of data.
{
"reqid": 1,
"seqNum": 1,
"type": "MarketDataSnapshot",
"action": "Update",
"data": [
{
"Symbol": "BTC-USD",
"Status": "Online",
"Bids": [
{
"Price": "46817.27965000",
"Size": "1.00000000"
}
],
"Offers": [
{
"Price": "46868.59755873",
"Size": "1.00000000"
}
]
}
],
"ts": "2019-02-13T05:17:32.000000Z"
}
Notes
reqidcannot be equal to 0.seqNumis for debug purposes only, the client is not required to do any sequencing.- If a request requires responses with different types, then multiple responses may have the
initialflag set for different types. actionis eitherUpdateorRemoveand tells the client if the given entity should be removed or added/updated. The key for a given entity depends on the message type.