Skip to content

Latest commit

 

History

History
 
 

java

swagger-java-client

Bybit API

  • API version: 1.0.0
    • Build date: 2019-10-10T14:10:24.237+08:00

REST API for the Bybit Exchange.

Automatically generated by the Swagger Codegen

Requirements

Building the API client library requires:

  1. Java 1.7+
  2. Maven/Gradle

Installation

To install the API client library to your local Maven repository, simply execute:

mvn clean install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn clean deploy

Refer to the OSSRH Guide for more information.

Maven users

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>

Gradle users

Add this dependency to your project's build file:

compile "io.swagger:swagger-java-client:1.0.0"

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/swagger-java-client-1.0.0.jar
  • target/lib/*.jar

Getting Started

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.CommonApi;

import java.io.File;
import java.util.*;

public class CommonApiExample {

    public static void main(String[] args) {
        
        CommonApi apiInstance = new CommonApi();
        try {
            Object result = apiInstance.commonGet();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CommonApi#commonGet");
            e.printStackTrace();
        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://localhost

Class Method HTTP request Description
CommonApi commonGet GET /v2/public/time Get bybit server time.
ConditionalApi conditionalCancel POST /open-api/stop-order/cancel 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.
ExecutionApi executionGetTrades GET /v2/private/execution/list Get the trade records of a order.
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 orderGetOrders GET /open-api/order/list Get my active order list.
OrderApi orderNew POST /open-api/order/create Place active order
PositionsApi positionsChangeMargin POST /position/change-position-margin Update margin.
PositionsApi positionsMyPosition GET /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 walletGetRecords GET /open-api/wallet/fund/records Get wallet fund records

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization. Authentication schemes defined for the API:

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Author

support@bybit.com