SDK repo Gunbot docs Homepage

Gunbot SDK JS (v1)

Download OpenAPI specification:

The Gunbot SDK JS enables you to programmatically interact with Gunbot, a self-hosted trading bot for crypto, ETFs and stocks.

It's a single API client with which you can control automated trading operations on many exchanges. Gunbot includes unique built-in strategies, it can also run custom strategy code in js. This client lets you orchestrate and monitor trading bots.

The API client accepts and returns data in JSON format.

It uses standard HTTP response codes to indicate request outcomes:

  • 200 OK – The request was successful
  • 400 Bad Request – The request was invalid or cannot be processed
  • 401 Unauthorized – Authentication failed or the user lacks permissions
  • 500 Internal Server Error – A server-side error occurred

Gunbot Workflow

  1. Add the trading pair to the configuration with a valid strategy.
  2. Start the core to activate trading operations.

After completing these steps you can access market-data and trading endpoints. Gunbot will actively monitor and execute strategies for the specified pairs.

Encryption Helpers

Gunbot uses password encryption. Refer to the original documentation for helper snippets in JavaScript (Browser/Node.js), Bash and Python.

Supported Exchanges

Gunbot ships with native connectors for more than two dozen exchanges, covering spot, futures and on-chain derivatives.

Exchange Spot Futures / Perps DeFi (on-chain) Extra notes
Binance ✔️ ✔️ (USD-M & COIN-M) Largest liquidity
Binance US ✔️ US-regulated arm
Bitget ✔️ ✔️ (USDT & UM perps)
Bybit ✔️ ✔️ (USDT & inverse perps)
OKX ✔️ ✔️ (Perps & dated futures)
Kraken ✔️ ✔️ (via Kraken Futures)
KuCoin ✔️
Gate.io ✔️
MEXC ✔️
BingX ✔️
Crypto.com ✔️
Huobi Global ✔️
Bitfinex ✔️
HitBTC ✔️
Coinbase Advanced Trade ✔️ Former Coinbase Pro
CEX.io ✔️
Poloniex ✔️
Alpaca (stocks & crypto) ✔️
dYdX (v3/v4) ✔️ ✔️ Perpetual DEX
HyperLiquid ✔️ ✔️ ✔️ DeFi perps
PancakeSwap ✔️ ✔️ BSC DEX
Bitmex / Bitmex Testnet ✔️

Gunbot

All Gunbot endpoints

authLogin — Login User

Authenticate a user and obtain a JSON Web Token (JWT).

Authorizations:
BearerAuth
Request Body schema: application/json
required
password
required
string

The user's encrypted password. See encryption helpers in the original documentation.

Responses

Request samples

Content type
application/json
{
  • "password": "ENC:your_encrypted_password_base64"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE4MTEwNjM4NTIsImlhdCI6MTczMzMXAwSnRyVi5JWmEwd0Vrc3lULnVCOVYxWXRObjAwRVB6NXlwTWo4UjRPblJoOFl1WGhxIn0.h1QiXh3EGl_LCqh0cgBTBle2ALgjSNhZPN9uwpvug6c"
}

authStatus — Get Authentication Status

Validate the current session's authentication status using the provided token.

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "isDemo": false,
  • "isRegistered": true,
  • "isTwoFA": false,
  • "metamask": false,
  • "status": "success",
  • "message": "Authenticated"
}

balances — Get Asset Balances

Retrieve asset balances across exchanges for the authenticated user.

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

assetsTotal — Get Historical Total Asset Value

Retrieve historical total asset value in a base currency over a time range.

Authorizations:
BearerAuth
Request Body schema: application/json
required
exchange
required
string

Exchange name (e.g., binance).

base
required
string

Base currency to value the assets in (e.g., USDT).

start
required
integer <int64>

Start timestamp in milliseconds since Unix epoch.

end
required
integer <int64>

End timestamp in milliseconds since Unix epoch.

Responses

Request samples

Content type
application/json
{
  • "exchange": "binance",
  • "base": "USDT",
  • "start": 0,
  • "end": 1733307452718
}

Response samples

Content type
application/json
[
  • {
    }
]

pairs — Get Trading Pairs

Retrieve a list of trading pairs for a specified exchange. The exchange parameter should be URL-encoded if it contains special characters (e.g., # as %23).

Authorizations:
BearerAuth
query Parameters
exchange
required
string
Example: exchange=binance%233

Exchange name (e.g., binance%233).

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "pairList": [
    ]
}

pairsDetailed — Get Detailed Trading Pairs

Retrieve detailed trading pair information for a specified exchange. The exchange parameter should be URL-encoded if it contains special characters.

