Bybit API Usage Examples

repository·master·Indexed 42 days ago

https://github.com/bybit-exchange/api-usage-examples

Reference implementation and example API wrappers for interacting with Bybit REST API and WebSocket services across various programming languages.

Tokens
1.1K
Snippets
2
Records
4
Agent score
3%

What's inside Bybit

  1. Overview of Bybit API usage examples

    master
    This repository provides example API wrappers for interacting with the Bybit REST API and WebSocket. It serves as a reference implementation for developers looking to integrate Bybit's exchange services into their applications using various programming languages.
  2. Set up Google Sheets API credentials

    master

    To use the Google Sheets API in your application, follow these steps in the Google Cloud Console:

    1. Create a Project: Go to the Google Cloud Console, select the project drop-down, choose New Project, enter a name, and click Create.
    2. Enable the API: Navigate to API & Services > Library, search for "Google Sheets API", select it, and click Enable.
    3. Create Credentials:
      • Navigate to API & Services > Credentials.
      • Click Create Credentials and select OAuth 2.0 Client ID.
      • Choose Desktop App as the application type.
      • Click Create and note your Client ID and Client Secret.
      • Download the credentials.json file using the download icon.
    4. Integration: Move credentials.json to your project's root directory or a known path to use it for authentication.

    Security Warning: Keep credentials.json private. Never commit it to public repositories.

  3. Configure dependencies for Java Google Sheets API

    master

    Add the following Maven dependencies to your pom.xml to support Google Sheets API integration, including OAuth authentication, HTTP clients, and Excel/Spreadsheet handling (Apache POI).

    <!-- Maven -->
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>2.13.1</version>
    </dependency>
    <dependency>
      <groupId>com.squareup.okhttp3</groupId>
      <artifactId>okhttp</artifactId>
      <version>4.9.2</version>
    </dependency>
    <dependency>
      <groupId>org.apache.poi</groupId>
      <artifactId>poi</artifactId>
      <version>5.1.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.poi</groupId>
      <artifactId>poi-ooxml</artifactId>
      <version>5.1.0</version>
    </dependency>
    <dependency>
      <groupId>com.google.oauth-client</groupId>
      <artifactId>google-oauth-client</artifactId>
      <version>1.30.6</version>
    </dependency>
    <dependency>
      <groupId>com.google.oauth-client</groupId>
      <artifactId>google-oauth-client-java6</artifactId>
      <version>1.30.6</version>
    </dependency>
    <dependency>
      <groupId>com.google.apis</groupId>
      <artifactId>google-api-services-sheets</artifactId>
      <version>v4-rev612-1.25.0</version>
    </dependency>
    <dependency>
      <groupId>com.google.http-client</groupId>
      <artifactId>google-http-client-gson</artifactId>
      <version>1.39.2</version>
    </dependency>
    <dependency>
      <groupId>com.google.oauth-client</groupId>
      <artifactId>google-oauth-client-jetty</artifactId>
      <version>1.30.6</version>
    </dependency>