CryptoExchange.Net
CryptoExchange.Net is a base library which is used to implement different cryptocurrency (exchange) API's. It provides a standardized way of implementing different API's, which results in a very similar experience for users of the API implementations.
The following API's are directly supported. Note that there are 3rd party implementations going around, but only these are created and supported by me
Exchange | Repository | Nuget |
---|---|---|
Binance | JKorf/Binance.Net | |
Bitfinex | JKorf/Bitfinex.Net | |
Bitget | JKorf/Bitget.Net | |
Bybit | JKorf/Bybit.Net | |
CoinEx | JKorf/CoinEx.Net | |
CoinGecko | JKorf/CoinGecko.Net | |
Huobi | JKorf/Huobi.Net | |
Kraken | JKorf/Kraken.Net | |
Kucoin | JKorf/Kucoin.Net | |
Mexc | JKorf/Mexc.Net | |
OKX | JKorf/OKX.Net |
Discord
A Discord server is available here. Feel free to join for discussion and/or questions around the CryptoExchange.Net and implementation libraries.
Support the project
DonateMake 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: bc1qz0jv0my7fc60rxeupr23e75x95qmlq6489n8gh
Eth: 0x8E21C4d955975cB645589745ac0c46ECA8FAE504
Alternatively, sponsor me on Github using Github Sponsors.
Getting Started
All packages are available on Nuget. After installing the package the API is available by using one of the library clients, or through the ICrypoRestClient
, ICryptoSocketClient
or ISpotClient
interfaces.
Installation
Add the package via dotnet
dotnet add package Binance.Net
Or install it via the package manager

Add the package via dotnet
dotnet add package Bitfinex.Net
Or install it via the package manager

Add the package via dotnet
dotnet add package JK.Bitget.Net
Or install it via the package manager

Add the package via dotnet
dotnet add package Bybit.Net
Or install it via the package manager

Add the package via dotnet
dotnet add package CoinGecko.Net
Or install it via the package manager

Add the package via dotnet
dotnet add package CoinEx.Net
Or install it via the package manager

Add the package via dotnet
dotnet add package Huobi.Net
Or install it via the package manager

Add the package via dotnet
dotnet add package KrakenExchange.Net
Or install it via the package manager

Add the package via dotnet
dotnet add package Kucoin.Net
Or install it via the package manager

Add the package via dotnet
dotnet add package JK.Mexc.Net
Or install it via the package manager

Add the package via dotnet
dotnet add package JK.OKX.Net
Or install it via the package manager

Dependency Injection
REST API client
Websocket API client
Common Clients
Options & Authorization
Options for the clients can be provided in a couple of different ways. If no options are configured the default options will be used. For accessing private endpoints and streams API credentials have to be provided.
Authorization
For private endpoints and data streams the clients will need to know the API credentials of the user accessing the API. API credentials are a way of identifying the user and validating that the user is who he says he is. You can compare it to a username and password login.
API credentials van be provided via the client options, see next section on how to set these options. There are currently 2 variants of API credentials supported, HMAC and RSA.
HMAC
HMAC authentication involves 2 values, the API key and API secret. The combination of the two gives access to the account. HMAC is the default authentication method and can be configured as such:
options.ApiCredentials = new ApiCredentials("YOUR API KEY", "YOUR API SECRET");
RSA
Setting options
Via dependency injection
Via constructor
Via SetDefaultOptions
Option definitions
List of options:
- Generic Options
- Options per library
Features
Orderbooks
Logging
Ratelimiting
Examples
using Binance.Net;
var client = new BinanceRestClient();
client.SpotApi.Exchange.GetExchangeInfoAsync();