Authorizations:
BearerAuth
query Parameters
exchange
required
string
Example: exchange=binance%233

Exchange name (e.g., binance%233).

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "pairList": {
    }
}

configFull — Get Full Configuration

Retrieve the entire application configuration.

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "config": {
    }
}

configUpdate — Update Full Configuration

Update the entire configuration with a new object.

Authorizations:
BearerAuth
Request Body schema: application/json
required
required
object (GunbotConfig)

Represents the Gunbot configuration structure. This is a simplified placeholder; the actual config is deeply nested.

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "config": {
    }
}

configPairAdd — Add Trading Pair to Configuration

Add a new trading pair to the configuration.

Authorizations:
BearerAuth
Request Body schema: application/json
required
pair
required
string

The trading pair to add (e.g., USDT-PEPE).

exchange
required
string

The exchange name (e.g., binance).

object
Default: {}

(Optional) Specific settings for the trading pair.

Responses

Request samples

Content type
application/json
{
  • "pair": "USDT-PEPE",
  • "exchange": "binance",
  • "settings": { }
}

Response samples

Content type
application/json
{
  • "status": "success"
}

configPairRemove — Remove Trading Pair from Configuration

Remove a trading pair from the configuration.

Authorizations:
BearerAuth
Request Body schema: application/json
required
pair
required
string

The trading pair to remove (e.g., USDT-PEPE).

exchange
required
string

The exchange name (e.g., binance).

Responses

Request samples

Content type
application/json
{
  • "pair": "USDT-PEPE",
  • "exchange": "binance"
}

Response samples

Content type
application/json
{
  • "status": "success"
}

configStrategyAdd — Add Trading Strategy to Configuration

Add a new trading strategy to the configuration.

Authorizations:
BearerAuth
Request Body schema: application/json
required
name
required
string

The name of the strategy to add (e.g., myStrategy).

object
Default: {}

(Optional) Specific settings for the strategy.

Responses

Request samples

Content type
application/json
{
  • "name": "myStrategy",
  • "settings": { }
}

Response samples

Content type
application/json
{
  • "status": "success"
}

configStrategyRemove — Remove Trading Strategy from Configuration

Remove a trading strategy from the configuration.

Authorizations:
BearerAuth
Request Body schema: application/json
required
name
required
string

The name of the strategy to remove.

Responses

Request samples

Content type
application/json
{
  • "name": "myStrategy"
}

Response samples

Content type
application/json
{
  • "status": "success"
}

filesAcvar — List AutoConfig Variable Files

List filenames of available AutoConfig variable files.

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "result": [
    ]
}

filesAcvarGet — Get AutoConfig Variable File Content

Retrieve the content of a specified AutoConfig variable file.

Authorizations:
BearerAuth
Request Body schema: application/json
required
filename
required
string

The name of the file to retrieve.

Responses

Request samples

Content type
application/json
{
  • "filename": "string"
}

Response samples

Content type
application/json
{
  • "this": 0.1855499735435755,
  • "pnd": false
}

filesAutoconfigWrite — Write to autoconfig.json File

Write content to the autoconfig.json file.

Authorizations:
BearerAuth
Request Body schema: application/json
required
required
object or string

The content to write into the file.

Responses

Request samples

Content type
application/json
{
  • "document": { }
}

Response samples

Content type
application/json
{
  • "status": "success"
}

filesBackup — List Backup Files

List available backup files.

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "result": [
    ]
}

filesBackupGet — Get Backup File Content

Retrieve the content of a specified backup config file.

Authorizations:
BearerAuth
Request Body schema: application/json
required
filename
required
string

The name of the file to retrieve.

Responses

Request samples

Content type
application/json
{
  • "filename": "string"
}

Response samples

Content type
application/json
{
  • "key": "value"
}

filesCustomEditorGet — Get Custom Strategy Editor File Content

Retrieve the content of the custom strategy editor file.

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{ }

filesCustomEditorWrite — Write to Custom Strategy Editor File

Write content to the custom strategy editor file.

Authorizations:
BearerAuth
Request Body schema: application/json
required
required
object or string

The content to write into the file.

Responses

Request samples

Content type
application/json
{
  • "document": { }
}

Response samples

Content type
application/json
{
  • "status": "success"
}

filesState — List State Files

List filenames of available state files.

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "result": [
    ]
}

filesStateGet — Get State File Content

Retrieve the content of a specific state file.

Authorizations:
BearerAuth
Request Body schema: application/json
required
filename
required
string

The name of the file to retrieve.

Responses

Request samples

