| Product

New version of Kraken WebSockets Public API goes live May 30!

Update: The new version is now live!

The original release of the Kraken WebSockets Public API was a huge success. Thousands of clients have already connected for fast and easy access to Kraken’s market data. Clients still using our REST API for public market data should consider switching and can get started with our documentation here: https://www.kraken.com/features/websocket-api

We are making several enhancements to the initial release that are scheduled to go live May 30.

Try out the enhancements now
The enhancements are already live in our beta environment – to make sure your code works with the new API and you are ready to go on May 30, we highly recommend that all clients currently using the API try out the changes as soon as possible.

Beta documentation: https://www.kraken.com/features/websocket-api-beta
Beta environment: ws-beta.kraken.com

Summary of enhancements

Enhancement 1
Two new string-type parameters channelName (designating the subscription Channel Name) and pair (designating the asset pair) are added to the messages ticker, ohlc, spread, trade, and book. This makes it easier to identify message payloads when streaming real-time data for multiple pairs and channels. These parameters are added near the end of the payload as illustrated in the example below, however the documentation currently shows them near the beginning (this will be corrected with a site update on May 30).

Enhancement 2
Two new float-type parameters bidVolume and askVolume are added to the spread message payload. Note that these parameters are also added near the end of the payload as the example shows (the originally published example showed them earlier in the payload).

Enhancement 3
The ticker message provides an initial snapshot upon subscription showing the last ticker.

Example payload (illustrating enhancements 1 and 2)

[3,				channelID


  “5150.20000",			bid

  “5151.90000",			ask

  “1556560666.327763"		timestamp

  “1.26089615”,			bidVolume

  “0.00187810”,			askVolume


“spread”,			channelName

“XBT/USD”,			pair



Enhancement 4 (Minor)
The order book feed includes an additional field when price levels are pulled into scope by another price level being deleted (also known as a border republish). The additional field is r and is the fourth and final field of the insert message. Only insert messages that are a republish are affected, so regular inserts, updates, and deletes do not have the additional field.




Kraken also offers a WebSockets API for other products in the Kraken family, including Kraken Futures and CryptoWatch. Follow the links below for the API documentation.

Kraken Futures (cryptofacilities.com): https://www.cryptofacilities.com/resources/hc/categories/115000132213-API

CryptoWatch (in beta testing phase): https://cryptowat.ch/docs/websocket-api