Kraken API
Kraken WebSocket v2 and REST client — public market-data plus authenticated account, order and balance streams.
Kraken WebSocket v2 and REST client — public market-data plus authenticated account, order and balance streams.
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.
TsgcWSAPI_Kraken| Standards & specs | Kraken WebSocket v2 API · Kraken REST API |
| Component class | TsgcWSAPI_Kraken (unit sgcWebSocket_API_Kraken) |
| Frameworks | VCL, FireMonkey, Lazarus / FPC, .NET |
| Platforms | Windows, macOS, Linux, iOS, Android |
The principal published / public properties used to configure and drive the component. Consult the online help for the full list.
Client | Published or public property used to configure or query the component. |
OnKrakenSubscribed | Published or public property used to configure or query the component. |
OnKrakenUnSubscribed | Published or public property used to configure or query the component. |
OnConnect | Published or public property used to configure or query the component. |
OnKrakenConnect | Published or public property used to configure or query the component. |
OnKrakenSystemStatus | Published or public property used to configure or query the component. |
OnKrakenSubscriptionError | Published or public property used to configure or query the component. |
OnKrakenData | Published or public property used to configure or query the component. |
OnDisconnect | Published or public property used to configure or query the component. |
OnKrakenHTTPException | Published or public property used to configure or query the component. |
The principal public methods exposed by the component.
SubscribeTrade() | Public procedure exposed by the component. |
UnSubscribeTrade() | Public procedure exposed by the component. |
SubscribeOwnTrades() | Public procedure exposed by the component. |
UnSubscribeOwnTrades() | Public procedure exposed by the component. |
SubscribeOpenOrders() | Public procedure exposed by the component. |
UnSubscribeOpenOrders() | Public procedure exposed by the component. |
SubscribeTicker() | Public procedure exposed by the component. |
UnSubscribeTicker() | Public procedure exposed by the component. |
SubscribeOHLC() | Public procedure exposed by the component. |
UnSubscribeOHLC() | Public procedure exposed by the component. |
Drop the component on a form, configure the properties below and activate it. The snippet that follows shows the typical API Kraken REST Private — Authentication configuration sourced from the online help.
Kraken.ApiKey := 'api key'; Kraken.ApiSecret := 'api secret';
Kraken->ApiKey = "api key"; Kraken->ApiSecret = "api secret";
Kraken.ApiKey = "api key"; Kraken.ApiSecret = "api secret";
The following scenarios are lifted verbatim from the online help. Each shows the configuration and method calls needed to drive the component through a specific real-world flow.
The API client must request an authentication "token" via the following REST API endpoint "GetWebSocketsToken" to connect to WebSockets Private endpoints. The token should be used within 15 minutes of creation. The token does not expire once a connection to a WebSockets API private message (openOrders or ownTrades) is maintained.
Kraken.ApiKey := 'api key'; Kraken.ApiSecret := 'api secret';
Kraken->ApiKey = "api key"; Kraken->ApiSecret = "api secret";
Kraken.ApiKey = "api key"; Kraken.ApiSecret = "api secret";
Client can ping server to determine whether connection is alive, server responds with pong.
SubscribeTicker(['XBT/USD']);
SubscribeTicker([L"XBT/USD"]);
This method is to aid in approximating the skew time between the server and client. Returns Time in Unix format.
Kraken.REST_API.GetAssetPairs(['XBTUSD']);
Kraken->REST_API->GetAssetPairs(ARRAYOFCONST((L"XBTUSD")));
Kraken.REST_API.GetAssetPairs("XBTUSD");
Get a list of own trades, on first subscription, you get a list of latest 50 trades
SubscribeOwnTrades();
SubscribeOwnTrades();
SubscribeOwnTrades();
Returns your account balance.
Kraken.REST_API.GetAccountBalance();
Kraken->REST_API->GetAccountBalance();
Kraken.REST_API.GetAccountBalance();
Every external claim links back to a primary source. The online-help references decode the canonical deep-link the company maintains for this component.
Demos\05.Crypto\08.Kraken
.net\demos\05.Crypto\08.Kraken