Skip to content

An api client for the Kraken crypto currency trading site.

Notifications You must be signed in to change notification settings

Coinio/Kraken.Api.Client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kraken.Api.Client

Just playing about with this for a personal project and only a couple of GET end points exist so far. I'm intending to add support all of the available public / private with proper request throttling based on the rules in the documentation below.

The api documentation for the Kraken Api can be found here: https://www.kraken.com/help/api

Usage

Create a client:

  var client = new KrakenClient("https://api.kraken.com");

Request a list of available assets (https://api.kraken.com/0/public/Assets):

  var assets = await client.GetAssetInfo();

  foreach (var asset in assets)
    Console.WriteLine($"{asset.AssetName} -> {asset.CurrencyName}");

Request a list of available asset pairs (https://api.kraken.com/0/public/AssetPairs):

  var assetPairs = await client.GetAssetPairs();

  foreach (var assetPair in assetPairs)
    Console.WriteLine($"{assetPair.PairName}: {assetPair.BaseName} -> {assetPair.QuoteName}");

Request a list of asset pair tickers. This can be limited to a subset of asset pairs (https://api.kraken.com/0/public/Ticker):

  var tickers = await client.GetAssetPairTickers(assetPairs);

  foreach (var ticker in tickers)
    Console.WriteLine($"{ticker.PairName} -> Ask: {ticker.AskPrice} Bid: {ticker.BidPrice} Last: {ticker.LastPrice}");

Request the OHLC (Open / High / Low / Closed) data. The interval for the data can specified and the 'since' parameter can be given as the lastPollingId (https://api.kraken.com/0/public/OHLC):

  var ohlcData = await client.GetOHLC(assetPair.PairName, OHLCTimeInterval.FiveMinutes, lastPollingId);

  Console.WriteLine($"{ohlcData.PairName} -> Last Id: {ohlcData.LastPollingId}");

  foreach (var entry in ohlcData.Entries)
    Console.WriteLine($"({entry.Time}) Open: {entry.OpenPrice} / Close: {entry.ClosePrice} / High: {entry.HighPrice} / Low: {entry.LowPrice}");

About

An api client for the Kraken crypto currency trading site.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages