REST API for the Bybit Exchange. Base URI: [https://api.bybit.com]
This C# SDK is automatically generated by the Swagger Codegen project:
- API version: 0.2.10
- SDK version: 1.0.0
- Build package: io.swagger.codegen.languages.CSharpClientCodegen
- .NET 4.0 or later
- Windows Phone 7.1 (Mango)
- RestSharp - 105.1.0 or later
- Json.NET - 7.0.0 or later
- JsonSubTypes - 1.2.0 or later
The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:
Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742
Run the following command to generate the DLL
- [Mac/Linux]
/bin/sh build.sh
- [Windows]
build.bat
Then include the DLL (under the bin
folder) in the C# project, and use the namespaces:
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
A .nuspec
is included with the project. You can follow the Nuget quickstart to create and publish packages.
This .nuspec
uses placeholders from the .csproj
, so build the .csproj
directly:
nuget pack -Build -OutputDirectory out IO.Swagger.csproj
Then, publish to a local feed or other host and consume the new package via Nuget as usual.
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class Example
{
public void main()
{
// Configure API key authorization: apiKey
Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer");
// Configure API key authorization: apiSignature
Configuration.Default.ApiKey.Add("sign", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("sign", "Bearer");
// Configure API key authorization: timestamp
Configuration.Default.ApiKey.Add("timestamp", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("timestamp", "Bearer");
var apiInstance = new APIkeyApi();
try
{
// Get account api-key information.
Object result = apiInstance.APIkeyInfo();
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling APIkeyApi.APIkeyInfo: " + e.Message );
}
}
}
}
All URIs are relative to https://api.bybit.com
Class | Method | HTTP request | Description |
---|---|---|---|
APIkeyApi | APIkeyInfo | GET /open-api/api-key | Get account api-key information. |
CommonApi | CommonAnnouncements | GET /v2/public/announcement | Get Bybit OpenAPI announcements in the last 30 days in reverse order. |
CommonApi | CommonGetLcp | GET /v2/private/account/lcp | Query LCP info. |
CommonApi | CommonGetTime | GET /v2/public/time | Get bybit server time. |
ConditionalApi | ConditionalCancel | POST /v2/private/stop-order/cancel | Cancel conditional order. |
ConditionalApi | ConditionalCancelAll | POST /v2/private/stop-order/cancelAll | Cancel conditional order. |
ConditionalApi | ConditionalGetOrders | GET /v2/private/stop-order/list | Get my conditional order list. |
ConditionalApi | ConditionalNew | POST /v2/private/stop-order/create | Place a new conditional order. |
ConditionalApi | ConditionalQuery | GET /v2/private/stop-order | Query real-time stop order information. |
ConditionalApi | ConditionalReplace | POST /v2/private/stop-order/replace | Replace conditional order. Only incomplete orders can be modified. |
ExecutionApi | ExecutionGetTrades | GET /v2/private/execution/list | Get user’s trade records. |
ExecutionApi | PositionsClosePnlRecords | GET /v2/private/trade/closed-pnl/list | Get user's closed profit and loss records |
FundingApi | FundingMyLastFee | GET /open-api/funding/prev-funding | Funding settlement occurs every 8 hours at 00:00 UTC, 08:00 UTC and 16:00 UTC. The current interval's fund fee settlement is based on the previous interval's fund rate. For example, at 16:00, the settlement is based on the fund rate generated at 8:00. The fund rate generated at 16:00 will be used at 0:00 on the next day. |
FundingApi | FundingPredicted | GET /open-api/funding/predicted-funding | Get predicted funding rate and funding fee. |
FundingApi | FundingPrevRate | GET /open-api/funding/prev-funding-rate | Get predicted funding rate and funding fee. |
KlineApi | KlineGet | GET /v2/public/kline/list | Query historical kline. |
KlineApi | KlineMarkPrice | GET /v2/public/mark-price-kline | Query mark price kline. |
LinearConditionalApi | LinearConditionalCancel | POST /private/linear/stop-order/cancel | Cancel Active Order |
LinearConditionalApi | LinearConditionalCancelAll | POST /private/linear/stop-order/cancel-all | Cancel all stop orders. |
LinearConditionalApi | LinearConditionalGetOrders | GET /private/linear/stop-order/list | Get linear Stop Orders |
LinearConditionalApi | LinearConditionalNew | POST /private/linear/stop-order/create | Create linear stop Order |
LinearConditionalApi | LinearConditionalQuery | GET /private/linear/stop-order/search | Get Stop Orders(real-time) |
LinearConditionalApi | LinearConditionalReplace | POST /private/linear/stop-order/replace | Replace conditional order |
LinearExecutionApi | LinearExecutionGetTrades | GET /private/linear/trade/execution/list | Get user's trading records. |
LinearFundingApi | LinearFundingMyLastFee | GET /private/linear/funding/prev-funding | Get prev funding |
LinearFundingApi | LinearFundingPredicted | GET /private/linear/funding/predicted-funding | Get predicted funding rate and funding fee. |
LinearFundingApi | LinearFundingPrevRate | GET /public/linear/funding/prev-funding-rate | Get prev funding |
LinearKlineApi | LinearKlineGet | GET /public/linear/kline | Get kline |
LinearKlineApi | LinearKlineMarkPrice | GET /public/linear/mark-price-kline | Get kline |
LinearMarketApi | LinearMarketTrading | GET /public/linear/recent-trading-records | Get recent trades |
LinearOrderApi | LinearOrderCancel | POST /private/linear/order/cancel | Cancel Active Order |
LinearOrderApi | LinearOrderCancelAll | POST /private/linear/order/cancel-all | Cancel all active orders. |
LinearOrderApi | LinearOrderGetOrders | GET /private/linear/order/list | Get linear Active Orders |
LinearOrderApi | LinearOrderNew | POST /private/linear/order/create | Create Active Order |
LinearOrderApi | LinearOrderQuery | GET /private/linear/order/search | Get Active Orders(real-time) |
LinearOrderApi | LinearOrderReplace | POST /private/linear/order/replace | Replace Active Order |
LinearPositionsApi | LinearPositionsChangeMargin | POST /private/linear/position/add-margin | Add/Reduce Margin |
LinearPositionsApi | LinearPositionsClosePnlRecords | GET /private/linear/trade/closed-pnl/list | Get user's closed profit and loss records. |
LinearPositionsApi | LinearPositionsMyPosition | GET /private/linear/position/list | Get my position list. |
LinearPositionsApi | LinearPositionsSaveLeverage | POST /private/linear/position/set-leverage | Set leverage |
LinearPositionsApi | LinearPositionsSetAutoAddMargin | POST /private/linear/position/set-auto-add-margin | Set auto add margin |
LinearPositionsApi | LinearPositionsSwitchIsolated | POST /private/linear/position/switch-isolated | Switch isolated |
LinearPositionsApi | LinearPositionsSwitchMode | POST /private/linear/tpsl/switch-mode | Switch Mode |
LinearPositionsApi | LinearPositionsTradingStop | POST /private/linear/position/trading-stop | Set tradingStop |
LinearWalletApi | LinearWalletGetRiskLimit | GET /public/linear/risk-limit | Get risk limit. |
MarketApi | MarketAccountRatio | GET /v2/public/account-ratio | Query Account Long Short Ratio |
MarketApi | MarketBigDeal | GET /v2/public/big-deal | Query Big Deal |
MarketApi | MarketLiqRecords | GET /v2/public/liq-records | Query liq records. |
MarketApi | MarketOpenInterest | GET /v2/public/open-interest | Query Open Interest |
MarketApi | MarketOrderbook | GET /v2/public/orderBook/L2 | Get the orderbook. |
MarketApi | MarketSymbolInfo | GET /v2/public/tickers | Get the latest information for symbol. |
MarketApi | MarketTradingRecords | GET /v2/public/trading-records | Get recent trades |
OrderApi | OrderCancel | POST /v2/private/order/cancel | Get my active order list. |
OrderApi | OrderCancelAll | POST /v2/private/order/cancelAll | Get my active order list. |
OrderApi | OrderGetOrders | GET /v2/private/order/list | Get my active order list. |
OrderApi | OrderNew | POST /v2/private/order/create | Place active order |
OrderApi | OrderQuery | GET /v2/private/order | Get my active order list. |
OrderApi | OrderReplace | POST /v2/private/order/replace | Replace active order. Only incomplete orders can be modified. |
PositionsApi | PositionsChangeMargin | POST /position/change-position-margin | Update margin. |
PositionsApi | PositionsClosePnlRecords | GET /v2/private/trade/closed-pnl/list | Get user's closed profit and loss records |
PositionsApi | PositionsMyPosition | GET /v2/private/position/list | Get my position list. |
PositionsApi | PositionsSaveLeverage | POST /user/leverage/save | Change user leverage. |
PositionsApi | PositionsTradingStop | POST /open-api/position/trading-stop | Set Trading-Stop Condition. |
SymbolApi | SymbolGet | GET /v2/public/symbols | Query Symbols. |
WalletApi | WalletExchangeOrder | GET /v2/private/exchange-order/list | Asset Exchange Records |
WalletApi | WalletGetBalance | GET /v2/private/wallet/balance | get wallet balance info |
WalletApi | WalletGetRecords | GET /open-api/wallet/fund/records | Get wallet fund records |
WalletApi | WalletGetRiskLimit | GET /open-api/wallet/risk-limit/list | Get risk limit. |
WalletApi | WalletSetRiskLimit | POST /open-api/wallet/risk-limit | Set risk limit |
WalletApi | WalletWithdraw | GET /open-api/wallet/withdraw/list | Get wallet fund records |
- Model.APIKeyBase
- Model.APIKeyInfo
- Model.AccountRatio
- Model.AccountRatioInfo
- Model.Announcement
- Model.AnnouncementInfo
- Model.BigDeal
- Model.BigDealInfo
- Model.ClosedPnlBase
- Model.ClosedPnlInfo
- Model.ConditionalCancelAllBase
- Model.ConditionalCancelAllRes
- Model.ConditionalOrdersRes
- Model.ConditionalOrdersResBase
- Model.ConditionalRes
- Model.ExchangeOrderList
- Model.ExchangeOrderListBase
- Model.ExtFields
- Model.FundRecordBase
- Model.FundingFeeBase
- Model.FundingFeeRes
- Model.FundingPredicted
- Model.FundingPredictedBase
- Model.FundingRate
- Model.FundingRateBase
- Model.FundingRecords
- Model.GetRiskLimitRes
- Model.KlineBase
- Model.KlineRes
- Model.LCPInfo
- Model.LCPInfoBase
- Model.Leverage
- Model.LeverageInfo
- Model.LeverageResult
- Model.LinearCancelOrderResult
- Model.LinearCancelOrderResultBase
- Model.LinearCancelStopOrderResult
- Model.LinearCancelStopOrderResultBase
- Model.LinearClosePnlRecordsResponse
- Model.LinearClosedPnlRecordResult
- Model.LinearCreateOrderResult
- Model.LinearCreateOrderResultBase
- Model.LinearCreateStopOrderResult
- Model.LinearCreateStopOrderResultBase
- Model.LinearFundingPredicted
- Model.LinearFundingPredictedBase
- Model.LinearKlineResp
- Model.LinearKlineRespBase
- Model.LinearListOrderResult
- Model.LinearListStopOrderResult
- Model.LinearOrderCancelAllBase
- Model.LinearOrderRecordsResponse
- Model.LinearOrderRecordsResponseBase
- Model.LinearOrderReplace
- Model.LinearPositionListResult
- Model.LinearPositionListResultBase
- Model.LinearPrevFundingRateResp
- Model.LinearPrevFundingRateRespBase
- Model.LinearPrevFundingResp
- Model.LinearPrevFundingRespBase
- Model.LinearRecentTradingRecordResp
- Model.LinearRecentTradingRecordRespBase
- Model.LinearRiskLimitResp
- Model.LinearRiskLimitRespBase
- Model.LinearSearchOrderResult
- Model.LinearSearchOrderResultBase
- Model.LinearSearchStopOrderResult
- Model.LinearSearchStopOrderResultBase
- Model.LinearSetLeverageResult
- Model.LinearSetMarginResult
- Model.LinearSetMarginResultBase
- Model.LinearSetTradingStopResult
- Model.LinearStopOrderCancelAllBase
- Model.LinearStopOrderRecordsResponse
- Model.LinearStopOrderRecordsResponseBase
- Model.LinearStopOrderReplace
- Model.LinearSwitchIsolatedResult
- Model.LinearSwitchModeResult
- Model.LinearTradeRecordItem
- Model.LinearTradeRecordsResponse
- Model.LiqRecords
- Model.LiqRecordsInfo
- Model.LotSizeFilter
- Model.MarkPriceKlineBase
- Model.MarkPriceKlineInfo
- Model.OderBookRes
- Model.OpenInterest
- Model.OpenInterestInfo
- Model.OrderBookBase
- Model.OrderCancelAllBase
- Model.OrderCancelAllRes
- Model.OrderCancelBase
- Model.OrderIdRes
- Model.OrderRes
- Model.OrderResBase
- Model.Position
- Model.PositionInfo
- Model.PriceFilter
- Model.QueryOrderBase
- Model.QueryOrderRes
- Model.ReplaceConditionalBase
- Model.ReplaceOrderBase
- Model.RiskIDRes
- Model.RiskLimitBase
- Model.RiskLimitRes
- Model.ServerTime
- Model.SetRiskLimitBase
- Model.StopOrderOrdersResBase
- Model.SymbolInfo
- Model.SymbolInfoBase
- Model.SymbolTickInfo
- Model.Symbols
- Model.TradeRecords
- Model.TradeRecordsBase
- Model.TradeRecordsInfo
- Model.TradingRecords
- Model.TradingRecordsInfo
- Model.TradingStopBase
- Model.TradingStopRes
- Model.V2CancelOrderBase
- Model.V2ConditionalBase
- Model.V2ConditionalListRes
- Model.V2ConditionalRes
- Model.V2OrderListBase
- Model.V2OrderListData
- Model.V2OrderRes
- Model.WalletBalance
- Model.WalletBalanceBase
- Model.WithdrawRecords
- Model.WithdrawResBase
- Type: API key
- API key parameter name: api_key
- Location: URL query string
- Type: API key
- API key parameter name: sign
- Location: URL query string
- Type: API key
- API key parameter name: timestamp
- Location: URL query string