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 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 creating an API key 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 to Connect to Public WebSocket Server


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

How to 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 to Get Ticker from REST API


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

REST API Methods

Public Endpoints

Method Arguments Description
GetSystemStatus Get current system status.

Private Endpoints

Method Arguments Description
GetExtendedBalance Get extended balance information.
AmendOrder Amend an existing order.
CancelAllOrders Cancel all open orders.
CancelAllOrdersAfter Dead man's switch - cancel all orders after timeout.
EditOrder Edit an existing order.
AddOrderBatch Batch add multiple orders.
CancelOrderBatch Batch cancel multiple orders.
GetWithdrawalMethods Get available withdrawal methods.
GetWithdrawalAddresses Get withdrawal addresses.

How to 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());