CoinGecko.Net is a strongly typed client library for accessing the CoinGecko REST API. All data is mapped to readable models and enum values.
The library is targeting both .NET Standard 2.0 and .NET Standard 2.1 for optimal compatibility, as well as dotnet 8.0 and 9.0 to use the latest framework features.
| .NET implementation | Version Support |
|---|---|
| .NET Core | 2.0 and higher |
| .NET Framework | 4.6.1 and higher |
| Mono | 5.4 and higher |
| Xamarin.iOS | 10.14 and higher |
| Xamarin.Android | 8.0 and higher |
| UWP | 10.0.16299 and higher |
| Unity | 2018.1 and higher |
dotnet add package CoinGecko.Net
CoinGecko.Net is available on GitHub packages. You'll need to add https://nuget.pkg.github.com/JKorf/index.json as a NuGet package source.
The NuGet package files are added along side the source with the latest GitHub release which can found here.
REST Endpoints
// Get the ETH price via rest request
var restClient = new CoinGeckoRestClient();
var tickerResult = await restClient.Api.GetMarketsAsync("USD");
if (!tickerResult.Success)
{
Console.WriteLine(tickerResult.Error);
return;
}
var lastPrice = tickerResult.Data.Single(x => x.Name == "Ethereum").CurrentPrice;
Console.ReadLine();REST requests return HttpResult<T>. Always check .Success before reading .Data; API, rate-limit, and network errors are available via .Error.
DEx endpoints are available through restClient.DexApi:
var networks = await restClient.DexApi.GetDexNetworksAsync();
if (!networks.Success)
{
Console.WriteLine(networks.Error);
return;
}For information on the clients, dependency injection, response processing and more see the CoinGecko.Net documentation or have a look at the examples here or here.
CoinGecko.Net is based on the CryptoExchange.Net base library. Other exchange API implementations based on the CryptoExchange.Net base library are available and follow the same logic.
CryptoExchange.Net also allows for easy access to different exchange API's.
| Exchange | Repository | Nuget |
|---|---|---|
| Aster | JKorf/Aster.Net | |
| Binance | JKorf/Binance.Net | |
| BingX | JKorf/BingX.Net | |
| Bitfinex | JKorf/Bitfinex.Net | |
| Bitget | JKorf/Bitget.Net | |
| BitMart | JKorf/BitMart.Net | |
| BitMEX | JKorf/BitMEX.Net | |
| Bitstamp | JKorf/Bitstamp.Net | |
| BloFin | JKorf/BloFin.Net | |
| Bybit | JKorf/Bybit.Net | |
| Coinbase | JKorf/Coinbase.Net | |
| CoinEx | JKorf/CoinEx.Net | |
| CoinW | JKorf/CoinW.Net | |
| Crypto.com | JKorf/CryptoCom.Net | |
| DeepCoin | JKorf/DeepCoin.Net | |
| Gate.io | JKorf/GateIo.Net | |
| HTX | JKorf/HTX.Net | |
| HyperLiquid | JKorf/HyperLiquid.Net | |
| Kraken | JKorf/Kraken.Net | |
| Kucoin | JKorf/Kucoin.Net | |
| Lighter | JKorf/Lighter.Net | |
| Mexc | JKorf/Mexc.Net | |
| OKX | JKorf/OKX.Net | |
| Polymarket | JKorf/Polymarket.Net | |
| Toobit | JKorf/Toobit.Net | |
| Upbit | JKorf/Upbit.Net | |
| Weex | JKorf/Weex.Net | |
| WhiteBit | JKorf/WhiteBit.Net | |
| XT | JKorf/XT.Net |
A Discord server is available here. Feel free to join for discussion and/or questions around the CryptoExchange.Net and implementation libraries.
Note that only the public endpoints are supported, but setting API key is supported and the correct API urls will be selected.
| API | Supported | Location |
|---|---|---|
| Ping | ✓ | restClient.Api |
| Key | ✓ | restClient.Api |
| Simple | ✓ | restClient.Api |
| Coins | ✓ | restClient.Api |
| Contract | ✓ | restClient.Api |
| Asset Platforms | ✓ | restClient.Api |
| Categories | ✓ | restClient.Api |
| Exchanges | ✓ | restClient.Api |
| Derivatives | ✓ | restClient.Api |
| Nfts | ✓ | restClient.Api |
| Exchange Rates | ✓ | restClient.Api |
| Search | ✓ | restClient.Api |
| Trending | ✓ | restClient.Api |
| Global | ✓ | restClient.Api |
| Companies | ✓ | restClient.Api |
| API usage | ✓ | restClient.Api |
| API | Supported | Location |
|---|---|---|
| Networks | ✓ | restClient.DexApi.GetDexNetworksAsync() |
| Search pools | ✓ | restClient.DexApi.SearchPoolsAsync(...) |
| Token OHLCV | ✓ | restClient.DexApi.GetTokenOhlcvAsync(...) |
Any support is greatly appreciated.
Make a one time donation in a crypto currency of your choice. If you prefer to donate a currency not listed here please contact me.
Btc: bc1q277a5n54s2l2mzlu778ef7lpkwhjhyvghuv8qf
Eth: 0xcb1b63aCF9fef2755eBf4a0506250074496Ad5b7
USDT (TRX) TKigKeJPXZYyMVDgMyXxMf17MWYia92Rjd
Alternatively, sponsor me on Github using Github Sponsors.
- Version 6.0.0 - 29 Jun 2026
- Result types:
- (Web)CallResult types are replaced by HttpResult with the same logic
- Updated result types to record type
- Removed implicit result type conversion to bool,
if (result)no longer works, instead useif (result.Success) - Fixed result object nullability hinting, for example Data might be null if Success isn't checked for true
- Clients:
- Added ToString overrides on base API types
- Added Exchange property on BaseApiClient
- Added ApiCredentials property on Api clients
- Updated ILogger source from client name to topic specific client name
- Removed logging from client creation
- Added SupportedEnvironments property to PlatformInfo
- Various small performance improvements
- Result types: