API Kraken

Kraken

 

Overview

WebSockets API offers real-time market data updates. WebSockets is a bidirectional protocol offering fastest real-time data, helping you build real-time applications. The public message types presented below do not require authentication. Private-data messages messages can be subscribed on a separate authenticated endpoint.

 

Kraken offers a REST API too with Public market data and Private user data (which requires an authentication).

 

Configuration

 

Private API requires to get create an API from your Kraken account.

Kraken allows Test environment on WebSocket protocol, enable Beta property from Kraken Property to use this beta feature.

APIs supported

 

 

 

Kraken Examples

How Connect to Public WebSocket Server


oClient := TsgcWebSocketClient.Create(nil);
oKraken := TsgcWSAPI_Kraken.Create(nil);
oKraken.Client := oClient;
oClient.Active := True;

How Connect to Private WebSocket Server


oClient := TsgcWebSocketClient.Create(nil);
oKraken := TsgcWSAPI_Kraken.Create(nil);
oKraken.Kraken.ApiKey := 'your api key';
oKraken.Kraken.ApiSecret := 'your api secret';
oKraken.Client := oClient;
oClient.Active := True;

How Get Ticker from REST API


oClient := TsgcWebSocketClient.Create(nil);
oKraken := TsgcWSAPI_Kraken.Create(nil);
oKraken.Client := oClient;
ShowMessage(oKraken.GetTicker(['XBTUSD']));

How Get Account Balance from REST API


oClient := TsgcWebSocketClient.Create(nil);
oKraken := TsgcWSAPI_Kraken.Create(nil);
oKraken.Kraken.ApiKey := 'your api key';
oKraken.Kraken.ApiSecret := 'your api secret';
oKraken.Client := oClient;
ShowMessage(oKraken.GetAccountBalance());