CryptoClients.Net is a C# library for consuming cryptocurrency market data, streaming updates, and trading across multiple platforms. Use the Shared API to reuse the same code across exchanges, and use native REST and WebSocket clients for exchange-specific endpoints and models.
Quick start · Choose a client · Configuration · Included platforms · Release notes
Install the package in an existing C# project.
dotnet add package CryptoClients.NetPaste this into a console project's Program.cs to fetch the BTC/USDT spot ticker from Binance, Bybit, and OKX. This example uses public market data and requires no API keys.
using System;
using CryptoClients.Net.Clients;
using CryptoClients.Net.Enums;
using CryptoExchange.Net.SharedApis;
var client = new ExchangeSharedApiClient();
var exchanges = new[] { Exchange.Binance, Exchange.Bybit, Exchange.OKX };
var tickers = client.GetCapabilities(
SharedCapabilities.Tickers.GetTicker.Rest, TradingMode.Spot, exchanges);
var request = new GetTickerRequest(new SharedSymbol(TradingMode.Spot, "BTC", "USDT"));
await foreach (var result in tickers.ExecuteAllAsync(request))
{
Console.WriteLine(result.Success
? $"{result.Exchange}: {result.Data.LastPrice}"
: $"{result.Exchange}: {result.Error}");
}GetCapabilities finds one matching implementation per enabled exchange. ExecuteAllAsync sends the requests in parallel and yields each result as it completes. Check each result independently, since one exchange can fail while the others succeed.
Coverage depends on the exchange, operation, and trading mode. Exchanges without a matching capability are skipped, so compare the resolved exchanges with your requested list when you need full coverage. A matching capability still requires a listed market and valid request parameters. See the supported features.
| What you need | Entry point |
|---|---|
| Run the same operation across exchanges or select an exchange at runtime | ExchangeSharedApiClient.GetCapabilities(...) or GetCapability(...) |
| Browse a single exchange's Shared API V2 at compile time | A typed surface such as client.Binance.SpotRest |
| Call a native REST or WebSocket endpoint | client.Rest.Binance or client.Socket.Binance |
Use GetCapability for a single exchange's preferred implementation and GetImplementations to see every matching API surface or transport. Inspect a resolved capability's Options for parameter requirements and operation limits.
Native endpoints use the exchange's own symbols and models. For example, using the client from the quick start:
var ticker = await client.Rest.Binance.SpotApi.ExchangeData.GetTickerAsync("BTCUSDT");
Console.WriteLine(ticker.Success ? ticker.Data.LastPrice.ToString() : ticker.Error?.ToString());An application that only needs one exchange's native API can install its individual NuGet package.
In an ASP.NET Core project with CryptoClients.Net installed, add this to Program.cs. ASP.NET Core injects IExchangeSharedApiClient into the endpoint when you call GET /btc-price.
using CryptoClients.Net.Enums;
using CryptoClients.Net.Interfaces;
using CryptoExchange.Net.SharedApis;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddCryptoClients();
var app = builder.Build();
app.MapGet("/btc-price", async (IExchangeSharedApiClient client, CancellationToken ct) =>
{
var ticker = client.GetCapability(
Exchange.Binance, SharedCapabilities.Tickers.GetTicker.Rest, TradingMode.Spot);
if (ticker is null)
return Results.NotFound();
var request = new GetTickerRequest(new SharedSymbol(TradingMode.Spot, "BTC", "USDT"));
var result = await ticker.Capability.GetTickerAsync(request, ct);
return result.Success
? Results.Ok(result.Data.LastPrice)
: Results.Problem("The exchange did not return a ticker.", statusCode: StatusCodes.Status502BadGateway);
});
app.Run();Pass an options callback to AddCryptoClients to set values such as EnabledExchanges or RequestTimeout. For configuration binding, call builder.Services.AddCryptoClients(builder.Configuration.GetSection("CryptoClients")). For standalone clients, pass a CryptoClientsConfiguration to ExchangeSharedApiClient to apply global and per-exchange options.
By default, all exchanges are enabled. EnabledExchanges limits which clients the aggregate can use at runtime. Accessing a disabled typed exchange property throws an InvalidOperationException.
Private account and trading calls require exchange-specific credentials. Use ExchangeCredentials for typed credentials and load the values from your application's secret store or configuration provider. See the configuration guide for credentials, environments, and per-exchange settings.
| Task | Example |
|---|---|
| Stream ticker updates over WebSockets | Resolve subscriptions, handle results, and close subscriptions |
| Maintain local order books or trackers | Use the order book and tracker factories · Combine books across exchanges |
| Read private account data | Configure credentials and handle errors |
| Host the clients in an application | Console, ASP.NET Core, and Blazor projects |
Use IExchangeUserClientProvider to cache separate clients by user ID in multi-user applications. Close subscriptions and stop books and trackers when their workload ends. See the usage guide for more patterns.
The package bundles 32 client libraries. Polymarket exposes its prediction-market endpoints through native clients and its perpetual futures through Shared API V2 surfaces such as client.Polymarket.PerpsRest. CoinGecko is a market-data integration available through the concrete ExchangeRestClient.CoinGecko property.
Use Platform.All for all bundled platform IDs and Platforms.All for their metadata. To determine which platforms can perform an operation, query GetCapabilities with the operation and trading mode.
| Logo | Platform | Type | Included client library |
|---|---|---|---|
| Aster | DEX | Jkorf.Aster.Net | |
| Binance | CEX | Binance.Net | |
| BingX | CEX | JK.BingX.Net | |
| Bitfinex | CEX | Bitfinex.Net | |
| Bitget | CEX | JK.Bitget.Net | |
| Bitstamp | CEX | Bitstamp.Net | |
| Bitunix | CEX | Bitunix.Net | |
| Bitvavo | CEX | Bitvavo.Net | |
| BloFin | CEX | BloFin.Net | |
| Bybit | CEX | Bybit.Net | |
| Coinbase | CEX | JKorf.Coinbase.Net | |
| CoinGecko | Market data | CoinGecko.Net | |
| CoinW | CEX | CoinW.Net | |
| Crypto.com | CEX | CryptoCom.Net | |
| DeepCoin | CEX | DeepCoin.Net | |
| Gate | CEX | GateIo.Net | |
| HTX | CEX | JKorf.HTX.Net | |
| Hyperliquid | DEX | HyperLiquid.Net | |
| Kraken | CEX | KrakenExchange.Net | |
| KuCoin | CEX | Kucoin.Net | |
| LBank | CEX | LBank.Net | |
| Lighter | DEX | JKorf.Lighter.Net | |
| MEXC | CEX | JK.Mexc.Net | |
| OKX | CEX | JK.OKX.Net | |
| Pionex | CEX | Pionex.Net | |
| Polymarket | DEX and prediction market | Polymarket.Net | |
| Tapbit | CEX | Tapbit.Net | |
| Toobit | CEX | Toobit.Net | |
| Upbit | CEX | JKorf.Upbit.Net | |
| Weex | CEX | Weex.Net | |
| WhiteBit | CEX | WhiteBit.Net | |
| XT | CEX | XT.Net |
The project targets .NET Standard 2.0 and 2.1, and .NET 8, 9, 10, and 11. See NuGet for package compatibility.
- CryptoClients.Net documentation
- Shared API documentation
- CryptoClients.Net versus CCXT benchmark
- CryptoManager.Net demo application
See the AI documentation index, consumer skill, and repository development guide.
Join the Discord server for questions and discussion:
https://discord.gg/MSpeEtSY8t
Using these links supports the project and may provide the listed fee discount.
Show referral links
| Exchange | Type | Referral link | Fee discount |
|---|---|---|---|
| Aster | DEX | Link | 4% |
| Binance | CEX | Link | 20% |
| BingX | CEX | Link | 20% |
| Bitget | CEX | Link | 20% |
| Bybit | CEX | Link | - |
| Coinbase | CEX | Link | - |
| CoinW | CEX | Link | - |
| Crypto.com | CEX | Link | - |
| DeepCoin | CEX | Link | - |
| Gate.io | CEX | Link | 20% |
| HTX | CEX | Link | 30% |
| HyperLiquid | DEX | Link | 4% |
| Kucoin | CEX | Link | - |
| OKX | CEX | Link | 20% |
| Tapbit | CEX | Link | - |
| Toobit | CEX | Link | - |
| WhiteBit | CEX | Link | - |
| XT | CEX | Link | 25% |
Make a one time donation in a crypto currency of your choice. If you prefer to donate in a different currency or network send me a message.
USDT (TRX) TKigKeJPXZYyMVDgMyXxMf17MWYia92Rjd
https://github.com/sponsors/JKorf
-
Version 5.12.0 - 27 Nov 2026
- Updated reference CryptoExchange.Net to v13.4.0
- Added Bitvavo support with JKorf.Bitvavo.Net 1.1.0
- Updated client library versions
-
Version 5.11.0 - 18 Nov 2026
- Updated library versions
- Added Polymarket Perps support
- Fixed ClearUserClients not clearing when resolved from DI
- Fixed futures order and trade requests ignoring TradingMode
-
Version 5.10.0 - 23 Oct 2026
- Added Bitunix support with Bitunix.Net 1.0.1
- Updated client library versions
-
Version 5.9.0 - 30 Sep 2026
- Updated refrence CryptoExchange.Net to v13.1.0
- Updated client library versions
- Added Rest and Socket properties to (I)ExchangeSharedApiClient to access full APIs and transport specific APIs
- Added GetSharedApiClient to (I)ExchangeUserClientProvider
- Fixed ExchangeSharedApiClient UnsubscribeAll always resolving all subscriptions
-
Version 5.8.0 - 25 Sep 2026
- Updated client library versions
- Removed BitMEX, BitMart and CoinEx support due to exchange shut down
- Shared APIs
- Added SharedApi V2 support
- Added (I)ExchangeSharedApiClient for accessing V2 Shared APIs
- See https://cryptoexchange.jkorf.dev/docs/shared-api?sharedApiVersion=v2 for more info about the V2 update and https://github.com/JKorf/CryptoExchange.Net/blob/master/docs/SHARED_API_V2_MIGRATION.md for migrating from V1
- SharedApi V1 will still be supported
- Rate limiting
- Added rate limit admission callback to client options to allow rate limit admission ruling on request definition
- Added
WithRateLimitAdmissionAsyncto client to allow rate limit admission ruling on a specific request - Update rate limit safety margin logic
- Fixed some rate limit calculation issues
- Request coalescing
- Sending identical public GET requests on the same exchange client at the same time will only send a single request to the server and use the same response
- Coalescing is enabled by default and can be disabled with the
RequestCoalescingEnabledclient option
- Added new constructors for ExchangeSocketClient and ExchangeRestClient using CryptoClientsConfiguration
-
Version 5.7.1 - 01 Sep 2026
- Updated client library versions, fixing some bugs
-
Version 5.7.0 - 24 Aug 2026
- Updated client library versions
- Added Tapbit support with Tapbit.Net 1.0.0
- Added ISpotOrderManagementSocketClient for placing/canceling Spot orders via Shared websocket implementation
- Added IFuturesOrderManagementSocketClient for placing/canceling Futures orders via Shared websocket implementation
- Added PlaceSpotOrderAsync, CancelSpotOrderAsync, PlaceFuturesOrderAsync and CancelFuturesOrderAsync queries to ExchangeSocketClient
- Added UpperFundingCap, LowerFundingCap to SharedFuturesSymbol model
- Added UpperPriceLimitPerecentage, LowerPriceLimitPercentage, MakerFeePercentage and TakerFeePercentage to SharedSpotSymbol model
- Added WithCalculatedQuantities(price, contractSize) to SharedQuantity to retrieve a copy with derived quantities
- Added Description property to Shared EndpointOptions classes
- Added QuantityType property to SharedOrderBook
- Updated SharedId value to be nullable
- Updated quantity/volumes to SharedOrderQuantity model for SharedBookTicker, SharedOpenInterest, SharedPosition, SharedPositionHistory and SharedUserTrade
- Updated Shared client info string representation
-
Version 5.6.0 - 12 Aug 2026
- Updated client library versions
- Added EnabledExchange setting to control which exchanges should be available
- Added ExchangeRestClient.GetSpotTickersAsync method for single exchange request, marked incorrectly named GetSpotTicker as obsolete
- Added CanCreateKlineTracker and CanCreateTradeTracker on (I)ExchangeTrackerFactory
- Updated exchange objects to be lazily loaded instead of constructed directly when parent is constructed for ExchangeRestClient, ExchangeSocketClient, ExchangeTrackerFactory, ExchangeOrderBookFactory, ExchangeUserClientProvider
-
Version 5.5.0 - 06 Aug 2026
- Added LBank support with LBank.Net
- Some small client library updates
-
Version 5.4.0 - 30 Jul 2026
- Updated client library versions
- Added calculation of AveragePrice on Shared order models if data is available and AveragePrice is not set
- Added DebuggerDisplay attributes to Result models
- Added AveragePrice property to SharedQuantity model
- Updated SharedFuturesTicker, SharedSpotTicker, SharedTrade and SharedKline to use SharedOrderQuantity for volumes/quantities
-
Version 5.3.0 - 23 Jul 2026
- Added Pionex support with Pionex.Net
-
Version 5.2.0 - 22 Jul 2026
- Updated library versions
- Added SpotSymbolCatalog to Shared ISpotSymbolRestClient interface
- Added FuturesSymbolCatalog to Shared IFuturesSymbolRestClient interface
- Added BaseAssetType, BaseAssetSubType, QuoteAssetType and QuoteAssetSubType to GetSymbolsRequest model
- Added DisplayName to SharedSpotSymbol and SharedFuturesSymbol models
- Added BaseAssetType, BaseAssetSubType, QuoteAssetType and QuoteAssetSubType to SharedSpotSymbol and SharedFuturesSymbol models
- Added IsStableCoin, IsCommodity and IsEquity helper methods to LibraryHelpers
- Added DebuggerDisplay Attributes to Shared response models
- Updated Aster registration logic so V3 API is used if V3 credentials are provided
- Fixed global options not getting applied
- Fixed socket connection combine calculations
-
Version 5.1.0 - 10 Jul 2026
- Updated library versions
-
Version 5.0.2 - 04 Jul 2026
- Updated Kucoin library version to fix issue in websocket user subscriptions
- Updated Lighter library version to fix issue with signing libraries not getting copied correctly
-
Version 5.0.1 - 03 Jul 2026
- Updated client library versions, fixing signing issues in Binance and Mexc implementation
- Fixed Lighter implementation missing library references, added Lighter IFundingRateRestClient implementation
-
Version 5.0.0 - 30 Jun 2026
- Updated client library versions
- Added support for Lighter DEX with JKorf.Lighter.Net v1.0.0
- Result types:
- ExchangeWebResult/ExchangeResult types are replaced by HttpResult and WebSocketResult with the same logic
- WebSocketResult now returns additional info for websocket operations
- 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
- Fixed issue in SocketApiClient.GetSocketConnection causing requests to always wait the full max 10 seconds when there was a reconnecting socket
- Shared APIs:
- Added missing dedicated option types
- Added Discover method on ISharedClient interface, returning info on supported capabilities and operations
- Added ResetStaticExchangeParameters method on ExchangeParameters
- Added Status property to SharedWithdrawal model
- Added TradingModes property to SharedBalance model
- Updated Shared ExchangeParameters parameter names to be case insensitive
- Updated code comments
- Removed TradingMode from the response model, only maintained on models where it makes sense
- Removed IListenKey support, listen keys now rely on internal management
- Added async streaming on UserDataTracker items with StreamUpdatesAsync
- Added cancellation token support to UserDataTracker starting
- Added SupportedEnvironments property to PlatformInfo
- Added Clear() method on UserClientProvider to clear all cached clients
- Various small performance improvements
- Fixed websocket connection attempts counting towards rate limit even when server could not be reached
- Removed previously deprecated SetApiCredentials method from ExchangeRestClient and ExchangeSocketClient