Need help with your APIs? I offer API discovery, governance & evangelism services. Explore services →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

Kraken Spot WebSocket API v2

Real-time market data and private user data over WebSocket v2 using subscribe/unsubscribe semantics. Public channels include ticker (L1), book (L2), trade, ohlc, instrument, and admin frames (status, heartbeat, ping/pong). Authenticated channels include executions and balances. Trading methods include add_order, amend_order, edit_order, cancel_order, cancel_all, cancel_on_disconnect, batch_add, and batch_cancel. The authenticated endpoint requires a token obtained from the Spot REST GetWebSocketsToken operation.

This event API exposes 12 operations across 6 channels, and defines 45 schemas. It is described by AsyncAPI 2.6.0, at version 2.0.0.

The API connects through 2 servers: ws.kraken.com/v2 (wss), ws-auth.kraken.com/v2 (wss).

12 operations 6 channels 45 schemas

Metadata

The identity and technical contract details declared by the specification.

Specification
AsyncAPI 2.6.0
API Version
2.0.0
Base URL
wss://ws.kraken.com/v2
Resource Areas
1

Channels & Operations 12

Across 6 channels, the API surfaces 12 operations. Each is listed below with its action, channel, parameters, and response codes.

Channels 12
SUB
ticker
Receive ticker snapshot and updates from the server.
body
PUB
ticker
Subscribe or unsubscribe from the ticker channel.
body
SUB
book
Receive book snapshot and update messages.
body
PUB
book
Subscribe or unsubscribe from the book channel.
body
SUB
ohlc
Receive OHLC snapshot and update messages.
body
PUB
ohlc
Subscribe or unsubscribe from the ohlc channel.
body
SUB
trade
Receive trade snapshot and update messages.
body
PUB
trade
Subscribe or unsubscribe from the trade channel.
body
SUB
instrument
Receive instrument snapshot and update messages.
body
PUB
instrument
Subscribe or unsubscribe from the instrument channel.
body
SUB
ping
Receive pong response from the server.
body
PUB
ping
Send a ping to the server.
body

Messages & Schemas 45

The contract defines 45 schemas that model the data carried by its messages. The most detailed are Pair (16 properties), Ticker (12 properties), Candle (10 properties), Asset (8 properties). Each schema is shown below with its type and property counts.

SubscribeTicker
message
UnsubscribeTicker
message
TickerMessage
message
SubscribeBook
message
UnsubscribeBook
message
BookMessage
message
SubscribeOHLC
message
UnsubscribeOHLC
message
OHLCMessage
message
SubscribeTrade
message
UnsubscribeTrade
message
TradeMessage
message
SubscribeInstrument
message
UnsubscribeInstrument
message
InstrumentMessage
message
SubscriptionStatus
message
Ping
message
Pong
message
SubscribeRequestBase
object
2 properties 2 required
UnsubscribeRequestBase
object
2 properties 2 required
SubscriptionStatusResponse
object
Standard server acknowledgement for subscribe/unsubscribe requests.
8 properties
SubscribeTickerRequest
object
UnsubscribeTickerRequest
object
TickerEnvelope
object
3 properties 3 required
Ticker
object
12 properties
SubscribeBookRequest
object
UnsubscribeBookRequest
object
BookEnvelope
object
3 properties 3 required
BookData
object
5 properties
PriceLevel
object
2 properties
SubscribeOHLCRequest
object
UnsubscribeOHLCRequest
object
OHLCEnvelope
object
3 properties 3 required
Candle
object
10 properties
SubscribeTradeRequest
object
UnsubscribeTradeRequest
object
TradeEnvelope
object
3 properties 3 required
Trade
object
7 properties
SubscribeInstrumentRequest
object
UnsubscribeInstrumentRequest
object
InstrumentEnvelope
object
3 properties 3 required
Asset
object
8 properties
Pair
object
16 properties
PingRequest
object
2 properties 1 required
PongResponse
object
8 properties 1 required

Specification

The full machine-readable AsyncAPI contract behind this narrative.

Source

kraken-asyncapi.yml Raw ↑