This is an easy to use wrapper around the CoinMarketCap API providing services for calling the following endpoints :
cryptocurrency/mapReturns a mapping of all cryptocurrencies to unique CoinMarketCapidscryptocurrency/info- Returns all static metadata available for one or more cryptocurrenciescryptocurrency/listings/historicalReturns a ranked and sorted list of all cryptocurrencies for a historical UTC date.cryptocurrency/listings/latestReturns a paginated list of all active cryptocurrencies with latest market datacryptocurrency/market-pairs/latestLists all active market pairs that CoinMarketCap tracks for a given cryptocurrency or fiat currencycryptocurrency/ohlcv/historicalReturns historical OHLCV (Open, High, Low, Close, Volume) data along with market cap for any cryptocurrency using time interval parameters.cryptocurrency/ohlcv/latestReturns the latest OHLCV (Open, High, Low, Close, Volume) market values for one or more cryptocurrencies for the current UTC daycryptocurrency/quotes/historicalReturns an interval of historic market quotes for any cryptocurrency based on time and interval parameters.cryptocurrency/quotes/latestReturns the latest market quote for 1 or more cryptocurrencies.
tools/price-conversionConvert an amount of one cryptocurrency or fiat currency into one or more different currencies utilizing the latest market rate for each currency.
fiat/mapAPI endpoints for fiat currencies. Returns a mapping of all supported fiat currencies to unique CoinMarketCap ids.
git clone https://github.com/imaun/coinmarketcap.git
dotnet build
dotnet add package ImanN.CoinMarketCap --version 1.0.0
or with package manager console :
Install-Package ImanN.CoinMarketCap -Version 1.0.0
3. Get your own API Key from here
public void ConfigureServices(IServiceCollection services)
{
//...
services.AddCoinMarketCapAPI(apiKey: "YourApiKey");
//...
}using System.Threading.Tasks;
using ImanN.CoinMarketCap;
namespace Sample {
public class SampleController : Controller {
private readonly ICoinMarketCapAPI _client;
public SampleController(ICoinMarketCapAPI client) {
_client = client ?? throw new ArgumentNullException(nameof(client));
var result = await _client.CryptoCurrency.GetListingsLatestAsync(new ListingsLatestQuery {
Limit = 100,
Start = 1
});
}
}
}You can contact me via email : imun22 at gmail or hi at imaun.ir