Skip to content
This repository has been archived by the owner on Nov 25, 2021. It is now read-only.

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Go API client for swagger

REST API for the Bybit Exchange. Base URI: [https://api.bybit.com]

Overview

This API client was generated by the swagger-codegen project. By using the swagger-spec from a remote server, you can easily generate an API client.

  • API version: 0.2.10
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.languages.GoClientCodegen

Installation

Put the package under your project folder and add the following in import:

import "./swagger"

Documentation for API Endpoints

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

Documentation For Models

Documentation For Authorization

apiKey

  • Type: API key

Example

auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{
	Key: "APIKEY",
	Prefix: "Bearer", // Omit if not necessary.
})
r, err := client.Service.Operation(auth, args)

apiSignature

  • Type: API key

Example

auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{
	Key: "APIKEY",
	Prefix: "Bearer", // Omit if not necessary.
})
r, err := client.Service.Operation(auth, args)

timestamp

  • Type: API key

Example

auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{
	Key: "APIKEY",
	Prefix: "Bearer", // Omit if not necessary.
})
r, err := client.Service.Operation(auth, args)

Author

[email protected]