Content type
application/json
{
  • "filename": "string"
}

Response samples

Content type
application/json
{
  • "orders": [
    ],
  • "balances": { }
}

filesStrategy — List Custom Strategy Files

List filenames of available custom strategy files (JavaScript files).

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "result": [
    ]
}

filesStrategyGet — Get Custom Strategy File Content

Retrieve the content of a specific custom strategy file. The response is the raw content of the file, likely JavaScript code, wrapped in a JSON object.

Authorizations:
BearerAuth
Request Body schema: application/json
required
filename
required
string

The name of the file to retrieve.

Responses

Request samples

Content type
application/json
{
  • "filename": "string"
}

Response samples

Content type
application/json
{ }

filesStrategyWrite — Write to Custom Strategy File

Write JavaScript code content to a specific custom strategy file.

Authorizations:
BearerAuth
Request Body schema: application/json
required
filename
required
string
document
required
string

The content to write into the strategy file.

Responses

Request samples

Content type
application/json
{
  • "filename": "best_strategy.js",
  • "document": "// Test Strategy"
}

Response samples

Content type
application/json
{
  • "status": "success"
}

filesStrategyDelete — Delete Custom Strategy File

Delete a specific custom strategy file.

Authorizations:
BearerAuth
Request Body schema: application/json
required
filename
required
string

The name of the file to retrieve.

Responses

Request samples

Content type
application/json
{
  • "filename": "string"
}

Response samples

Content type
application/json
{
  • "status": "success"
}

marketCandles — Get Market Candles (OHLCV)

Retrieve historical OHLCV candle data for a trading pair. The key parameter (exchange/pair) must be URL-encoded.

Authorizations:
BearerAuth
query Parameters
key
required
string
Example: key=binance%2FUSDT-PEPE

URL-encoded trading pair key (e.g., binance%2FUSDT-PEPE).

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

marketOrderbook — Get Market Orderbook

Retrieve current order book (bids and asks) for a trading pair. The key parameter must be URL-encoded.

Authorizations:
BearerAuth
query Parameters
key
required
string
Example: key=binance%2FUSDT-PEPE

URL-encoded trading pair key (e.g., binance%2FUSDT-PEPE).

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

corememRequest — Get Raw Core Memory Data for a Pair

Retrieve raw core memory data for a specific trading pair, optionally filtered by elements.

Authorizations:
BearerAuth
Request Body schema: application/json
required
exchange
required
string
pair
required
string
elements
Array of strings or null

Optional array of elements to filter. If omitted, returns all.

Responses

Request samples

Content type
application/json
{
  • "exchange": "binance",
  • "pair": "BTC-ADA",
  • "elements": [
    ]
}

Response samples

Content type
application/json
{
  • "ABP": 0.000012009454969475356,
  • "Bid": 0.00001137
}

coremem — Get Core Memory Snapshot (All Pairs)

Retrieve a snapshot of relevant core memory data for all active trading pairs. Data is slightly delayed and transformed for frontend use.

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{ }

corememSingle — Get Core Memory Snapshot (Single Pair)

Retrieve a snapshot of relevant core memory data for a single active trading pair. Data is slightly delayed and transformed.

Authorizations:
BearerAuth
Request Body schema: application/json
required
exchange
required
string
pair
required
string

Responses

Request samples

Content type
application/json
{
  • "exchange": "binance",
  • "pair": "USDT-XRP"
}

Response samples

Content type
application/json
{ }

chartData — Get Chart Data (Candles and Indicators)

Retrieve chart data, including candles and indicators, for a specific trading pair.

Authorizations:
BearerAuth
Request Body schema: application/json
required
exchange
required
string
pair
required
string

Responses

Request samples

Content type
application/json
{
  • "exchange": "binance",
  • "pair": "USDT-XRP"
}

Response samples

Content type
application/json
{ }

chartMarks — Get Chart Timescale Marks

Retrieve chart timescale marks (annotations like buy/sell triggers) for a pair and interval.

Authorizations:
BearerAuth
query Parameters
exchange
required
string
Example: exchange=binance
pair
required
string
Example: pair=USDT-XRP
interval
required
string
Example: interval=15

Time interval in minutes.

startTime
required
string
Example: startTime=0

Start time (UNIX timestamp seconds).

endTime
required
string
Example: endTime=2114377200

End time (UNIX timestamp seconds).

Responses

Response samples

Content type
application/json
[
  • {
    }
]

pnlOverview — Get PNL Overview

Retrieve an overview of PNL data, summarized over time periods and trading pairs.

Authorizations:
BearerAuth
Request Body schema: application/json
required
timezone
required
string

