This is an easy to use wrapper around the CoinMarketCap API providing services for calling the following endpoints :
cryptocurrency/map
Returns a mapping of all cryptocurrencies to unique CoinMarketCapid
scryptocurrency/info
- Returns all static metadata available for one or more cryptocurrenciescryptocurrency/listings/historical
Returns a ranked and sorted list of all cryptocurrencies for a historical UTC date.cryptocurrency/listings/latest
Returns a paginated list of all active cryptocurrencies with latest market datacryptocurrency/market-pairs/latest
Lists all active market pairs that CoinMarketCap tracks for a given cryptocurrency or fiat currencycryptocurrency/ohlcv/historical
Returns historical OHLCV (Open, High, Low, Close, Volume) data along with market cap for any cryptocurrency using time interval parameters.cryptocurrency/ohlcv/latest
Returns the latest OHLCV (Open, High, Low, Close, Volume) market values for one or more cryptocurrencies for the current UTC daycryptocurrency/quotes/historical
Returns an interval of historic market quotes for any cryptocurrency based on time and interval parameters.cryptocurrency/quotes/latest
Returns the latest market quote for 1 or more cryptocurrencies.
tools/price-conversion
Convert an amount of one cryptocurrency or fiat currency into one or more different currencies utilizing the latest market rate for each currency.
fiat/map
API 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