Mexc.Net is a client library for accessing the Mexc 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.
The library is targeting both .NET Standard 2.0
and .NET Standard 2.1
for optimal compatibility
.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 JK.Mexc.Net
- REST Endpoints
// Get the ETH/USDT ticker via rest request var restClient = new MexcRestClient(); 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 MexcSocketClient(); var tickerSubscriptionResult = socketClient.SpotApi.SubscribeToMiniTickerUpdatesAsync("ETHUSDT", (update) => { var lastPrice = update.Data.LastPrice; });
For information on the clients, dependency injection, response processing and more see the documentation, or have a look at the examples here.
Mexc.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 |
---|---|---|
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/HTX | JKorf/Huobi.Net | |
Kraken | JKorf/Kraken.Net | |
Kucoin | JKorf/Kucoin.Net | |
OKX | JKorf/OKX.Net |
A Discord server is available here. Feel free to join for discussion and/or questions around the CryptoExchange.Net and implementation libraries.
API | Supported | Location |
---|---|---|
Market Data Endpoints | ✓ | restClient.SpotApi.ExchangeData |
SubAccount Endpoints | X | |
Acount/Trade | ✓ | restClient.SpotApi.Account / restClient.SpotApi.Trading |
Wallet endpoints | ✓ | restClient.SpotApi.Account |
Websocket Market Streams | ✓ | socketClient.SpotApi |
Websocket User Data Streams | ✓ | socketClient.SpotApi |
Futures is not currently available in the MEXC API
API | Supported | Location |
---|---|---|
* | X |
API | Supported | Location |
---|---|---|
* | X |
I develop and maintain this package on my own for free in my spare time, 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: bc1qz0jv0my7fc60rxeupr23e75x95qmlq6489n8gh
Eth: 0xcb1b63aCF9fef2755eBf4a0506250074496Ad5b7
Alternatively, sponsor me on Github using Github Sponsors.
- Version 1.0.0 - 25 Feb 2024
- Initial release