IANA timezone string (e.g., Europe/Amsterdam).

keys
required
Array of strings

Array of trading keys (e.g., ['binance/USDT-BTC', 'binance/USDT-XRP']). Use ['All'] for all results.

object or null

Responses

Request samples

Content type
application/json
{
  • "timezone": "Europe/Amsterdam",
  • "keys": [
    ],
  • "dateRange": {
    }
}

Response samples

Content type
application/json
{
  • "today": {
    },
  • "total": {
    },
  • "unit": "USDT"
}

pnlDaily — Get Daily PNL for a Trading Key

Retrieve daily PNL data for a specific trading key within a time range. The key parameter must be URL-encoded.

Authorizations:
BearerAuth
query Parameters
key
required
string
Example: key=binance%2FUSDT-XRP

URL-encoded trading key (e.g. binance%2FUSDT-XRP).

startTimestamp
required
integer <int64>

Start timestamp (ms).

endTimestamp
required
integer <int64>
Example: endTimestamp=1733307452623

End timestamp (ms).

Responses

Response samples

Content type
application/json
{
  • "dateRangeDailyHistory": [
    ],
  • "unmatchedBaseValuePerDateRange": 0
}

pnlDailyPaginated — Get Paginated Daily PNL for a Trading Key

Retrieve paginated daily PNL data for a specific trading key. The key parameter must be URL-encoded.

Authorizations:
BearerAuth
query Parameters
key
required
string
Example: key=binance%2FUSDT-XRP

URL-encoded trading key.

pageNum
required
integer
Example: pageNum=1

Page number.

pageSize
required
integer
Example: pageSize=10

Records per page.

endTime
required
integer <int64>
Example: endTime=1733307452649

End timestamp (ms).

Responses

Response samples

Content type
application/json
{
  • "totalSize": 0,
  • "data": [
    ]
}

pnlSum — Get PNL Sum for an Exchange Key

Retrieve total PNL sum and investment for an exchange key over a time range. The exchange parameter (exchange key) must be URL-encoded.

Authorizations:
BearerAuth
query Parameters
exchange
required
string
Example: exchange=binance%2FUSDT-XRP

URL-encoded exchange key (e.g. binance%2FUSDT-XRP).

startTimestamp
required
integer <int64>

Start timestamp (ms).

endTimestamp
required
integer <int64>
Example: endTimestamp=1733307452649

End timestamp (ms).

Responses

Response samples

Content type
application/json
{
  • "tournamentData": {
    },
  • "data": [
    ]
}

pnlTotal — Get Total PNL for a Trading Key

Retrieve total PNL for a specific trading key. The key parameter must be URL-encoded.

Authorizations:
BearerAuth
query Parameters
key
required
string
Example: key=binance%2FUSDT-XRP

URL-encoded trading key.

Responses

Response samples

Content type
application/json
{ }

systemStart — Start System

Start the Gunbot system. Returns current configuration without private keys.

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "pairs": {
    }
}

systemStop — Stop System

Stop the Gunbot system. Returns current configuration without private keys.

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "pairs": {
    }
}

time — Get Server Time

Retrieve the current server time in milliseconds since Unix epoch.

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "serverTime": 1733307452501
}

licenseKeysEdit — Edit License Keys

Edit license keys for a wallet, optionally verifying with an exchange.

Authorizations:
BearerAuth
Request Body schema: application/json
required
wallet
required
string
required
object

Object containing new license data. Use the entire config.exchanges object. For new keys, set isEncrypted to false.

verifyExchange
required
string

Name of an exchange with valid, registered credentials to authenticate the request.

Responses

Request samples

Content type
application/json
{
  • "wallet": "0xYourWalletAddress",
  • "newLicenses": { },
  • "verifyExchange": "binance"
}

Response samples

Content type
application/json
{
  • "status": "success"
}

tradeBuy — Place Limit Buy Order

Place a limit buy order.

Authorizations:
BearerAuth
Request Body schema: application/json
required
required
object (TradeLimitOrderData)

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Order sent"
}

tradeBuyMarket — Place Market Buy Order

Place a market buy order.

Authorizations:
BearerAuth
Request Body schema: application/json
required
required
object (TradeMarketOrderData)

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Order sent"
}

tradeSell — Place Limit Sell Order

Place a limit sell order.

Authorizations:
BearerAuth
Request Body schema: application/json
required
required
object (TradeLimitOrderData)

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Order sent"
}

tradeSellMarket — Place Market Sell Order

Place a market sell order.

Authorizations:
BearerAuth
Request Body schema: application/json
required
required
object (TradeMarketOrderData)

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Order sent"
}

