CryptoClients.Net provides unified access to cryptocurrency trading APIs in C#.
It combines:
- direct access to exchange-specific REST and WebSocket clients
- shared cross-exchange interfaces from CryptoExchange.Net
- dynamic multi-exchange requests and subscriptions
- client-side helpers such as rate limiting, order books, trackers, and user client management
The library currently supports 26 exchanges and additional platform integrations such as CoinGecko and Polymarket.
- Full access to exchange-specific APIs through
ExchangeRestClientandExchangeSocketClient - Shared exchange-agnostic interfaces for spot and futures functionality
- Request data from a single exchange or many exchanges in one call
- Subscribe to one or many data streams on multiple exchanges through a single API
- Strongly typed models and enum mappings
- Automatic WebSocket (re)connection management
- Client-side rate limiting
- Client-side order book support
- Multi-user client management
- Support for multiple API environments
- Dynamic credential management
var client = new ExchangeRestClient();
var symbol = new SharedSymbol(TradingMode.Spot, "ETH", "USDT");
var results = await client.GetSpotTickerAsync(
new GetTickerRequest(symbol),
["Binance", "Bybit", "HyperLiquid", "OKX"]);
foreach (var result in results)
{
if (!result.Success)
Console.WriteLine($"{result.Exchange} error: {result.Error}");
else
Console.WriteLine($"{result.Exchange} price: {result.Data.LastPrice}");
}
For more examples, see the documentation or the full demo application:
https://github.com/JKorf/CryptoManager.Net
dotnet add package CryptoClients.Net
CryptoClients.Net is also available on GitHub Packages.
Add the following NuGet source:
https://nuget.pkg.github.com/JKorf/index.json
Latest releases are available here:
https://github.com/JKorf/CryptoClients.Net/releases
There are two main entry points:
ExchangeRestClientfor REST APIsExchangeSocketClientfor WebSocket APIs
You can also use exchange-specific clients directly, such as BinanceRestClient or KucoinSocketClient.
// Load options from configuration
builder.Services.AddCryptoClients(builder.Configuration.GetSection("CryptoClients"));
// Or configure in code
builder.Services.AddCryptoClients(options =>
{
options.OutputOriginalData = true;
});
// Inject later
public class TradingBot
{
public TradingBot(IExchangeRestClient restClient, IExchangeSocketClient socketClient)
{
}
}
IExchangeRestClient restClient = new ExchangeRestClient();
IExchangeSocketClient socketClient = new ExchangeSocketClient();
IBinanceRestClient binanceRestClient = new BinanceRestClient();
IKucoinSocketClient kucoinSocketClient = new KucoinSocketClient();
Clients can be configured globally, per exchange, or both.
builder.Services.AddCryptoClients(globalOptions =>
{
globalOptions.OutputOriginalData = true;
globalOptions.ApiCredentials = new ExchangeCredentials
{
Binance = new BinanceCredentials("BinanceKey", "BinanceSecret"),
Kucoin = new KucoinCredentials("KucoinKey", "KucoinSecret", "KucoinPassphrase"),
OKX = new OKXCredentials("OKXKey", "OKXSecret", "OKXPassphrase")
};
},
bybitRestOptions: bybitOptions =>
{
bybitOptions.Environment = Bybit.Net.BybitEnvironment.Eu;
bybitOptions.ApiCredentials = new BybitCredentials("BybitKey", "BybitSecret");
});
Environment selection can also be configured through GlobalExchangeOptions.ApiEnvironments.
More configuration details are available in the documentation:
https://cryptoexchange.jkorf.dev/crypto-clients/options
Use the exchange libraries directly when full exchange-specific functionality is needed.
var kucoinClient = new KucoinRestClient();
var binanceClient = new BinanceRestClient();
var binanceTicker = await binanceClient.SpotApi.ExchangeData.GetTickerAsync("ETHUSDT");
var kucoinTicker = await kucoinClient.SpotApi.ExchangeData.GetTickerAsync("ETH-USDT");
Use ExchangeRestClient or ExchangeSocketClient as a single entry point.
var client = new ExchangeRestClient();
var binanceTicker = await client.Binance.SpotApi.ExchangeData.GetTickerAsync("ETHUSDT");
var kucoinTicker = await client.Kucoin.SpotApi.ExchangeData.GetTickerAsync("ETH-USDT");
Use shared interfaces for exchange-agnostic logic.
async Task<ExchangeWebResult<SharedSpotTicker>> GetTickerAsync(ISpotTickerRestClient client, SharedSymbol symbol)
=> await client.GetSpotTickerAsync(new GetTickerRequest(symbol));
var client = new ExchangeRestClient();
var symbol = new SharedSymbol(TradingMode.Spot, "ETH", "USDT");
var binanceResult = await GetTickerAsync(client.Binance.SpotApi.SharedClient, symbol);
var kucoinResult = await GetTickerAsync(client.Kucoin.SpotApi.SharedClient, symbol);
Request the same data from multiple exchanges in one call.
var client = new ExchangeRestClient();
var symbol = new SharedSymbol(TradingMode.Spot, "ETH", "USDT");
var tickers = await client.GetSpotTickerAsync(
new GetTickerRequest(symbol),
[Exchange.Binance, Exchange.Kucoin, Exchange.OKX]);
The socket client also supports single-exchange and multi-exchange subscriptions.
var socketClient = new ExchangeSocketClient();
var symbol = new SharedSymbol(TradingMode.Spot, "ETH", "USDT");
var subscriptions = await socketClient.SubscribeToTickerUpdatesAsync(
new SubscribeTickerRequest(symbol),
data => Console.WriteLine($"{data.Data.Symbol} {data.Data.LastPrice}"),
[Exchange.Binance, Exchange.OKX]);
Use ExchangeUserClientProvider when working with multiple users and isolated client instances.
var provider = new ExchangeUserClientProvider();
var user1Credentials = new ExchangeCredentials
{
Binance = new BinanceCredentials("key", "secret")
};
var user2Credentials = new ExchangeCredentials
{
Binance = new BinanceCredentials("key", "secret")
};
var restClientUser1 = provider.GetRestClient("user-1", user1Credentials);
var restClientUser2 = provider.GetRestClient("user-2", user2Credentials);
var socketClientUser1 = provider.GetSocketClient("user-1");
The package targets:
.NET Standard 2.0.NET Standard 2.1.NET 8.0.NET 9.0.NET 10.0
Compatibility includes:
| .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 |
Binance, BingX, Bitfinex, Bitget, BitMart, BitMEX, Bitstamp, BloFin, Bybit, Coinbase, CoinEx, CoinW, Crypto.com, DeepCoin, GateIo, HTX, Kraken, Kucoin, Mexc, OKX, Toobit, Upbit, WhiteBit, XT
Aster, HyperLiquid
CoinGecko, Polymarket
| Exchange | Type | Referral Link | Referral Fee Discount | |
|---|---|---|---|---|
| Aster | DEX | Link | 4% | |
| Binance | CEX | Link | 20% | |
| BingX | CEX | Link | 20% | |
| Bitfinex | CEX | - | - | |
| Bitget | CEX | Link | 20% | |
| BitMart | CEX | Link | 30% | |
| BitMEX | CEX | Link | 30% | |
| Bitstamp | CEX | - | - | |
| BloFin | CEX | - | - | |
| Bybit | CEX | Link | - | |
| Coinbase | CEX | Link | - | |
| CoinEx | CEX | Link | 20% | |
| CoinW | CEX | Link | - | |
| CoinGecko | - | - | - | |
| Crypto.com | CEX | Link | - | |
| DeepCoin | CEX | Link | - | |
| Gate.io | CEX | Link | 20% | |
| HTX | CEX | Link | 30% | |
| HyperLiquid | DEX | Link | 4% | |
| Kraken | CEX | - | - | |
| Kucoin | CEX | Link | - | |
| Mexc | CEX | - | - | |
| OKX | CEX | Link | 20% | |
| Toobit | CEX | Link | - | |
| Upbit | CEX | - | - | |
| WhiteBit | CEX | Link | - | |
| XT | CEX | Link | 25% |
Use:
Exchanges.Allfor supported exchangesPlatforms.Allfor supported exchanges and additional platforms
The following minimal API exposes a cross-exchange ticker endpoint:
using CryptoClients.Net.Interfaces;
using CryptoExchange.Net.Objects;
using CryptoExchange.Net.SharedApis;
using Microsoft.AspNetCore.Mvc;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddCryptoClients();
var app = builder.Build();
app.MapGet("Ticker/{exchange}/{baseAsset}/{quoteAsset}",
async ([FromServices] IExchangeRestClient client, string exchange, string baseAsset, string quoteAsset) =>
{
var spotClient = client.GetSpotTickerClient(exchange)!;
var result = await spotClient.GetSpotTickerAsync(
new GetTickerRequest(new SharedSymbol(TradingMode.Spot, baseAsset, quoteAsset)));
return result.Data;
});
app.Run();
Example requests:
GET /Ticker/Kraken/ETH/BTCGET /Ticker/Kucoin/BTC/USDT
- Documentation: https://cryptoexchange.jkorf.dev/crypto-clients
- Configuration options: https://cryptoexchange.jkorf.dev/crypto-clients/options
- Example configuration: https://github.com/JKorf/CryptoClients.Net/tree/main/Examples/example-config.json
- Examples: https://github.com/JKorf/CryptoClients.Net/tree/main/Examples
- Base library examples: https://github.com/JKorf/CryptoExchange.Net/tree/master/Examples
- Demo application: https://github.com/JKorf/CryptoManager.Net
Join the Discord server for questions and discussion:
https://discord.gg/MSpeEtSY8t
BTC: bc1q277a5n54s2l2mzlu778ef7lpkwhjhyvghuv8qf
ETH: 0xcb1b63aCF9fef2755eBf4a0506250074496Ad5b7
USDT (TRX): TKigKeJPXZYyMVDgMyXxMf17MWYia92Rjd
https://github.com/sponsors/JKorf
-
Version 4.7.0 - 25 Mar 2026
-
Added CoinGecko to ExchangeRestClient
-
Added coinGeckoRestOptions parameter to ExchangeUserClientProvider constructor
-
Added SetApiCredentials(string, DynamicCredentials) on ExchangeRestClient
-
Added SetApiCredentials(string, DynamicCredentials) on ExchangeSocketClient
-
Split upbitOptions parameter in ExchangeUserClientProvider constructor into upbitRestOptions and upbitSocketOptions
-
Added SetApiCredentials(string, DynamicCredentials) to ExchangeRestClient
-
Added SetApiCredentials(string, DynamicCredentials) to ExchangeSocketClient
-
Marked SetApiCredentials(string exchange, string apiKey, string apiSecret, string? apiPass = null) as obsolete on ExchangeRestClient
-
Marked SetApiCredentials(string exchange, string apiKey, string apiSecret, string? apiPass = null) as obsolete on ExchangeSocketClient
-
Updated ExchangeCredentials to reflect exchange specific ApiCredential types needed in client libraries
-
Removed Dictionary<string, ApiCredentials> constructor overload from ExchangeCredentials
-
Removed Upbit from ExchangeCredentials since authentication is not supported
-
Added ExchangeCredentials.GetDynamicCredentialInfo(TradingMode, string)
-
Added ExchangeCredentials.CreateCredentialsForExchange(string, DynamicCredentials)
-
Added ExchangeCredentials.CreateFrom(Dictionary<string, ApiCredentials>)
-
Added ExchangeCredentials.CreateFrom(string, ApiCredentials)
-
Added DynamicCredentialInfo to ExchangeInfo to retrieve info for an exchange to dynamically create credentials
-
Notes for updating:
ExchangeCredentialsno longer has a constructor which acceptsDictionary<string, ApiCredentials>. To dynamically createExchangeCredentialsuse theExchangeCredentials.CreateFromstatic method in combination withExchangeCredentials.CreateCredentialsForExchange.
-
-
Version 4.6.0 - 06 Mar 2026
- Updated client library versions
- Added Bitstamp support with the Bitstamp.Net library
-
Version 4.5.0 - 25 Feb 2026
- Updated client library versions
- Added PageRequest parameter to endpoints supporting pagination using single exchange parameter
-
Version 4.4.0 - 16 Feb 2026
- Updated client library versions
-
Version 4.3.0 - 10 Feb 2026
- Updated client library versions
- Added user data tracker creation method to (I)ExchangeTrackerFactory
- Added checks to rest client exchange requests to prevent exception when more than one trading mode specific requests are available for an exchange
- Added additional methods for requesting supported symbols to Shared ISpotSymbolRestClient/IFuturesSymbolRestClient interfaces
- Removed UseUpdatedDeserialization option
-
Version 4.2.0 - 22 Jan 2026
- Updated client library versions
- Added Polymarket support with the Polymarket.Net library
- Added static class Platform listing all supported exchange names plus any non-exchange platform names
- Added static class Platforms listing all supported exchange metadatas plus any non-exchange platform metadata
-
Version 4.1.3 - 19 Jan 2026
- Updated client library versions, fixing some bugs
-
Version 4.1.2 - 14 Jan 2026
- Updated client library versions fixing some bugs
-
Version 4.1.1 - 13 Jan 2026
- Fixed issue with websocket message sequence checking causing reconnects
-
Version 4.1.0 - 13 Jan 2026
- Updated client library versions
- Added Create method without exchange parameters to create SymbolOrderBook instance on all supported exchanges
- Fixed GateIo ExchangeOrderBookFactory Perpetual Futures creation when using SharedSymbol.UsdOrStable
-
Version 4.0.4 - 19 Dec 2025
- Updated client library versions fixing some bugs
-
Version 4.0.3 - 19 Dec 2025
- Updated client library versions fixing some bugs
-
Version 4.0.2 - 18 Dec 2025
- Updated client library versions fixing some bugs
-
Version 4.0.1 - 17 Dec 2025
- Updated library versions fixing some bugs
-
Version 4.0.0 - 16 Dec 2025
- Updated client library versions
- Added Net10.0 target framework
- Updated CryptoExchange.Net version to 10.0.0, see https://github.com/JKorf/CryptoExchange.Net/releases/ for full release notes
- Improved performance across the board, biggest gains in websocket message processing
- Added UseUpdatedDeserialization socket client options to toggle by new and old message handling
- Updated Shared API's subscription update types from ExchangeEvent to DataEvent