Bybit API
- API version: 1.0.0
- Build date: 2020-03-06T15:36:40.091+08:00
REST API for the Bybit Exchange. Base URI: [https://api-testnet.bybit.com]
Automatically generated by the Swagger Codegen
Building the API client library requires:
- Java 1.7+
- Maven/Gradle
To install the API client library to your local Maven repository, simply execute:
mvn clean installTo deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn clean deployRefer to the OSSRH Guide for more information.
Add this dependency to your project's POM:
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-java-client</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>Add this dependency to your project's build file:
compile "io.swagger:swagger-java-client:1.0.0"At first generate the JAR by executing:
mvn clean packageThen manually install the following JARs:
target/swagger-java-client-1.0.0.jartarget/lib/*.jar
Please follow the installation instruction and execute the following Java code:
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ApIkeyApi;
import java.io.File;
import java.util.*;
public class ApIkeyApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: apiKey
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("apiKey");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");
// Configure API key authorization: apiSignature
ApiKeyAuth apiSignature = (ApiKeyAuth) defaultClient.getAuthentication("apiSignature");
apiSignature.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiSignature.setApiKeyPrefix("Token");
// Configure API key authorization: timestamp
ApiKeyAuth timestamp = (ApiKeyAuth) defaultClient.getAuthentication("timestamp");
timestamp.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//timestamp.setApiKeyPrefix("Token");
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-testnet.bybit.com
| Class | Method | HTTP request | Description |
|---|---|---|---|
| ApIkeyApi | aPIkeyInfo | GET /open-api/api-key | Get account api-key information. |
| CommonApi | commonGet | GET /v2/public/time | Get bybit server time. |
| ConditionalApi | conditionalCancel | POST /open-api/stop-order/cancel | Cancel conditional order. |
| ConditionalApi | conditionalCancelAll | POST /v2/private/stop-order/cancelAll | Cancel conditional order. |
| ConditionalApi | conditionalGetOrders | GET /open-api/stop-order/list | Get my conditional order list. |
| ConditionalApi | conditionalNew | POST /open-api/stop-order/create | Place a new conditional order. |
| ConditionalApi | conditionalReplace | POST /open-api/stop-order/replace | Replace conditional order. Only incomplete orders can be modified. |
| ExecutionApi | executionGetTrades | GET /v2/private/execution/list | Get user’s trade records. |
| FundingApi | fundingGetRate | 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 | fundingPredictedRate | GET /open-api/funding/prev-funding-rate | Get predicted funding rate and funding fee. |
| KlineApi | klineGet | GET /v2/public/kline/list | Query historical kline. |
| MarketApi | marketOrderbook | GET /v2/public/orderBook/L2 | Get the orderbook. |
| MarketApi | marketSymbolInfo | GET /v2/public/tickers | Get the latest information for symbol. |
| OrderApi | orderCancel | POST /open-api/order/cancel | Get my active order list. |
| OrderApi | orderCancelAll | POST /v2/private/order/cancelAll | Get my active order list. |
| OrderApi | orderCancelV2 | POST /v2/private/order/cancel | Get my active order list. |
| OrderApi | orderGetOrders | GET /open-api/order/list | Get my active order list. |
| OrderApi | orderNew | POST /open-api/order/create | Place active order |
| OrderApi | orderNewV2 | POST /v2/private/order/create | Place active order |
| OrderApi | orderQuery | GET /v2/private/order | Get my active order list. |
| OrderApi | orderReplace | POST /open-api/order/replace | Replace active order. Only incomplete orders can be modified. |
| PositionsApi | positionsChangeMargin | POST /position/change-position-margin | Update margin. |
| PositionsApi | positionsMyPosition | GET /position/list | Get my position list. |
| PositionsApi | positionsMyPositionV2 | 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. |
| PositionsApi | positionsUserLeverage | GET /user/leverage | Get user leverage setting. |
| SymbolApi | symbolGet | GET /v2/public/symbols | Query Symbols. |
| 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
- ConditionalBase
- ConditionalCancelAllBase
- ConditionalCancelAllRes
- ConditionalOrdersRes
- ConditionalOrdersResBase
- ConditionalRes
- ExtFields
- FundRecordBase
- FundingFeeBase
- FundingFeeRes
- FundingPredicted
- FundingPredictedBase
- FundingRate
- FundingRateBase
- FundingRecords
- GetRiskLimitRes
- KlineBase
- KlineRes
- Leverage
- LeverageInfo
- LeverageResult
- LotSizeFilter
- OderBookRes
- OrderBookBase
- OrderCancelAllBase
- OrderCancelAllRes
- OrderCancelBase
- OrderListBase
- OrderListData
- OrderRes
- OrderResBase
- Position
- PositionInfo
- PriceFilter
- QueryOrderBase
- QueryOrderRes
- ReplaceConditionalBase
- ReplaceOrderBase
- RiskIDRes
- RiskLimitBase
- RiskLimitRes
- ServerTime
- SetRiskLimitBase
- SymbolInfo
- SymbolInfoBase
- SymbolTickInfo
- Symbols
- TradeRecords
- TradeRecordsBase
- TradeRecordsInfo
- TradingStopBase
- TradingStopRes
- 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.