tradeCancel — Cancel Order

Cancel an existing order.

Authorizations:
BearerAuth
Request Body schema: application/json
required
required
object (TradeCancelData)

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Order sent"
}

orders — Get Order History for a Pair

Retrieve locally stored order history for a trading pair. The key parameter must be URL-encoded.

Authorizations:
BearerAuth
query Parameters
key
required
string
Example: key=binance%2FUSDT-XRP

URL-encoded exchange/pair key (e.g., binance%2FUSDT-XRP).

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}

ordersDay — Get Orders for Current Day (Multiple Pairs)

Retrieve orders from the current day for multiple trading pairs. Individual keys in keys[] array must be URL-encoded if they contain special characters.

Authorizations:
BearerAuth
query Parameters
timezone
required
string
Example: timezone=America/New_York

IANA timezone (e.g., America/New_York).

keys[]
required
Array of strings
Example: keys[]=binance/USDT-XRP&keys[]=mex_gunthy/USDT-DOGE

Array of exchange/pair keys. Each key should be URL-encoded if needed.

Responses

Response samples

Content type
application/json
{
  • "days": [ ],
  • "orders": [ ],
  • "closeOrders": [ ]
}

ordersPage — Get Paginated Orders for a Pair

Retrieve paginated orders for a trading pair. The key parameter must be URL-encoded.

Authorizations:
BearerAuth
query Parameters
key
required
string
Example: key=binance%2FUSDT-XRP

URL-encoded exchange/pair key.

page
required
integer >= 0

Page number (0-indexed).

pageSize
required
integer >= 1
Example: pageSize=10

Records per page.

Responses

Response samples

Content type
application/json
{
  • "total": 0,
  • "page": 0,
  • "data": [ ]
}

ordersPageMulti — Get Paginated Orders (Multiple Pairs)

Retrieve paginated orders for multiple trading pairs. Individual keys in keys[] array must be URL-encoded if needed.

Authorizations:
BearerAuth
query Parameters
keys[]
required
Array of strings
Example: keys[]=binance/USDT-XRP&keys[]=mex_gunthy/USDT-DOGE

Array of exchange/pair keys. Each key should be URL-encoded if needed.

page
required
integer >= 0

Page number (0-indexed).

pageSize
required
integer >= 1
Example: pageSize=10

Records per page.

Responses

Response samples

Content type
application/json
{
  • "total": 0,
  • "totalCount": 0,
  • "page": 0,
  • "data": [ ]
}

tradeBuyStoplimit — Place Stop-Limit Buy Order (Binance)

Place a stop-limit buy order on Binance.

Authorizations:
BearerAuth
Request Body schema: application/json
required
required
object (TradeStopLimitData)

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Order sent"
}

tradeSellStoplimit — Place Stop-Limit Sell Order (Binance)

Place a stop-limit sell order on Binance.

Authorizations:
BearerAuth
Request Body schema: application/json
required
required
object (TradeStopLimitData)

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Order sent"
}

tradeBuyTrailingstop — Place Trailing Stop Buy Order (Binance)

Place a trailing stop buy order on Binance. price is the reference price.

Authorizations:
BearerAuth
Request Body schema: application/json
required
required
object (TradeTrailingStopData)

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Order sent"
}

tradeSellTrailingstop — Place Trailing Stop Sell Order (Binance)

Place a trailing stop sell order on Binance. price is the reference price.

Authorizations:
BearerAuth
Request Body schema: application/json
required
required
object (TradeTrailingStopData)

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Order sent"
}

tradeBuyOco — Place OCO Buy Order (Binance)

Place an OCO (One-Cancels-the-Other) buy order on Binance.

Authorizations:
BearerAuth
Request Body schema: application/json
required
required
object (TradeOcoData)

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Order sent"
}

tradeSellOco — Place OCO Sell Order (Binance)

Place an OCO (One-Cancels-the-Other) sell order on Binance.

Authorizations:
BearerAuth
Request Body schema: application/json
required
required
object (TradeOcoData)

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Order sent"
}

tradeClose — Close Position with Limit Price (Bybit Futures)

Close an open position at a specified limit price on Bybit (futures).

Authorizations:
BearerAuth
Request Body schema: application/json
required
required
object (TradeCloseLimitData)

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Order sent"
}

tradeCloseMarket — Close Position at Market Price (Bybit Futures)

Close an open position at the current market price on Bybit (futures).

Authorizations:
BearerAuth
Request Body schema: application/json
required
required
object (TradeCloseMarketData)

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Order sent"
}