Home

Awesome

.Binance.Net Binance.Net

.NET License

Binance.Net is a strongly typed client library for accessing the Binance REST and Websocket API. All data is mapped to readable models and enum values. Additional features include an implementation for maintaining a client side order book, easy integration with other exchange client libraries and more.

Supported Frameworks

The library is targeting both .NET Standard 2.0 and .NET Standard 2.1 for optimal compatibility

.NET implementationVersion Support
.NET Core2.0 and higher
.NET Framework4.6.1 and higher
Mono5.4 and higher
Xamarin.iOS10.14 and higher
Xamarin.Android8.0 and higher
UWP10.0.16299 and higher
Unity2018.1 and higher

Get the library

Nuget version Nuget downloads

dotnet add package Binance.Net

How to use

REST Endpoints

// Get the ETH/USDT ticker via rest request
var restClient = new BinanceRestClient();
var tickerResult = await restClient.SpotApi.ExchangeData.GetTickerAsync("ETHUSDT");
var lastPrice = tickerResult.Data.LastPrice;

Websocket streams

// Subscribe to ETH/USDT ticker updates via the websocket API
var socketClient = new BinanceSocketClient();
var tickerSubscriptionResult = socketClient.SpotApi.ExchangeData.SubscribeToTickerUpdatesAsync("ETHUSDT", (update) => 
{
  var lastPrice = update.Data.LastPrice;
});

Get started and request the last price of a symbol in 40 seconds

<img src="https://github.com/JKorf/Binance.Net/blob/f74f262151f21b123deecd9b39a717458a18f6ff/docs/Binance.gif" width="600" />

For information on the clients, dependency injection, response processing and more see the Binance.Net documentation, CryptoExchange.Net documentation, or have a look at the examples here or here.

CryptoExchange.Net

Binance.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.

ExchangeRepositoryNuget
BingXJKorf/BingX.NetNuget version
BitfinexJKorf/Bitfinex.NetNuget version
BitgetJKorf/Bitget.NetNuget version
BybitJKorf/Bybit.NetNuget version
CoinExJKorf/CoinEx.NetNuget version
CoinGeckoJKorf/CoinGecko.NetNuget version
Gate.ioJKorf/GateIo.NetNuget version
Huobi/HTXJKorf/Huobi.NetNuget version
KrakenJKorf/Kraken.NetNuget version
KucoinJKorf/Kucoin.NetNuget version
MexcJKorf/Mexc.NetNuget version
OKXJKorf/OKX.NetNuget version

Discord

Nuget version
A Discord server is available here. For discussion and/or questions around the CryptoExchange.Net and implementation libraries, feel free to join.

Supported functionality

Spot/Margin/Savings/Mining

APISupportedLocation
Wallet endpointsrestClient.SpotApi.Account
SubAccount endpointsrestClient.GeneralApi.SubAccount
Market data endpointsrestClient.SpotApi.ExchangeData
Websocket Market StreamssocketClient.SpotApi.ExchangeData
Spot Trading EndpointsrestClient.SpotApi.Trading
Spot Account EndpointsrestClient.SpotApi.Account
Margin Account/TradePartialrestClient.SpotApi.Account / restClient.SpotApi.Trading
User Data StreamssocketClient.SpotApi.Account
Margin User Data StreamsX
Simple Earn EndpointsrestClient.GeneralApi.SimpleEarn
Auto-Invest EndpointsX
Staking EndpointsrestClient.GeneralApi.Staking
Mining EndpointsrestClient.GeneralApi.Mining
FuturesrestClient.GeneralApi.Futures
Futures Algo EndpointsrestClient.UsdFuturesApi.Trading
Spot Algo EndpointsrestClient.SpotApi.Trading
Classic Portfolio Margin EndpointsPartialrestClient.SpotApi.Account
BLVT EndpointsPartialrestClient.SpotApi.Account / restClient.SpotApi.ExchangeData / restClient.SpotApi.Trading
Fiat EndpointsrestClient.SpotApi.Account
C2C EndpointsrestClient.SpotApi.Trading
VIP Loans EndpointsX
Crypto Loans EndpointsPartialrestClient.GeneralApi.Loans
Pay EndpointsrestClient.SpotApi.Trading
Convert EndpointsrestClient.SpotApi.ExchangeData / restClient.SpotApi.Trading
Rebate EndpointsrestClient.SpotApi.Account
NFT EndpointsX
Binance Gift Card EndpointsX

USD-M Futures

APISupportedLocation
Market data EndpointsrestClient.UsdFuturesApi.ExchangeData
Websocket Market StreamssocketClient.UsdFuturesApi
Account/Trades EndpointsrestClient.UsdFuturesApi.Account / restClient.UsdFuturesApi.Trading
User Data StreamssocketClient.UsdFuturesApi
Classic Portfolio Margin EndpointsX

COIN-M Futures

APISupportedLocation
Market data EndpointsrestClient.CoinFuturesApi.ExchangeData
Websocket Market StreamssocketClient.CoinFuturesApi
Account/Trades EndpointsrestClient.CoinFuturesApi.Account / restClient.CoinFuturesApi.Trading
User Data StreamssocketClient.CoinFuturesApi
Classic Portfolio Margin EndpointsX

European Options

APISupportedLocation
*X

Websocket API

APISupportedLocation
Market data requestssocketClient.SpotApi.ExchangeData
Trading requestssocketClient.SpotApi.Trading
Account requestssocketClient.SpotApi.Account

Portfolio Margin

APISupportedLocation
*X

Support the project

I develop and maintain this package on my own for free in my spare time, any support is greatly appreciated.

Donate

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

Sponsor

Alternatively, sponsor me on Github using Github Sponsors.

Release notes