Building the API client library requires Maven to be installed.
To install the API client library to your local Maven repository, simply execute:
mvn install
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn deploy
Refer to the official documentation for more information.
Add this dependency to your project's POM:
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-android-client</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
Add this dependency to your project's build file:
compile "io.swagger:swagger-android-client:1.0.0"
At first generate the JAR by executing:
mvn package
Then manually install the following JARs:
- target/swagger-android-client-1.0.0.jar
- target/lib/*.jar
Please follow the installation instruction and execute the following Java code:
import io.swagger.client.api.APIkeyApi;
public class APIkeyApiExample {
public static void main(String[] args) {
APIkeyApi apiInstance = new APIkeyApi();
try {
Object result = apiInstance.aPIkeyInfo();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling APIkeyApi#aPIkeyInfo");
e.printStackTrace();
}
}
}
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 |
- APIKeyBase
- APIKeyInfo
- AccountRatio
- AccountRatioInfo
- Announcement
- AnnouncementInfo
- BigDeal
- BigDealInfo
- ClosedPnlBase
- ClosedPnlInfo
- ConditionalCancelAllBase
- ConditionalCancelAllRes
- ConditionalOrdersRes
- ConditionalOrdersResBase
- ConditionalRes
- ExchangeOrderList
- ExchangeOrderListBase
- ExtFields
- FundRecordBase
- FundingFeeBase
- FundingFeeRes
- FundingPredicted
- FundingPredictedBase
- FundingRate
- FundingRateBase
- FundingRecords
- GetRiskLimitRes
- KlineBase
- KlineRes
- LCPInfo
- LCPInfoBase
- Leverage
- LeverageInfo
- LeverageResult
- LinearCancelOrderResult
- LinearCancelOrderResultBase
- LinearCancelStopOrderResult
- LinearCancelStopOrderResultBase
- LinearClosePnlRecordsResponse
- LinearClosedPnlRecordResult
- LinearCreateOrderResult
- LinearCreateOrderResultBase
- LinearCreateStopOrderResult
- LinearCreateStopOrderResultBase
- LinearFundingPredicted
- LinearFundingPredictedBase
- LinearKlineResp
- LinearKlineRespBase
- LinearListOrderResult
- LinearListStopOrderResult
- LinearOrderCancelAllBase
- LinearOrderRecordsResponse
- LinearOrderRecordsResponseBase
- LinearOrderReplace
- LinearPositionListResult
- LinearPositionListResultBase
- LinearPrevFundingRateResp
- LinearPrevFundingRateRespBase
- LinearPrevFundingResp
- LinearPrevFundingRespBase
- LinearRecentTradingRecordResp
- LinearRecentTradingRecordRespBase
- LinearRiskLimitResp
- LinearRiskLimitRespBase
- LinearSearchOrderResult
- LinearSearchOrderResultBase
- LinearSearchStopOrderResult
- LinearSearchStopOrderResultBase
- LinearSetLeverageResult
- LinearSetMarginResult
- LinearSetMarginResultBase
- LinearSetTradingStopResult
- LinearStopOrderCancelAllBase
- LinearStopOrderRecordsResponse
- LinearStopOrderRecordsResponseBase
- LinearStopOrderReplace
- LinearSwitchIsolatedResult
- LinearSwitchModeResult
- LinearTradeRecordItem
- LinearTradeRecordsResponse
- LiqRecords
- LiqRecordsInfo
- LotSizeFilter
- MarkPriceKlineBase
- MarkPriceKlineInfo
- OderBookRes
- OpenInterest
- OpenInterestInfo
- OrderBookBase
- OrderCancelAllBase
- OrderCancelAllRes
- OrderCancelBase
- OrderIdRes
- OrderRes
- OrderResBase
- Position
- PositionInfo
- PriceFilter
- QueryOrderBase
- QueryOrderRes
- ReplaceConditionalBase
- ReplaceOrderBase
- RiskIDRes
- RiskLimitBase
- RiskLimitRes
- ServerTime
- SetRiskLimitBase
- StopOrderOrdersResBase
- SymbolInfo
- SymbolInfoBase
- SymbolTickInfo
- Symbols
- TradeRecords
- TradeRecordsBase
- TradeRecordsInfo
- TradingRecords
- TradingRecordsInfo
- TradingStopBase
- TradingStopRes
- V2CancelOrderBase
- V2ConditionalBase
- V2ConditionalListRes
- V2ConditionalRes
- V2OrderListBase
- V2OrderListData
- V2OrderRes
- WalletBalance
- WalletBalanceBase
- WithdrawRecords
- WithdrawResBase
Authentication schemes defined for the API:
- 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
It's recommended to create an instance of ApiClient
per thread in a multithreaded environment to avoid any potential issues.