bybit.net.api 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package bybit.net.api --version 1.0.2                
NuGet\Install-Package bybit.net.api -Version 1.0.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="bybit.net.api" Version="1.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add bybit.net.api --version 1.0.2                
#r "nuget: bybit.net.api, 1.0.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install bybit.net.api as a Cake Addin
#addin nuget:?package=bybit.net.api&version=1.0.2

// Install bybit.net.api as a Cake Tool
#tool nuget:?package=bybit.net.api&version=1.0.2                

Bybit Open API Connector .Net6

Nuget License: MIT Contributor Victor

Table of Contents

About

Bybit.Net.Api offers an official, powerful, and efficient .NET connector to the Bybit public Trading API

Dive into a plethora of functionalities:

  • Market Data Retrieval
  • Trade Execution
  • Position Management
  • Account and Asset Info Retrieval
  • User Management
  • Public Websocket Streaming
  • Private Websocket Streaming

This initiative, originated by the renowned .NET developer Victor, now flourishes under the meticulous care of Bybit's dedicated team of in-house .NET professionals. Your contributions are warmly welcomed and appreciated!

Development

Bybit.Net.Api constantly evolves, keeping pace with the freshest features from Bybit's API. Crafted for efficiency, the library maintains a slim profile by minimizing external dependencies. If you've broadened its horizons or ironed out bugs, we eagerly await your pull request.

Installation

Ensure you're using .NET 6 or newer. This SDK depends on Microsoft.Extensions.Logging 7.0.0 and Newtonsoft 13.0.3. Dotnet CLI

dotnet add package bybit.net.api

Nuget tool

NuGet\Install-Package bybit.net.api

Package reference

<PackageReference Include="bybit.net.api"/>

Usage

RESTful APIs

  • Market Kline
BybitMarketDataService market = new BybitMarketDataService();
var klineInfo = await market.GetMarketKline("spot", "BTCUSDT", "1");
Console.WriteLine(klineInfo);

Authentication - RESTful APIs

  • Place Single Order
BybitTradeService tradeService = new BybitTradeService(apiKey: "xxxxxxxxxxx", apiSecret: "xxxxxxxxxxxxxxxx");
var orderInfo = await tradeService.PlaceOrder(category: Category.LINEAR, symbol: "BLZUSDT", side: Side.BUY, orderType: OrderType.MARKET, qty: "15", timeInForce: TimeInForce.GTC);
Console.WriteLine(orderInfo);
  • Account Wallet
BybitAccountService accountService = new BybitAccountService(apiKey: "xxxxxxxx", apiSecret: "xxxxxxxxxxxxxxx");
var accountInfo = await accountService.GetAccountBalance(accountType: AccountType.Unified);
Console.WriteLine(accountInfo);
  • Position Info
BybitPositionService positionService = new BybitPositionService(apiKey: "xxxxxxxxxxxxxxxxxxxx", apiSecret: "xxxxxxxxxxxxxxxxx");
var positionInfo = await positionService.GetPositionInfo(category: Category.LINEAR, symbol: "BLZUSDT");
Console.WriteLine(positionInfo);

Websocket public channel

  • Trade Subscribe
var websocket = new BybitLinearWebSocket();
websocket.OnMessageReceived(
    (data) =>
    {
        Console.WriteLine(data);
        return Task.CompletedTask;
    }, CancellationToken.None);

await websocket.ConnectAsync(new string[] { "publicTrade.BTCUSDT" }, CancellationToken.None);

Websocket private channel

  • Order Subscribe
var websocket = new BybitPrivateWebsocket(apiKey: "xxxxxxxxx", apiSecret: "xxxxxxxxxxxxxxxxxx");
websocket.OnMessageReceived(
    (data) =>
    {
        Console.WriteLine(data);
        return Task.CompletedTask;
    }, CancellationToken.None);

await websocket.ConnectAsync(new string[] { "order" }, CancellationToken.None);

Contact

For support, join our Bybit API community on Telegram.

Contributors

List of other contributors <table> <tr> <td align="center"> <a href="https://github.com/wuhewuhe"> <img src="https://avatars.githubusercontent.com/u/32245754?v=4" width="100px;" alt=""/> <br /> <sub>
<b>Victor</b> </sub> </a> <br /> <a href="https://github.com/wuhewuhe/bybit.net.api/commits?author=wuhewuhe" title="Code">💻</a> <a href="https://github.com/wuhewuhe/bybit.net.api/commits?author=wuhewuhe" title="Documentation">📖</a> </td> <td align="center"> <a href="https://github.com/dimibatch"> <img src="https://avatars.githubusercontent.com/u/42719618?v=4" width="100px;" alt=""/> <br /> <sub>
<b>Dimitri</b> </sub> </a> <br /> <a href="https://github.com/wuhewuhe/bybit.net.api/commits?author=dimibatch" title="Code">💻</a> <a href="https://github.com/wuhewuhe/bybit.net.api/commits?author=dimibatch" title="Documentation">📖</a> </td> <td align="center"> <a href="https://github.com/Doom-Prince"> <img src="https://avatars.githubusercontent.com/u/124635036?v=4" width="100px;" alt=""/> <br /> <sub>
<b>Doom</b> </sub> </a> <br /> <a href="https://github.com/wuhewuhe/bybit.net.api/commits?author=Doom-Prince" title="Code">💻</a> <a href="https://github.com/wuhewuhe/bybit.net.api/commits?author=Doom-Prince" title="Documentation">📖</a> </td> </tr> </table>

Donations

Your donations keep our development active and our community growing. Donate USDT to our ERC20 Wallet Address.

Note: Replace placeholders (like YOUR_API_KEY, links, or other details) with the actual information. You can also customize this template to better fit the actual state and details of your DotNet API.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.2 1,764 4/16/2024
1.1.1 430 2/22/2024
1.1.0 490 2/6/2024
1.0.9 158 1/27/2024
1.0.8 519 12/19/2023
1.0.7 233 11/19/2023
1.0.6 169 11/12/2023
1.0.5 545 11/2/2023
1.0.4 149 10/29/2023
1.0.3 154 10/27/2023
1.0.2 155 10/24/2023
1.0.1 135 10/22/2023
1.0.0 165 10/22/2023

implemented bybit v5 api and websocket, support market data, Trade and position,
     need to finishall open api endpoint about account, asset, spot margin service and instituion service.