Coinpaprika API Client
Async C# Client for the CoinPaprika API. The current version supports CoinPaprika API v1.5.
CoinPaprika delivers full market data to the world of crypto: coin prices, volumes, market caps, ATHs, return rates and more.
Install
CoinPaprika API Client is availabe on Nuget.
Dependencies
The library depends on JSON.net, which is just simply the best Json-library for .NET; It should get installed automatically (with the Nuget package), but depending on your project, you may have to install it manually via Nuget Package Manager/CLI.
This library is using .NET Standard 2.0, you can check compatibility of your project here.
Getting started
CoinpaprikaAPI.Client client = new CoinpaprikaAPI.Client();
Generic return type
All requests return a CoinPaprikaEntity with a generic type (TPaprikaEntity). The CoinPaprikaEntity provides these properties:
Value
, based on the type specified by the API callRaw
, json value returned by the API)Error
, may be an HTTP-Error or an API-Error (check the ErrorMessage property for details)RawError
, json value of the Error property
If the call was succesfull, Error
is null
and Value
provides the returned data from the API.
API
Get global information
var globals = await client.GetClobalsAsync();
returns single CoinPaprikaEntity of Type Global
Get all coins listed on Coinpaprika
var coins = await client.GetCoinsAsync();
returns CoinPaprikaEntity with a List of objects of Type CoinInfo
Get coin details by Id
var coins = await client.GetCoinByIdAsync("btc-bitcoin");
returns single CoinPaprikaEntity of Type ExtendedCoinInfo
Get twitter timeline for coin Id
var coins = await client.GetTwitterTimelineForCoinAsync("btc-bitcoin");
returns CoinPaprikaEntity with a List of objects of Type CoinTweetInfo
Get coin events by coin Id
var coins = await client.GetEventsForCoinAsync("btc-bitcoin");
returns CoinPaprikaEntity with a List of objects of Type CoinEventInfo
Get exchanges by coin Id
var coins = await client.GetExchangesForCoinAsync("btc-bitcoin");
returns CoinPaprikaEntity with a List of objects of Type ExchangeInfo
Get markets by coin Id
var coins = await client.GetMarketsForCoinAsync("btc-bitcoin");
returns CoinPaprikaEntity with a List of objects of Type MarketInfo
Get latest Open/High/Low/Close values with volume and market_cap by coin Id
var coins = await client.GetLatestOhlcForCoinAsync("btc-bitcoin", "USD");
returns CoinPaprikaEntity with a List of objects of Type OhlcValue
Get historical Open/High/Low/Close values with volume and market_cap by coin Id
var firstOfMonth = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
var end = DateTime.Now.Subtract(TimeSpan.FromDays(1));
var ohlcvHistorical = await _client.GetHistoricalOhlcForCoinAsync("btc-bitcoin", new DateTimeOffset(firstOfMonth), end, 200, "USD");
returns single CoinPaprikaEntity with a List of objects of Type OhlcValue
Get today's Open/High/Low/Close values with volume and market_cap by coin Id
var coins = await client.GetTodayOhlcForCoinAsync("btc-bitcoin", "USD");
returns CoinPaprikaEntity with a List of objects of Type OhlcValue
Get ticker information for all coins (including quotes)
var tickers = await client.GetTickers(new[] { "USD", "CHF", "BTC" });
returns CoinPaprikaEntity with a List of objects of Type TickerWithQuotesInfo
Get ticker information for specific coin
var ticker = await client.GetTickerForCoin("btc-bitcoin");
returns single CoinPaprikaEntity of Type TickerInfo
Get historical ticker information for specific coin
var ticker = await _client.GetHistoricalTickerForIdAsync(id, new DateTimeOffset(DateTime.Now.Subtract(TimeSpan.FromDays(1))), DateTimeOffset.Now, 1000, "USD", TickerInterval.OneHour);
returns CoinPaprikaEntity with a List of objects of Type HistoricalTickerInfo
Get a list of exchanges by quotes
var exchanges = await client.GetExchangesAsync(new[] { "USD", "CHF", "BTC" });
returns CoinPaprikaEntity with a List of objects of Type ExtendedExchangeInfo
Get exchange by id
var ticker = await client.GetExchangeByIdAsync("binance", new[] { "USD", "CHF", "BTC" });
returns single CoinPaprikaEntity of Type ExtendedExchangeInfo
Get a list markets of exchange by Id
var markets = await client.GetMarketsByExchangeIdAsync("binance");
returns CoinPaprikaEntity with a List of objects of Type ExchangeMarketInfo
Get people by Id
var person = await client.GetPeopleByIdAsync("vitalik-buterin");
returns single CoinPaprikaEntity of Type PersonInfo
Get a list of tags
var tags = await client.GetTagsAsync(new[] { "coins", "icos" });
returns CoinPaprikaEntity with a List of objects of Type TagInfo
Get tag info by Id
var tag = await client.GetTagByIdAsync("smart-contracts", new[] { "coins", "icos" });
returns single CoinPaprikaEntity of Type TagInfo
Search for currencies/icos/people/exchanges/tags
var searchterms = "coin";
//passing in null searches all categories
var searchResult = await client.SearchAsync(searchTerms, 10, null);
returns CoinPaprikaEntity of Type SearchResult
Convert currencies
var converionResult = await _client.ConvertAsync("btc-bitcoin", "eth-ethereum", 1.5);
returns CoinPaprikaEntity of Type PriceConversionInfo
License
CoinPaprika C# Client is availabe unter the MIT license, see also the LICENSE file.