bitget
bitget cryptocurrency exchange — CCXT unified API: methods, parameters and endpoints.
bitget
Kind: global class
Extends: Exchange
- setSandboxMode
- enableDemoTrading
- fetchTime
- fetchMarkets
- fetchCurrencies
- fetchMarketLeverageTiers
- fetchDeposits
- withdraw
- fetchWithdrawals
- fetchDepositAddress
- fetchOrderBook
- fetchTicker
- fetchMarkPrice
- fetchTickers
- fetchTrades
- fetchTradingFee
- fetchTradingFees
- fetchOHLCV
- fetchBalance
- createMarketBuyOrderWithCost
- createOrder
- createOrders
- editOrder
- cancelOrder
- cancelOrders
- cancelAllOrders
- fetchOrder
- fetchOpenOrders
- fetchClosedOrders
- fetchCanceledOrders
- fetchCanceledAndClosedOrders
- fetchLedger
- fetchMyTrades
- fetchPosition
- fetchPositions
- fetchFundingRateHistory
- fetchFundingRate
- fetchFundingRates
- fetchFundingIntervals
- fetchFundingHistory
- reduceMargin
- addMargin
- fetchLeverage
- setLeverage
- setMarginMode
- setPositionMode
- fetchOpenInterest
- fetchTransfers
- transfer
- fetchDepositWithdrawFees
- borrowCrossMargin
- borrowIsolatedMargin
- repayIsolatedMargin
- repayCrossMargin
- fetchMyLiquidations
- fetchIsolatedBorrowRate
- fetchCrossBorrowRate
- fetchBorrowInterest
- closePosition
- closeAllPositions
- fetchMarginMode
- fetchPositionsHistory
- fetchConvertQuote
- createConvertTrade
- fetchConvertTradeHistory
- fetchConvertCurrencies
- fetchFundingInterval
- fetchLongShortRatioHistory
- watchTicker
- unWatchTicker
- watchTickers
- watchBidsAsks
- watchOHLCV
- unWatchOHLCV
- watchOrderBook
- unWatchOrderBook
- watchOrderBookForSymbols
- watchTrades
- watchTradesForSymbols
- unWatchTrades
- watchPositions
- watchOrders
- watchMyTrades
- watchBalance
setSandboxMode
enables or disables demo trading mode, if enabled will send PAPTRADING=1 in headers
Kind: instance method of bitget
| Param |
|---|
| enabled |
bitget.setSandboxMode (enabled)enableDemoTrading
enables or disables demo trading mode, if enabled will send PAPTRADING=1 in headers
Kind: instance method of bitget
| Param |
|---|
| enabled |
bitget.enableDemoTrading (enabled)fetchTime
fetches the current integer timestamp in milliseconds from the exchange server
Kind: instance method of bitget
Returns: int - the current integer timestamp in milliseconds from the exchange server
See: https://www.bitget.com/api-doc/common/public/Get-Server-Time
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.fetchTime (params?)fetchMarkets
retrieves data on all markets for bitget
Kind: instance method of bitget
Returns: Array<object> - an array of objects representing market data
See
- https://www.bitget.com/api-doc/spot/market/Get-Symbols
- https://www.bitget.com/api-doc/contract/market/Get-All-Symbols-Contracts
- https://www.bitget.com/api-doc/margin/common/support-currencies
- https://www.bitget.com/api-doc/uta/public/Instruments
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.fetchMarkets (params?)fetchCurrencies
fetches all available currencies on an exchange
Kind: instance method of bitget
Returns: object - an associative dictionary of currencies
See: https://www.bitget.com/api-doc/spot/market/Get-Coin-List
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.fetchCurrencies (params?)fetchMarketLeverageTiers
retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes for a single market
Kind: instance method of bitget
Returns: object - a leverage tiers structure
See
- https://www.bitget.com/api-doc/contract/position/Get-Query-Position-Lever
- https://www.bitget.com/api-doc/margin/cross/account/Cross-Tier-Data
- https://www.bitget.com/api-doc/margin/isolated/account/Isolated-Tier-Data
- https://www.bitget.com/api-doc/uta/public/Get-Position-Tier-Data
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | string | No | for spot margin 'cross' or 'isolated', default is 'isolated' |
| params.code | string | No | required for cross spot margin |
| params.productType | string | No | contract and uta only 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES' |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.fetchMarketLeverageTiers (symbol, params?)fetchDeposits
fetch all deposits made to an account
Kind: instance method of bitget
Returns: Array<object> - a list of transaction structures
See: https://www.bitget.com/api-doc/spot/account/Get-Deposit-Record
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| since | int | No | the earliest time in ms to fetch deposits for |
| limit | int | No | the maximum number of deposits structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | end time in milliseconds |
| params.idLessThan | string | No | return records with id less than the provided value |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
bitget.fetchDeposits (code, since?, limit?, params?)withdraw
make a withdrawal
Kind: instance method of bitget
Returns: object - a transaction structure
See: https://www.bitget.com/api-doc/spot/account/Wallet-Withdrawal
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| amount | float | Yes | the amount to withdraw |
| address | string | Yes | the address to withdraw to |
| tag | string | Yes | |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.chain | string | No | the blockchain network the withdrawal is taking place on |
bitget.withdraw (code, amount, address, tag, params?)fetchWithdrawals
fetch all withdrawals made from an account
Kind: instance method of bitget
Returns: Array<object> - a list of transaction structures
See: https://www.bitget.com/api-doc/spot/account/Get-Withdraw-Record
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| since | int | No | the earliest time in ms to fetch withdrawals for |
| limit | int | No | the maximum number of withdrawals structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | end time in milliseconds |
| params.idLessThan | string | No | return records with id less than the provided value |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
bitget.fetchWithdrawals (code, since?, limit?, params?)fetchDepositAddress
fetch the deposit address for a currency associated with this account
Kind: instance method of bitget
Returns: object - an address structure
See: https://www.bitget.com/api-doc/spot/account/Get-Deposit-Address
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.fetchDepositAddress (code, params?)fetchOrderBook
fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of bitget
Returns: object - A dictionary of order book structures indexed by market symbols
See
- https://www.bitget.com/api-doc/spot/market/Get-Orderbook
- https://www.bitget.com/api-doc/contract/market/Get-Merge-Depth
- https://www.bitget.com/api-doc/uta/public/OrderBook
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the order book for |
| limit | int | No | the maximum amount of order book entries to return |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.fetchOrderBook (symbol, limit?, params?)fetchTicker
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
Kind: instance method of bitget
Returns: object - a ticker structure
See
- https://www.bitget.com/api-doc/spot/market/Get-Tickers
- https://www.bitget.com/api-doc/contract/market/Get-Ticker
- https://www.bitget.com/api-doc/uta/public/Tickers
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the ticker for |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.fetchTicker (symbol, params?)fetchMarkPrice
fetches the mark price for a specific market
Kind: instance method of bitget
Returns: object - a ticker structure
See: https://www.bitget.com/api-doc/contract/market/Get-Symbol-Price
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the ticker for |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.fetchMarkPrice (symbol, params?)fetchTickers
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
Kind: instance method of bitget
Returns: object - a dictionary of ticker structures
See
- https://www.bitget.com/api-doc/spot/market/Get-Tickers
- https://www.bitget.com/api-doc/contract/market/Get-All-Symbol-Ticker
- https://www.bitget.com/api-doc/uta/public/Tickers
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string>, undefined | Yes | unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
| params.subType | string | No | contract only 'linear', 'inverse' |
| params.productType | string | No | contract only 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES' |
bitget.fetchTickers (symbols, params?)fetchTrades
get the list of most recent trades for a particular symbol
Kind: instance method of bitget
Returns: Array<Trade> - a list of trade structures
See
- https://www.bitget.com/api-doc/spot/market/Get-Recent-Trades
- https://www.bitget.com/api-doc/spot/market/Get-Market-Trades
- https://www.bitget.com/api-doc/contract/market/Get-Recent-Fills
- https://www.bitget.com/api-doc/contract/market/Get-Fills-History
- https://www.bitget.com/api-doc/uta/public/Fills
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch trades for |
| since | int | No | timestamp in ms of the earliest trade to fetch |
| limit | int | No | the maximum amount of trades to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
| params.until | int | No | only applies to publicSpotGetV2SpotMarketFillsHistory and publicMixGetV2MixMarketFillsHistory the latest time in ms to fetch trades for |
| params.paginate | boolean | No | only applies to publicSpotGetV2SpotMarketFillsHistory and publicMixGetV2MixMarketFillsHistory default false, when true will automatically paginate by calling this endpoint multiple times |
bitget.fetchTrades (symbol, since?, limit?, params?)fetchTradingFee
fetch the trading fees for a market
Kind: instance method of bitget
Returns: object - a fee structure
See: https://www.bitget.com/api-doc/common/public/Get-Trade-Rate
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | string | No | 'isolated' or 'cross', for finding the fee rate of spot margin trading pairs |
bitget.fetchTradingFee (symbol, params?)fetchTradingFees
fetch the trading fees for multiple markets
Kind: instance method of bitget
Returns: object - a dictionary of fee structures indexed by market symbols
See
- https://www.bitget.com/api-doc/spot/market/Get-Symbols
- https://www.bitget.com/api-doc/contract/market/Get-All-Symbols-Contracts
- https://www.bitget.com/api-doc/margin/common/support-currencies
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.productType | string | No | contract only 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES' |
| params.margin | boolean | No | set to true for spot margin |
bitget.fetchTradingFees (params?)fetchOHLCV
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of bitget
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume
See
- https://www.bitget.com/api-doc/spot/market/Get-Candle-Data
- https://www.bitget.com/api-doc/spot/market/Get-History-Candle-Data
- https://www.bitget.com/api-doc/contract/market/Get-Candle-Data
- https://www.bitget.com/api-doc/contract/market/Get-History-Candle-Data
- https://www.bitget.com/api-doc/contract/market/Get-History-Index-Candle-Data
- https://www.bitget.com/api-doc/contract/market/Get-History-Mark-Candle-Data
- https://www.bitget.com/api-doc/uta/public/Get-Candle-Data
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | string | Yes | the length of time each candle represents |
| since | int | No | timestamp in ms of the earliest candle to fetch |
| limit | int | No | the maximum amount of candles to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
| params.until | int | No | timestamp in ms of the latest candle to fetch |
| params.useHistoryEndpoint | boolean | No | whether to force to use historical endpoint (it has max limit of 200) |
| params.useHistoryEndpointForPagination | boolean | No | whether to force to use historical endpoint for pagination (default true) |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
| params.price | string | No | swap only "mark" (to fetch mark price candles) or "index" (to fetch index price candles) |
bitget.fetchOHLCV (symbol, timeframe, since?, limit?, params?)fetchBalance
query for balance and get the amount of funds available for trading or funds locked in orders
Kind: instance method of bitget
Returns: object - a balance structure
See
- https://www.bitget.com/api-doc/spot/account/Get-Account-Assets
- https://www.bitget.com/api-doc/contract/account/Get-Account-List
- https://www.bitget.com/api-doc/margin/cross/account/Get-Cross-Assets
- https://www.bitget.com/api-doc/margin/isolated/account/Get-Isolated-Assets
- https://bitgetlimited.github.io/apidoc/en/margin/#get-cross-assets
- https://bitgetlimited.github.io/apidoc/en/margin/#get-isolated-assets
- https://www.bitget.com/api-doc/uta/account/Get-Account
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.productType | string | No | contract only 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES' |
| params.uta | string | No | set to true for the unified trading account (uta), defaults to false |
bitget.fetchBalance (params?)createMarketBuyOrderWithCost
create a market buy order by providing the symbol and cost
Kind: instance method of bitget
Returns: object - an order structure
See
- https://www.bitget.com/api-doc/spot/trade/Place-Order
- https://www.bitget.com/api-doc/margin/cross/trade/Cross-Place-Order
- https://www.bitget.com/api-doc/margin/isolated/trade/Isolated-Place-Order
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to create an order in |
| cost | float | Yes | how much you want to trade in units of the quote currency |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.createMarketBuyOrderWithCost (symbol, cost, params?)createOrder
create a trade order
Kind: instance method of bitget
Returns: object - an order structure
See
- https://www.bitget.com/api-doc/spot/trade/Place-Order
- https://www.bitget.com/api-doc/spot/plan/Place-Plan-Order
- https://www.bitget.com/api-doc/contract/trade/Place-Order
- https://www.bitget.com/api-doc/contract/plan/Place-Tpsl-Order
- https://www.bitget.com/api-doc/contract/plan/Place-Plan-Order
- https://www.bitget.com/api-doc/margin/cross/trade/Cross-Place-Order
- https://www.bitget.com/api-doc/margin/isolated/trade/Isolated-Place-Order
- https://www.bitget.com/api-doc/uta/trade/Place-Order
- https://www.bitget.com/api-doc/uta/strategy/Place-Strategy-Order
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to create an order in |
| type | string | Yes | 'market' or 'limit' |
| side | string | Yes | 'buy' or 'sell' |
| amount | float | Yes | how much you want to trade in units of the base currency |
| price | float | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders, and used as the execution price for contract stop-loss / take-profit orders |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.cost | float | No | spot only how much you want to trade in units of the quote currency, for market buy orders only |
| params.triggerPrice | float | No | swap only The price at which a trigger order is triggered at |
| params.stopLossPrice | float | No | swap only The price at which a stop loss order is triggered at |
| params.takeProfitPrice | float | No | swap only The price at which a take profit order is triggered at |
| params.takeProfit | object | No | takeProfit object in params containing the triggerPrice at which the attached take profit order will be triggered (perpetual swap markets only) |
| params.takeProfit.triggerPrice | float | No | swap only take profit trigger price |
| params.stopLoss | object | No | stopLoss object in params containing the triggerPrice at which the attached stop loss order will be triggered (perpetual swap markets only) |
| params.stopLoss.triggerPrice | float | No | swap only stop loss trigger price |
| params.timeInForce | string | No | "GTC", "IOC", "FOK", or "PO" |
| params.marginMode | string | No | 'isolated' or 'cross' for spot margin trading |
| params.loanType | string | No | spot margin only 'normal', 'autoLoan', 'autoRepay', or 'autoLoanAndRepay' default is 'normal' |
| params.holdSide | string | No | contract stopLossPrice, takeProfitPrice only Two-way position: ('long' or 'short'), one-way position: ('buy' or 'sell') |
| params.stopLoss.price | float | No | swap only the execution price for a stop loss attached to a trigger order |
| params.takeProfit.price | float | No | swap only the execution price for a take profit attached to a trigger order |
| params.stopLoss.type | string | No | swap only the type for a stop loss attached to a trigger order, 'fill_price', 'index_price' or 'mark_price', default is 'mark_price' |
| params.takeProfit.type | string | No | swap only the type for a take profit attached to a trigger order, 'fill_price', 'index_price' or 'mark_price', default is 'mark_price' |
| params.trailingPercent | string | No | swap and future only the percent to trail away from the current market price, rate can not be greater than 10 |
| params.trailingTriggerPrice | string | No | swap and future only the price to trigger a trailing stop order, default uses the price argument |
| params.triggerType | string | No | swap and future only 'fill_price', 'mark_price' or 'index_price' |
| params.oneWayMode | boolean | No | swap and future only required to set this to true in one_way_mode and you can leave this as undefined in hedge_mode, can adjust the mode using the setPositionMode() method |
| params.hedged | bool | No | swap and future only true for hedged mode, false for one way mode, default is false |
| params.reduceOnly | bool | No | true or false whether the order is reduce-only |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
| params.posSide | string | No | uta only hedged two-way position side, long or short |
bitget.createOrder (symbol, type, side, amount, price?, params?)createOrders
create a list of trade orders (all orders should be of the same symbol)
Kind: instance method of bitget
Returns: object - an order structure
See
- https://www.bitget.com/api-doc/spot/trade/Batch-Place-Orders
- https://www.bitget.com/api-doc/contract/trade/Batch-Order
- https://www.bitget.com/api-doc/margin/isolated/trade/Isolated-Batch-Order
- https://www.bitget.com/api-doc/margin/cross/trade/Cross-Batch-Order
- https://www.bitget.com/api-doc/uta/trade/Place-Batch
| Param | Type | Required | Description |
|---|---|---|---|
| orders | Array | Yes | list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params |
| params | object | No | extra parameters specific to the api endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.createOrders (orders, params?)editOrder
edit a trade order
Kind: instance method of bitget
Returns: object - an order structure
See
- https://www.bitget.com/api-doc/spot/plan/Modify-Plan-Order
- https://www.bitget.com/api-doc/spot/trade/Cancel-Replace-Order
- https://www.bitget.com/api-doc/contract/trade/Modify-Order
- https://www.bitget.com/api-doc/contract/plan/Modify-Tpsl-Order
- https://www.bitget.com/api-doc/contract/plan/Modify-Plan-Order
- https://www.bitget.com/api-doc/uta/trade/Modify-Order
- https://www.bitget.com/api-doc/uta/strategy/Modify-Strategy-Order
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | cancel order id |
| symbol | string | Yes | unified symbol of the market to create an order in |
| type | string | Yes | 'market' or 'limit' |
| side | string | Yes | 'buy' or 'sell' |
| amount | float | Yes | how much you want to trade in units of the base currency |
| price | float | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.triggerPrice | float | No | the price that a trigger order is triggered at |
| params.stopLossPrice | float | No | swap only The price at which a stop loss order is triggered at |
| params.takeProfitPrice | float | No | swap only The price at which a take profit order is triggered at |
| params.takeProfit | object | No | takeProfit object in params containing the triggerPrice at which the attached take profit order will be triggered (perpetual swap markets only) |
| params.takeProfit.triggerPrice | float | No | swap only take profit trigger price |
| params.stopLoss | object | No | stopLoss object in params containing the triggerPrice at which the attached stop loss order will be triggered (perpetual swap markets only) |
| params.stopLoss.triggerPrice | float | No | swap only stop loss trigger price |
| params.stopLoss.price | float | No | swap only the execution price for a stop loss attached to a trigger order |
| params.takeProfit.price | float | No | swap only the execution price for a take profit attached to a trigger order |
| params.stopLoss.type | string | No | swap only the type for a stop loss attached to a trigger order, 'fill_price', 'index_price' or 'mark_price', default is 'mark_price' |
| params.takeProfit.type | string | No | swap only the type for a take profit attached to a trigger order, 'fill_price', 'index_price' or 'mark_price', default is 'mark_price' |
| params.trailingPercent | string | No | swap and future only the percent to trail away from the current market price, rate can not be greater than 10 |
| params.trailingTriggerPrice | string | No | swap and future only the price to trigger a trailing stop order, default uses the price argument |
| params.newTriggerType | string | No | swap and future only 'fill_price', 'mark_price' or 'index_price' |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.editOrder (id, symbol, type, side, amount, price?, params?)cancelOrder
cancels an open order
Kind: instance method of bitget
Returns: object - An order structure
See
- https://www.bitget.com/api-doc/spot/trade/Cancel-Order
- https://www.bitget.com/api-doc/spot/plan/Cancel-Plan-Order
- https://www.bitget.com/api-doc/contract/trade/Cancel-Order
- https://www.bitget.com/api-doc/contract/plan/Cancel-Plan-Order
- https://www.bitget.com/api-doc/margin/cross/trade/Cross-Cancel-Order
- https://www.bitget.com/api-doc/margin/isolated/trade/Isolated-Cancel-Order
- https://www.bitget.com/api-doc/uta/trade/Cancel-Order
- https://www.bitget.com/api-doc/uta/strategy/Cancel-Strategy-Order
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | order id |
| symbol | string | Yes | unified symbol of the market the order was made in |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | string | No | 'isolated' or 'cross' for spot margin trading |
| params.trigger | boolean | No | set to true for canceling trigger orders |
| params.planType | string | No | swap only either profit_plan, loss_plan, normal_plan, pos_profit, pos_loss, moving_plan or track_plan |
| params.trailing | boolean | No | set to true if you want to cancel a trailing order |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
| params.clientOrderId | string | No | the clientOrderId of the order, id does not need to be provided if clientOrderId is provided |
bitget.cancelOrder (id, symbol, params?)cancelOrders
cancel multiple orders
Kind: instance method of bitget
Returns: object - an array of order structures
See
- https://www.bitget.com/api-doc/spot/trade/Batch-Cancel-Orders
- https://www.bitget.com/api-doc/contract/trade/Batch-Cancel-Orders
- https://www.bitget.com/api-doc/contract/plan/Cancel-Plan-Order
- https://www.bitget.com/api-doc/margin/cross/trade/Cross-Batch-Cancel-Order
- https://www.bitget.com/api-doc/margin/isolated/trade/Isolated-Batch-Cancel-Orders
- https://www.bitget.com/api-doc/uta/trade/Cancel-Batch
| Param | Type | Required | Description |
|---|---|---|---|
| ids | Array<string> | Yes | order ids |
| symbol | string | Yes | unified market symbol, default is undefined |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | string | No | 'isolated' or 'cross' for spot margin trading |
| params.trigger | boolean | No | contract only set to true for canceling trigger orders |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.cancelOrders (ids, symbol, params?)cancelAllOrders
cancel all open orders
Kind: instance method of bitget
Returns: Array<object> - a list of order structures
See
- https://www.bitget.com/api-doc/spot/trade/Cancel-Symbol-Orders
- https://www.bitget.com/api-doc/spot/plan/Batch-Cancel-Plan-Order
- https://www.bitget.com/api-doc/contract/trade/Batch-Cancel-Orders
- https://www.bitget.com/api-doc/margin/cross/trade/Cross-Batch-Cancel-Order
- https://www.bitget.com/api-doc/margin/isolated/trade/Isolated-Batch-Cancel-Orders
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | string | No | 'isolated' or 'cross' for spot margin trading |
| params.trigger | boolean | No | contract only set to true for canceling trigger orders |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.cancelAllOrders (symbol, params?)fetchOrder
fetches information on an order made by the user
Kind: instance method of bitget
Returns: object - An order structure
See
- https://www.bitget.com/api-doc/spot/trade/Get-Order-Info
- https://www.bitget.com/api-doc/contract/trade/Get-Order-Details
- https://www.bitget.com/api-doc/uta/trade/Get-Order-Details
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | the order id |
| symbol | string | Yes | unified symbol of the market the order was made in |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
| params.clientOrderId | string | No | the clientOrderId of the order, id does not need to be provided if clientOrderId is provided |
bitget.fetchOrder (id, symbol, params?)fetchOpenOrders
fetch all unfilled currently open orders
Kind: instance method of bitget
Returns: Array<Order> - a list of order structures
See
- https://www.bitget.com/api-doc/spot/trade/Get-Unfilled-Orders
- https://www.bitget.com/api-doc/spot/plan/Get-Current-Plan-Order
- https://www.bitget.com/api-doc/contract/trade/Get-Orders-Pending
- https://www.bitget.com/api-doc/contract/plan/get-orders-plan-pending
- https://www.bitget.com/api-doc/margin/cross/trade/Get-Cross-Open-Orders
- https://www.bitget.com/api-doc/margin/isolated/trade/Isolated-Open-Orders
- https://www.bitget.com/api-doc/uta/strategy/Get-Unfilled-Strategy-Orders
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| since | int | No | the earliest time in ms to fetch open orders for |
| limit | int | No | the maximum number of open order structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | the latest time in ms to fetch orders for |
| params.planType | string | No | contract stop only 'normal_plan': average trigger order, 'profit_loss': opened tp/sl orders, 'track_plan': trailing stop order, default is 'normal_plan' |
| params.trigger | boolean | No | set to true for fetching trigger orders |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
| params.isPlan | string | No | swap only 'plan' for stop orders and 'profit_loss' for tp/sl orders, default is 'plan' |
| params.trailing | boolean | No | set to true if you want to fetch trailing orders |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.fetchOpenOrders (symbol, since?, limit?, params?)fetchClosedOrders
fetches information on multiple closed orders made by the user
Kind: instance method of bitget
Returns: Array<Order> - a list of order structures
See
- https://www.bitget.com/api-doc/spot/trade/Get-History-Orders
- https://www.bitget.com/api-doc/spot/plan/Get-History-Plan-Order
- https://www.bitget.com/api-doc/contract/trade/Get-Orders-History
- https://www.bitget.com/api-doc/contract/plan/orders-plan-history
- https://www.bitget.com/api-doc/margin/cross/trade/Get-Cross-Order-History
- https://www.bitget.com/api-doc/margin/isolated/trade/Get-Isolated-Order-History
- https://www.bitget.com/api-doc/uta/trade/Get-Order-History
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the closed orders |
| since | int | No | timestamp in ms of the earliest order |
| limit | int | No | the max number of closed orders to return |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | the latest time in ms to fetch orders for |
| params.planType | string | No | contract stop only 'normal_plan': average trigger order, 'profit_loss': opened tp/sl orders, 'track_plan': trailing stop order, default is 'normal_plan' |
| params.trigger | boolean | No | set to true for fetching trigger orders |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
| params.isPlan | string | No | swap only 'plan' for stop orders and 'profit_loss' for tp/sl orders, default is 'plan' |
| params.trailing | boolean | No | set to true if you want to fetch trailing orders |
bitget.fetchClosedOrders (symbol, since?, limit?, params?)fetchCanceledOrders
fetches information on multiple canceled orders made by the user
Kind: instance method of bitget
Returns: object - a list of order structures
See
- https://www.bitget.com/api-doc/spot/trade/Get-History-Orders
- https://www.bitget.com/api-doc/spot/plan/Get-History-Plan-Order
- https://www.bitget.com/api-doc/contract/trade/Get-Orders-History
- https://www.bitget.com/api-doc/contract/plan/orders-plan-history
- https://www.bitget.com/api-doc/margin/cross/trade/Get-Cross-Order-History
- https://www.bitget.com/api-doc/margin/isolated/trade/Get-Isolated-Order-History
- https://www.bitget.com/api-doc/uta/trade/Get-Order-History
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the canceled orders |
| since | int | No | timestamp in ms of the earliest order |
| limit | int | No | the max number of canceled orders to return |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | the latest time in ms to fetch orders for |
| params.planType | string | No | contract stop only 'normal_plan': average trigger order, 'profit_loss': opened tp/sl orders, 'track_plan': trailing stop order, default is 'normal_plan' |
| params.trigger | boolean | No | set to true for fetching trigger orders |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
| params.isPlan | string | No | swap only 'plan' for stop orders and 'profit_loss' for tp/sl orders, default is 'plan' |
| params.trailing | boolean | No | set to true if you want to fetch trailing orders |
bitget.fetchCanceledOrders (symbol, since?, limit?, params?)fetchCanceledAndClosedOrders
fetches information on multiple canceled and closed orders made by the user
Kind: instance method of bitget
Returns: Array<Order> - a list of order structures
See
- https://www.bitget.com/api-doc/spot/trade/Get-History-Orders
- https://www.bitget.com/api-doc/spot/plan/Get-History-Plan-Order
- https://www.bitget.com/api-doc/contract/trade/Get-Orders-History
- https://www.bitget.com/api-doc/contract/plan/orders-plan-history
- https://www.bitget.com/api-doc/margin/cross/trade/Get-Cross-Order-History
- https://www.bitget.com/api-doc/margin/isolated/trade/Get-Isolated-Order-History
- https://www.bitget.com/api-doc/uta/trade/Get-Order-History
- https://www.bitget.com/api-doc/uta/strategy/Get-History-Strategy-Orders
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market orders were made in |
| since | int | No | the earliest time in ms to fetch orders for |
| limit | int | No | the maximum number of order structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | the latest time in ms to fetch orders for |
| params.planType | string | No | contract stop only 'normal_plan': average trigger order, 'profit_loss': opened tp/sl orders, 'track_plan': trailing stop order, default is 'normal_plan' |
| params.trigger | boolean | No | set to true for fetching trigger orders |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
| params.isPlan | string | No | swap only 'plan' for stop orders and 'profit_loss' for tp/sl orders, default is 'plan' |
| params.trailing | boolean | No | set to true if you want to fetch trailing orders |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.fetchCanceledAndClosedOrders (symbol, since?, limit?, params?)fetchLedger
fetch the history of changes, actions done by the user or operations that altered the balance of the user
Kind: instance method of bitget
Returns: object - a ledger structure
See
- https://www.bitget.com/api-doc/spot/account/Get-Account-Bills
- https://www.bitget.com/api-doc/contract/account/Get-Account-Bill
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | No | unified currency code, default is undefined |
| since | int | No | timestamp in ms of the earliest ledger entry, default is undefined |
| limit | int | No | max number of ledger entries to return, default is undefined |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | end time in ms |
| params.symbol | string | No | contract only unified market symbol |
| params.productType | string | No | contract only 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES' |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
bitget.fetchLedger (code?, since?, limit?, params?)fetchMyTrades
fetch all trades made by the user
Kind: instance method of bitget
Returns: Array<Trade> - a list of trade structures
See
- https://www.bitget.com/api-doc/spot/trade/Get-Fills
- https://www.bitget.com/api-doc/contract/trade/Get-Order-Fills
- https://www.bitget.com/api-doc/margin/cross/trade/Get-Cross-Order-Fills
- https://www.bitget.com/api-doc/margin/isolated/trade/Get-Isolated-Transaction-Details
- https://www.bitget.com/api-doc/uta/trade/Get-Order-Fills
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| since | int | No | the earliest time in ms to fetch trades for |
| limit | int | No | the maximum number of trades structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | the latest time in ms to fetch trades for |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
bitget.fetchMyTrades (symbol, since?, limit?, params?)fetchPosition
fetch data on a single open contract trade position
Kind: instance method of bitget
Returns: object - a position structure
See
- https://www.bitget.com/api-doc/contract/position/get-single-position
- https://www.bitget.com/api-doc/uta/trade/Get-Position
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market the position is held in |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.fetchPosition (symbol, params?)fetchPositions
fetch all open positions
Kind: instance method of bitget
Returns: Array<object> - a list of position structure
See
- https://www.bitget.com/api-doc/contract/position/get-all-position
- https://www.bitget.com/api-doc/contract/position/Get-History-Position
- https://www.bitget.com/api-doc/uta/trade/Get-Position
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | list of unified market symbols |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.marginCoin | string | No | the settle currency of the positions, needs to match the productType |
| params.productType | string | No | 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES' |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
| params.useHistoryEndpoint | boolean | No | default false, when true will use the historic endpoint to fetch positions |
| params.method | string | No | either (default) 'privateMixGetV2MixPositionAllPosition', 'privateMixGetV2MixPositionHistoryPosition', or 'privateUtaGetV3PositionCurrentPosition' |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.fetchPositions (symbols?, params?)fetchFundingRateHistory
fetches historical funding rate prices
Kind: instance method of bitget
Returns: Array<object> - a list of funding rate structures
See
- https://www.bitget.com/api-doc/contract/market/Get-History-Funding-Rate
- https://www.bitget.com/api-doc/uta/public/Get-History-Funding-Rate
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the funding rate history for |
| since | int | No | timestamp in ms of the earliest funding rate to fetch |
| limit | int | No | the maximum amount of funding rate structures to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
bitget.fetchFundingRateHistory (symbol, since?, limit?, params?)fetchFundingRate
fetch the current funding rate
Kind: instance method of bitget
Returns: object - a funding rate structure
See
- https://www.bitget.com/api-doc/contract/market/Get-Current-Funding-Rate
- https://www.bitget.com/api-doc/contract/market/Get-Symbol-Next-Funding-Time
- https://www.bitget.com/api-doc/uta/public/Get-Current-Funding-Rate
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
| params.method | string | No | either (default) 'publicMixGetV2MixMarketCurrentFundRate' or 'publicMixGetV2MixMarketFundingTime' |
bitget.fetchFundingRate (symbol, params?)fetchFundingRates
fetch the current funding rates for all markets
Kind: instance method of bitget
Returns: object - a dictionary of funding rate structures, indexed by market symbols
See: https://www.bitget.com/api-doc/contract/market/Get-All-Symbol-Ticker
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | list of unified market symbols |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.subType | string | No | contract only 'linear', 'inverse' |
| params.productType | string | No | contract only 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES' |
| params.method | string | No | either (default) 'publicMixGetV2MixMarketTickers' or 'publicMixGetV2MixMarketCurrentFundRate' |
bitget.fetchFundingRates (symbols?, params?)fetchFundingIntervals
fetch the funding rate interval for multiple markets
Kind: instance method of bitget
Returns: Array<object> - a list of funding rate structures
See: https://www.bitget.com/api-doc/contract/market/Get-All-Symbol-Ticker
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | list of unified market symbols |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.productType | string | No | 'USDT-FUTURES' (default), 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES' |
bitget.fetchFundingIntervals (symbols?, params?)fetchFundingHistory
fetch the funding history
Kind: instance method of bitget
Returns: Array<object> - a list of funding history structures
See: https://www.bitget.com/api-doc/contract/account/Get-Account-Bill
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| since | int | No | the starting timestamp in milliseconds |
| limit | int | No | the number of entries to return |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | the latest time in ms to fetch funding history for |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
bitget.fetchFundingHistory (symbol, since?, limit?, params?)reduceMargin
remove margin from a position
Kind: instance method of bitget
Returns: object - a margin structure
See: https://www.bitget.com/api-doc/contract/account/Change-Margin
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| amount | float | Yes | the amount of margin to remove |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.reduceMargin (symbol, amount, params?)addMargin
add margin
Kind: instance method of bitget
Returns: object - a margin structure
See: https://www.bitget.com/api-doc/contract/account/Change-Margin
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| amount | float | Yes | the amount of margin to add |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.addMargin (symbol, amount, params?)fetchLeverage
fetch the set leverage for a market
Kind: instance method of bitget
Returns: object - a leverage structure
See: https://www.bitget.com/api-doc/contract/account/Get-Single-Account
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.fetchLeverage (symbol, params?)setLeverage
set the level of leverage for a market
Kind: instance method of bitget
Returns: object - response from the exchange
See
- https://www.bitget.com/api-doc/contract/account/Change-Leverage
- https://www.bitget.com/api-doc/uta/account/Change-Leverage
| Param | Type | Required | Description |
|---|---|---|---|
| leverage | int | Yes | the rate of leverage |
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.holdSide | string | No | isolated only position direction, 'long' or 'short' |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
| params.posSide | boolean | No | required for uta isolated margin, long or short |
bitget.setLeverage (leverage, symbol, params?)setMarginMode
set margin mode to 'cross' or 'isolated'
Kind: instance method of bitget
Returns: object - response from the exchange
See: https://www.bitget.com/api-doc/contract/account/Change-Margin-Mode
| Param | Type | Required | Description |
|---|---|---|---|
| marginMode | string | Yes | 'cross' or 'isolated' |
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.setMarginMode (marginMode, symbol, params?)setPositionMode
set hedged to true or false for a market
Kind: instance method of bitget
Returns: object - response from the exchange
See
- https://www.bitget.com/api-doc/contract/account/Change-Hold-Mode
- https://www.bitget.com/api-doc/uta/account/Change-Position-Mode
| Param | Type | Required | Description |
|---|---|---|---|
| hedged | bool | Yes | set to true to use dualSidePosition |
| symbol | string | Yes | not used by bitget setPositionMode () |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.productType | string | No | required if not uta and symbol is undefined: 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES' |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.setPositionMode (hedged, symbol, params?)fetchOpenInterest
retrieves the open interest of a contract trading pair
Kind: instance method of bitget
Returns: object - an open interest structure/docs/manual#open-interest-structure
See
- https://www.bitget.com/api-doc/contract/market/Get-Open-Interest
- https://www.bitget.com/api-doc/uta/public/Get-Open-Interest
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified CCXT market symbol |
| params | object | No | exchange specific parameters |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.fetchOpenInterest (symbol, params?)fetchTransfers
fetch a history of internal transfers made on an account
Kind: instance method of bitget
Returns: Array<object> - a list of transfer structures
See: https://www.bitget.com/api-doc/spot/account/Get-Account-TransferRecords
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code of the currency transferred |
| since | int | No | the earliest time in ms to fetch transfers for |
| limit | int | No | the maximum number of transfers structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | the latest time in ms to fetch entries for |
bitget.fetchTransfers (code, since?, limit?, params?)transfer
transfer currency internally between wallets on the same account
Kind: instance method of bitget
Returns: object - a transfer structure
See: https://www.bitget.com/api-doc/spot/account/Wallet-Transfer
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| amount | float | Yes | amount to transfer |
| fromAccount | string | Yes | account to transfer from |
| toAccount | string | Yes | account to transfer to |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.symbol | string | No | unified CCXT market symbol, required when transferring to or from an account type that is a leveraged position-by-position account |
| params.clientOid | string | No | custom id |
bitget.transfer (code, amount, fromAccount, toAccount, params?)fetchDepositWithdrawFees
fetch deposit and withdraw fees
Kind: instance method of bitget
Returns: object - a list of fee structures
See: https://www.bitget.com/api-doc/spot/market/Get-Coin-List
| Param | Type | Required | Description |
|---|---|---|---|
| codes | Array<string>, undefined | Yes | list of unified currency codes |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.fetchDepositWithdrawFees (codes, params?)borrowCrossMargin
create a loan to borrow margin
Kind: instance method of bitget
Returns: object - a margin loan structure
See: https://www.bitget.com/api-doc/margin/cross/account/Cross-Borrow
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code of the currency to borrow |
| amount | string | Yes | the amount to borrow |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.borrowCrossMargin (code, amount, params?)borrowIsolatedMargin
create a loan to borrow margin
Kind: instance method of bitget
Returns: object - a margin loan structure
See: https://www.bitget.com/api-doc/margin/isolated/account/Isolated-Borrow
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| code | string | Yes | unified currency code of the currency to borrow |
| amount | string | Yes | the amount to borrow |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.borrowIsolatedMargin (symbol, code, amount, params?)repayIsolatedMargin
repay borrowed margin and interest
Kind: instance method of bitget
Returns: object - a margin loan structure
See: https://www.bitget.com/api-doc/margin/isolated/account/Isolated-Repay
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| code | string | Yes | unified currency code of the currency to repay |
| amount | string | Yes | the amount to repay |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.repayIsolatedMargin (symbol, code, amount, params?)repayCrossMargin
repay borrowed margin and interest
Kind: instance method of bitget
Returns: object - a margin loan structure
See: https://www.bitget.com/api-doc/margin/cross/account/Cross-Repay
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code of the currency to repay |
| amount | string | Yes | the amount to repay |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.repayCrossMargin (code, amount, params?)fetchMyLiquidations
retrieves the users liquidated positions
Kind: instance method of bitget
Returns: object - an array of liquidation structures
See
- https://www.bitget.com/api-doc/margin/cross/record/Get-Cross-Liquidation-Records
- https://www.bitget.com/api-doc/margin/isolated/record/Get-Isolated-Liquidation-Records
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | unified CCXT market symbol |
| since | int | No | the earliest time in ms to fetch liquidations for |
| limit | int | No | the maximum number of liquidation structures to retrieve |
| params | object | No | exchange specific parameters for the bitget api endpoint |
| params.until | int | No | timestamp in ms of the latest liquidation |
| params.marginMode | string | No | 'cross' or 'isolated' default value is 'cross' |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
bitget.fetchMyLiquidations (symbol?, since?, limit?, params?)fetchIsolatedBorrowRate
fetch the rate of interest to borrow a currency for margin trading
Kind: instance method of bitget
Returns: object - an isolated borrow rate structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.fetchIsolatedBorrowRate (symbol, params?)fetchCrossBorrowRate
fetch the rate of interest to borrow a currency for margin trading
Kind: instance method of bitget
Returns: object - a borrow rate structure
See
- https://www.bitget.com/api-doc/margin/cross/account/Get-Cross-Margin-Interest-Rate-And-Borrowable
- https://www.bitget.com/api-doc/uta/public/Get-Margin-Loans
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.fetchCrossBorrowRate (code, params?)fetchBorrowInterest
fetch the interest owed by the user for borrowing currency for margin trading
Kind: instance method of bitget
Returns: Array<object> - a list of borrow interest structures
See
- https://www.bitget.com/api-doc/margin/cross/record/Get-Cross-Interest-Records
- https://www.bitget.com/api-doc/margin/isolated/record/Get-Isolated-Interest-Records
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | No | unified currency code |
| symbol | string | No | unified market symbol when fetching interest in isolated markets |
| since | int | No | the earliest time in ms to fetch borrow interest for |
| limit | int | No | the maximum number of structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
bitget.fetchBorrowInterest (code?, symbol?, since?, limit?, params?)closePosition
closes an open position for a market
Kind: instance method of bitget
Returns: object - An order structure
See
- https://www.bitget.com/api-doc/contract/trade/Flash-Close-Position
- https://www.bitget.com/api-doc/uta/trade/Close-All-Positions
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified CCXT market symbol |
| side | string | No | one-way mode: 'buy' or 'sell', hedge-mode: 'long' or 'short' |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.closePosition (symbol, side?, params?)closeAllPositions
closes all open positions for a market type
Kind: instance method of bitget
Returns: Array<object> - A list of position structures
See
- https://www.bitget.com/api-doc/contract/trade/Flash-Close-Position
- https://www.bitget.com/api-doc/uta/trade/Close-All-Positions
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.productType | string | No | 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES' |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.closeAllPositions (params?)fetchMarginMode
fetches the margin mode of a trading pair
Kind: instance method of bitget
Returns: object - a margin mode structure
See: https://www.bitget.com/api-doc/contract/account/Get-Single-Account
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the margin mode for |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.fetchMarginMode (symbol, params?)fetchPositionsHistory
fetches historical positions
Kind: instance method of bitget
Returns: Array<object> - a list of position structures
See
- https://www.bitget.com/api-doc/contract/position/Get-History-Position
- https://www.bitget.com/api-doc/uta/trade/Get-Position-History
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | unified contract symbols |
| since | int | No | timestamp in ms of the earliest position to fetch, default=3 months ago, max range for params["until"] - since is 3 months |
| limit | int | No | the maximum amount of records to fetch, default=20, max=100 |
| params | object | Yes | extra parameters specific to the exchange api endpoint |
| params.until | int | No | timestamp in ms of the latest position to fetch, max range for params["until"] - since is 3 months |
| params.productType | string | No | USDT-FUTURES (default), COIN-FUTURES, USDC-FUTURES, SUSDT-FUTURES, SCOIN-FUTURES, or SUSDC-FUTURES |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.fetchPositionsHistory (symbols?, since?, limit?, params)fetchConvertQuote
fetch a quote for converting from one currency to another
Kind: instance method of bitget
Returns: object - a conversion structure
See: https://www.bitget.com/api-doc/common/convert/Get-Quoted-Price
| Param | Type | Required | Description |
|---|---|---|---|
| fromCode | string | Yes | the currency that you want to sell and convert from |
| toCode | string | Yes | the currency that you want to buy and convert into |
| amount | float | No | how much you want to trade in units of the from currency |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.fetchConvertQuote (fromCode, toCode, amount?, params?)createConvertTrade
convert from one currency to another
Kind: instance method of bitget
Returns: object - a conversion structure
See: https://www.bitget.com/api-doc/common/convert/Trade
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | the id of the trade that you want to make |
| fromCode | string | Yes | the currency that you want to sell and convert from |
| toCode | string | Yes | the currency that you want to buy and convert into |
| amount | float | Yes | how much you want to trade in units of the from currency |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.price | string | Yes | the price of the conversion, obtained from fetchConvertQuote() |
| params.toAmount | string | Yes | the amount you want to trade in units of the toCurrency, obtained from fetchConvertQuote() |
bitget.createConvertTrade (id, fromCode, toCode, amount, params?)fetchConvertTradeHistory
fetch the users history of conversion trades
Kind: instance method of bitget
Returns: Array<object> - a list of conversion structures
See: https://www.bitget.com/api-doc/common/convert/Get-Convert-Record
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | No | the unified currency code |
| since | int | No | the earliest time in ms to fetch conversions for |
| limit | int | No | the maximum number of conversion structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.fetchConvertTradeHistory (code?, since?, limit?, params?)fetchConvertCurrencies
fetches all available currencies that can be converted
Kind: instance method of bitget
Returns: object - an associative dictionary of currencies
See: https://www.bitget.com/api-doc/common/convert/Get-Convert-Currencies
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.fetchConvertCurrencies (params?)fetchFundingInterval
fetch the current funding rate interval
Kind: instance method of bitget
Returns: object - a funding rate structure
See
- https://www.bitget.com/api-doc/contract/market/Get-Symbol-Next-Funding-Time
- https://www.bitget.com/api-doc/uta/public/Get-Current-Funding-Rate
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.fetchFundingInterval (symbol, params?)fetchLongShortRatioHistory
fetches the long short ratio history for a unified market symbol
Kind: instance method of bitget
Returns: Array<object> - an array of long short ratio structures
See
- https://www.bitget.com/api-doc/common/apidata/Margin-Ls-Ratio
- https://www.bitget.com/api-doc/common/apidata/Account-Long-Short
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the long short ratio for |
| timeframe | string | No | the period for the ratio |
| since | int | No | the earliest time in ms to fetch ratios for |
| limit | int | No | the maximum number of long short ratio structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.fetchLongShortRatioHistory (symbol, timeframe?, since?, limit?, params?)bitget
watching delivery future markets is not yet implemented (perpertual future & swap is implemented)
bitget.bitget ()watchTicker
watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
Kind: instance method of bitget
Returns: object - a ticker structure
See
- https://www.bitget.com/api-doc/spot/websocket/public/Tickers-Channel
- https://www.bitget.com/api-doc/contract/websocket/public/Tickers-Channel
- https://www.bitget.com/api-doc/uta/websocket/public/Tickers-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to watch the ticker for |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.watchTicker (symbol, params?)unWatchTicker
unsubscribe from the ticker channel
Kind: instance method of bitget
Returns: any - status of the unwatch request
See
- https://www.bitget.com/api-doc/spot/websocket/public/Tickers-Channel
- https://www.bitget.com/api-doc/contract/websocket/public/Tickers-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to unwatch the ticker for |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.unWatchTicker (symbol, params?)watchTickers
watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
Kind: instance method of bitget
Returns: object - a ticker structure
See
- https://www.bitget.com/api-doc/spot/websocket/public/Tickers-Channel
- https://www.bitget.com/api-doc/contract/websocket/public/Tickers-Channel
- https://www.bitget.com/api-doc/uta/websocket/public/Tickers-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | Yes | unified symbol of the market to watch the tickers for |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.watchTickers (symbols, params?)watchBidsAsks
watches best bid & ask for symbols
Kind: instance method of bitget
Returns: object - a ticker structure
See
- https://www.bitget.com/api-doc/spot/websocket/public/Tickers-Channel
- https://www.bitget.com/api-doc/contract/websocket/public/Tickers-Channel
- https://www.bitget.com/api-doc/uta/websocket/public/Tickers-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | Yes | unified symbol of the market to fetch the ticker for |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.watchBidsAsks (symbols, params?)watchOHLCV
watches historical candlestick data containing the open, high, low, close price, and the volume of a market
Kind: instance method of bitget
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume
See
- https://www.bitget.com/api-doc/spot/websocket/public/Candlesticks-Channel
- https://www.bitget.com/api-doc/contract/websocket/public/Candlesticks-Channel
- https://www.bitget.com/api-doc/uta/websocket/public/Candlesticks-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | string | Yes | the length of time each candle represents |
| since | int | No | timestamp in ms of the earliest candle to fetch |
| limit | int | No | the maximum amount of candles to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.watchOHLCV (symbol, timeframe, since?, limit?, params?)unWatchOHLCV
unsubscribe from the ohlcv channel
Kind: instance method of bitget
Returns: object - A dictionary of order book structures indexed by market symbols
See
- https://www.bitget.com/api-doc/spot/websocket/public/Candlesticks-Channel
- https://www.bitget.com/api-doc/contract/websocket/public/Candlesticks-Channel
- https://www.bitget.com/api-doc/uta/websocket/public/Candlesticks-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to unwatch the ohlcv for |
| timeframe | string | No | the period for the ratio, default is 1 minute |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.unWatchOHLCV (symbol, timeframe?, params?)watchOrderBook
watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of bitget
Returns: object - A dictionary of order book structures indexed by market symbols
See
- https://www.bitget.com/api-doc/spot/websocket/public/Depth-Channel
- https://www.bitget.com/api-doc/contract/websocket/public/Order-Book-Channel
- https://www.bitget.com/api-doc/uta/websocket/public/Order-Book-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the order book for |
| limit | int | No | the maximum amount of order book entries to return |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.watchOrderBook (symbol, limit?, params?)unWatchOrderBook
unsubscribe from the orderbook channel
Kind: instance method of bitget
Returns: object - A dictionary of order book structures indexed by market symbols
See
- https://www.bitget.com/api-doc/spot/websocket/public/Depth-Channel
- https://www.bitget.com/api-doc/contract/websocket/public/Order-Book-Channel
- https://www.bitget.com/api-doc/uta/websocket/public/Order-Book-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the order book for |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.limit | int | No | orderbook limit, default is undefined |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.unWatchOrderBook (symbol, params?)watchOrderBookForSymbols
watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of bitget
Returns: object - A dictionary of order book structures indexed by market symbols
See
- https://www.bitget.com/api-doc/spot/websocket/public/Depth-Channel
- https://www.bitget.com/api-doc/contract/websocket/public/Order-Book-Channel
- https://www.bitget.com/api-doc/uta/websocket/public/Order-Book-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | Yes | unified array of symbols |
| limit | int | No | the maximum amount of order book entries to return |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.watchOrderBookForSymbols (symbols, limit?, params?)watchTrades
get the list of most recent trades for a particular symbol
Kind: instance method of bitget
Returns: Array<object> - a list of trade structures
See
- https://www.bitget.com/api-doc/spot/websocket/public/Trades-Channel
- https://www.bitget.com/api-doc/contract/websocket/public/New-Trades-Channel
- https://www.bitget.com/api-doc/uta/websocket/public/New-Trades-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch trades for |
| since | int | No | timestamp in ms of the earliest trade to fetch |
| limit | int | No | the maximum amount of trades to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.watchTrades (symbol, since?, limit?, params?)watchTradesForSymbols
get the list of most recent trades for a particular symbol
Kind: instance method of bitget
Returns: Array<object> - a list of trade structures
See
- https://www.bitget.com/api-doc/spot/websocket/public/Trades-Channel
- https://www.bitget.com/api-doc/contract/websocket/public/New-Trades-Channel
- https://www.bitget.com/api-doc/uta/websocket/public/New-Trades-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | Yes | unified symbol of the market to fetch trades for |
| since | int | No | timestamp in ms of the earliest trade to fetch |
| limit | int | No | the maximum amount of trades to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.watchTradesForSymbols (symbols, since?, limit?, params?)unWatchTrades
unsubscribe from the trades channel
Kind: instance method of bitget
Returns: any - status of the unwatch request
See
- https://www.bitget.com/api-doc/spot/websocket/public/Trades-Channel
- https://www.bitget.com/api-doc/contract/websocket/public/New-Trades-Channel
- https://www.bitget.com/api-doc/uta/websocket/public/New-Trades-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to unwatch the trades for |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.unWatchTrades (symbol, params?)watchPositions
watch all open positions
Kind: instance method of bitget
Returns: Array<object> - a list of position structure
See
- https://www.bitget.com/api-doc/contract/websocket/private/Positions-Channel
- https://www.bitget.com/api-doc/uta/websocket/private/Positions-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string>, undefined | Yes | list of unified market symbols |
| since | int | No | the earliest time in ms to fetch positions for |
| limit | int | No | the maximum number of positions to retrieve |
| params | object | Yes | extra parameters specific to the exchange API endpoint |
| params.instType | string | No | one of 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES', default is 'USDT-FUTURES' |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.watchPositions (symbols, since?, limit?, params)watchOrders
watches information on multiple orders made by the user
Kind: instance method of bitget
Returns: Array<object> - a list of order structures
See
- https://www.bitget.com/api-doc/spot/websocket/private/Order-Channel
- https://www.bitget.com/api-doc/spot/websocket/private/Plan-Order-Channel
- https://www.bitget.com/api-doc/contract/websocket/private/Order-Channel
- https://www.bitget.com/api-doc/contract/websocket/private/Plan-Order-Channel
- https://www.bitget.com/api-doc/margin/cross/websocket/private/Cross-Orders
- https://www.bitget.com/api-doc/margin/isolated/websocket/private/Isolate-Orders
- https://www.bitget.com/api-doc/uta/websocket/private/Order-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market orders were made in |
| since | int | No | the earliest time in ms to fetch orders for |
| limit | int | No | the maximum number of order structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.trigger | boolean | No | contract only set to true for watching trigger orders |
| params.marginMode | string | No | 'isolated' or 'cross' for watching spot margin orders] |
| params.type | string | No | 'spot', 'swap' |
| params.subType | string | No | 'linear', 'inverse' |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.watchOrders (symbol, since?, limit?, params?)watchMyTrades
watches trades made by the user
Kind: instance method of bitget
Returns: Array<object> - a list of trade structures
See
- https://www.bitget.com/api-doc/contract/websocket/private/Fill-Channel
- https://www.bitget.com/api-doc/uta/websocket/private/Fill-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | str | Yes | unified market symbol |
| since | int | No | the earliest time in ms to fetch trades for |
| limit | int | No | the maximum number of trades structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.watchMyTrades (symbol, since?, limit?, params?)watchBalance
watch balance and get the amount of funds available for trading or funds locked in orders
Kind: instance method of bitget
Returns: object - a balance structure
See
- https://www.bitget.com/api-doc/spot/websocket/private/Account-Channel
- https://www.bitget.com/api-doc/contract/websocket/private/Account-Channel
- https://www.bitget.com/api-doc/margin/cross/websocket/private/Margin-Cross-Account-Assets
- https://www.bitget.com/api-doc/margin/isolated/websocket/private/Margin-isolated-account-assets
- https://www.bitget.com/api-doc/uta/websocket/private/Account-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.type | str | No | spot or contract if not provided this.options['defaultType'] is used |
| params.instType | string | No | one of 'SPOT', 'MARGIN', 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES' |
| params.marginMode | string | No | 'isolated' or 'cross' for watching spot margin balances |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.watchBalance (params?)bitget
Kind: global class
Extends: Exchange
- setSandboxMode
- enableDemoTrading
- fetchTime
- fetchMarkets
- fetchCurrencies
- fetchMarketLeverageTiers
- fetchDeposits
- withdraw
- fetchWithdrawals
- fetchDepositAddress
- fetchOrderBook
- fetchTicker
- fetchMarkPrice
- fetchTickers
- fetchTrades
- fetchTradingFee
- fetchTradingFees
- fetchOHLCV
- fetchBalance
- createMarketBuyOrderWithCost
- createOrder
- createOrders
- editOrder
- cancelOrder
- cancelOrders
- cancelAllOrders
- fetchOrder
- fetchOpenOrders
- fetchClosedOrders
- fetchCanceledOrders
- fetchCanceledAndClosedOrders
- fetchLedger
- fetchMyTrades
- fetchPosition
- fetchPositions
- fetchFundingRateHistory
- fetchFundingRate
- fetchFundingRates
- fetchFundingIntervals
- fetchFundingHistory
- reduceMargin
- addMargin
- fetchLeverage
- setLeverage
- setMarginMode
- setPositionMode
- fetchOpenInterest
- fetchTransfers
- transfer
- fetchDepositWithdrawFees
- borrowCrossMargin
- borrowIsolatedMargin
- repayIsolatedMargin
- repayCrossMargin
- fetchMyLiquidations
- fetchIsolatedBorrowRate
- fetchCrossBorrowRate
- fetchBorrowInterest
- closePosition
- closeAllPositions
- fetchMarginMode
- fetchPositionsHistory
- fetchConvertQuote
- createConvertTrade
- fetchConvertTradeHistory
- fetchConvertCurrencies
- fetchFundingInterval
- fetchLongShortRatioHistory
- watchTicker
- unWatchTicker
- watchTickers
- watchBidsAsks
- watchOHLCV
- unWatchOHLCV
- watchOrderBook
- unWatchOrderBook
- watchOrderBookForSymbols
- watchTrades
- watchTradesForSymbols
- unWatchTrades
- watchPositions
- watchOrders
- watchMyTrades
- watchBalance
setSandboxMode
enables or disables demo trading mode, if enabled will send PAPTRADING=1 in headers
Kind: instance method of bitget
| Param |
|---|
| enabled |
bitget.setSandboxMode (enabled)enableDemoTrading
enables or disables demo trading mode, if enabled will send PAPTRADING=1 in headers
Kind: instance method of bitget
| Param |
|---|
| enabled |
bitget.enableDemoTrading (enabled)fetchTime
fetches the current integer timestamp in milliseconds from the exchange server
Kind: instance method of bitget
Returns: int - the current integer timestamp in milliseconds from the exchange server
See: https://www.bitget.com/api-doc/common/public/Get-Server-Time
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.fetchTime (params?)fetchMarkets
retrieves data on all markets for bitget
Kind: instance method of bitget
Returns: Array<object> - an array of objects representing market data
See
- https://www.bitget.com/api-doc/spot/market/Get-Symbols
- https://www.bitget.com/api-doc/contract/market/Get-All-Symbols-Contracts
- https://www.bitget.com/api-doc/margin/common/support-currencies
- https://www.bitget.com/api-doc/uta/public/Instruments
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.fetchMarkets (params?)fetchCurrencies
fetches all available currencies on an exchange
Kind: instance method of bitget
Returns: object - an associative dictionary of currencies
See: https://www.bitget.com/api-doc/spot/market/Get-Coin-List
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.fetchCurrencies (params?)fetchMarketLeverageTiers
retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes for a single market
Kind: instance method of bitget
Returns: object - a leverage tiers structure
See
- https://www.bitget.com/api-doc/contract/position/Get-Query-Position-Lever
- https://www.bitget.com/api-doc/margin/cross/account/Cross-Tier-Data
- https://www.bitget.com/api-doc/margin/isolated/account/Isolated-Tier-Data
- https://www.bitget.com/api-doc/uta/public/Get-Position-Tier-Data
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | string | No | for spot margin 'cross' or 'isolated', default is 'isolated' |
| params.code | string | No | required for cross spot margin |
| params.productType | string | No | contract and uta only 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES' |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.fetchMarketLeverageTiers (symbol, params?)fetchDeposits
fetch all deposits made to an account
Kind: instance method of bitget
Returns: Array<object> - a list of transaction structures
See: https://www.bitget.com/api-doc/spot/account/Get-Deposit-Record
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| since | int | No | the earliest time in ms to fetch deposits for |
| limit | int | No | the maximum number of deposits structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | end time in milliseconds |
| params.idLessThan | string | No | return records with id less than the provided value |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
bitget.fetchDeposits (code, since?, limit?, params?)withdraw
make a withdrawal
Kind: instance method of bitget
Returns: object - a transaction structure
See: https://www.bitget.com/api-doc/spot/account/Wallet-Withdrawal
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| amount | float | Yes | the amount to withdraw |
| address | string | Yes | the address to withdraw to |
| tag | string | Yes | |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.chain | string | No | the blockchain network the withdrawal is taking place on |
bitget.withdraw (code, amount, address, tag, params?)fetchWithdrawals
fetch all withdrawals made from an account
Kind: instance method of bitget
Returns: Array<object> - a list of transaction structures
See: https://www.bitget.com/api-doc/spot/account/Get-Withdraw-Record
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| since | int | No | the earliest time in ms to fetch withdrawals for |
| limit | int | No | the maximum number of withdrawals structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | end time in milliseconds |
| params.idLessThan | string | No | return records with id less than the provided value |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
bitget.fetchWithdrawals (code, since?, limit?, params?)fetchDepositAddress
fetch the deposit address for a currency associated with this account
Kind: instance method of bitget
Returns: object - an address structure
See: https://www.bitget.com/api-doc/spot/account/Get-Deposit-Address
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.fetchDepositAddress (code, params?)fetchOrderBook
fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of bitget
Returns: object - A dictionary of order book structures indexed by market symbols
See
- https://www.bitget.com/api-doc/spot/market/Get-Orderbook
- https://www.bitget.com/api-doc/contract/market/Get-Merge-Depth
- https://www.bitget.com/api-doc/uta/public/OrderBook
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the order book for |
| limit | int | No | the maximum amount of order book entries to return |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.fetchOrderBook (symbol, limit?, params?)fetchTicker
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
Kind: instance method of bitget
Returns: object - a ticker structure
See
- https://www.bitget.com/api-doc/spot/market/Get-Tickers
- https://www.bitget.com/api-doc/contract/market/Get-Ticker
- https://www.bitget.com/api-doc/uta/public/Tickers
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the ticker for |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.fetchTicker (symbol, params?)fetchMarkPrice
fetches the mark price for a specific market
Kind: instance method of bitget
Returns: object - a ticker structure
See: https://www.bitget.com/api-doc/contract/market/Get-Symbol-Price
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the ticker for |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.fetchMarkPrice (symbol, params?)fetchTickers
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
Kind: instance method of bitget
Returns: object - a dictionary of ticker structures
See
- https://www.bitget.com/api-doc/spot/market/Get-Tickers
- https://www.bitget.com/api-doc/contract/market/Get-All-Symbol-Ticker
- https://www.bitget.com/api-doc/uta/public/Tickers
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string>, undefined | Yes | unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
| params.subType | string | No | contract only 'linear', 'inverse' |
| params.productType | string | No | contract only 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES' |
bitget.fetchTickers (symbols, params?)fetchTrades
get the list of most recent trades for a particular symbol
Kind: instance method of bitget
Returns: Array<Trade> - a list of trade structures
See
- https://www.bitget.com/api-doc/spot/market/Get-Recent-Trades
- https://www.bitget.com/api-doc/spot/market/Get-Market-Trades
- https://www.bitget.com/api-doc/contract/market/Get-Recent-Fills
- https://www.bitget.com/api-doc/contract/market/Get-Fills-History
- https://www.bitget.com/api-doc/uta/public/Fills
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch trades for |
| since | int | No | timestamp in ms of the earliest trade to fetch |
| limit | int | No | the maximum amount of trades to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
| params.until | int | No | only applies to publicSpotGetV2SpotMarketFillsHistory and publicMixGetV2MixMarketFillsHistory the latest time in ms to fetch trades for |
| params.paginate | boolean | No | only applies to publicSpotGetV2SpotMarketFillsHistory and publicMixGetV2MixMarketFillsHistory default false, when true will automatically paginate by calling this endpoint multiple times |
bitget.fetchTrades (symbol, since?, limit?, params?)fetchTradingFee
fetch the trading fees for a market
Kind: instance method of bitget
Returns: object - a fee structure
See: https://www.bitget.com/api-doc/common/public/Get-Trade-Rate
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | string | No | 'isolated' or 'cross', for finding the fee rate of spot margin trading pairs |
bitget.fetchTradingFee (symbol, params?)fetchTradingFees
fetch the trading fees for multiple markets
Kind: instance method of bitget
Returns: object - a dictionary of fee structures indexed by market symbols
See
- https://www.bitget.com/api-doc/spot/market/Get-Symbols
- https://www.bitget.com/api-doc/contract/market/Get-All-Symbols-Contracts
- https://www.bitget.com/api-doc/margin/common/support-currencies
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.productType | string | No | contract only 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES' |
| params.margin | boolean | No | set to true for spot margin |
bitget.fetchTradingFees (params?)fetchOHLCV
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of bitget
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume
See
- https://www.bitget.com/api-doc/spot/market/Get-Candle-Data
- https://www.bitget.com/api-doc/spot/market/Get-History-Candle-Data
- https://www.bitget.com/api-doc/contract/market/Get-Candle-Data
- https://www.bitget.com/api-doc/contract/market/Get-History-Candle-Data
- https://www.bitget.com/api-doc/contract/market/Get-History-Index-Candle-Data
- https://www.bitget.com/api-doc/contract/market/Get-History-Mark-Candle-Data
- https://www.bitget.com/api-doc/uta/public/Get-Candle-Data
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | string | Yes | the length of time each candle represents |
| since | int | No | timestamp in ms of the earliest candle to fetch |
| limit | int | No | the maximum amount of candles to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
| params.until | int | No | timestamp in ms of the latest candle to fetch |
| params.useHistoryEndpoint | boolean | No | whether to force to use historical endpoint (it has max limit of 200) |
| params.useHistoryEndpointForPagination | boolean | No | whether to force to use historical endpoint for pagination (default true) |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
| params.price | string | No | swap only "mark" (to fetch mark price candles) or "index" (to fetch index price candles) |
bitget.fetchOHLCV (symbol, timeframe, since?, limit?, params?)fetchBalance
query for balance and get the amount of funds available for trading or funds locked in orders
Kind: instance method of bitget
Returns: object - a balance structure
See
- https://www.bitget.com/api-doc/spot/account/Get-Account-Assets
- https://www.bitget.com/api-doc/contract/account/Get-Account-List
- https://www.bitget.com/api-doc/margin/cross/account/Get-Cross-Assets
- https://www.bitget.com/api-doc/margin/isolated/account/Get-Isolated-Assets
- https://bitgetlimited.github.io/apidoc/en/margin/#get-cross-assets
- https://bitgetlimited.github.io/apidoc/en/margin/#get-isolated-assets
- https://www.bitget.com/api-doc/uta/account/Get-Account
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.productType | string | No | contract only 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES' |
| params.uta | string | No | set to true for the unified trading account (uta), defaults to false |
bitget.fetchBalance (params?)createMarketBuyOrderWithCost
create a market buy order by providing the symbol and cost
Kind: instance method of bitget
Returns: object - an order structure
See
- https://www.bitget.com/api-doc/spot/trade/Place-Order
- https://www.bitget.com/api-doc/margin/cross/trade/Cross-Place-Order
- https://www.bitget.com/api-doc/margin/isolated/trade/Isolated-Place-Order
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to create an order in |
| cost | float | Yes | how much you want to trade in units of the quote currency |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.createMarketBuyOrderWithCost (symbol, cost, params?)createOrder
create a trade order
Kind: instance method of bitget
Returns: object - an order structure
See
- https://www.bitget.com/api-doc/spot/trade/Place-Order
- https://www.bitget.com/api-doc/spot/plan/Place-Plan-Order
- https://www.bitget.com/api-doc/contract/trade/Place-Order
- https://www.bitget.com/api-doc/contract/plan/Place-Tpsl-Order
- https://www.bitget.com/api-doc/contract/plan/Place-Plan-Order
- https://www.bitget.com/api-doc/margin/cross/trade/Cross-Place-Order
- https://www.bitget.com/api-doc/margin/isolated/trade/Isolated-Place-Order
- https://www.bitget.com/api-doc/uta/trade/Place-Order
- https://www.bitget.com/api-doc/uta/strategy/Place-Strategy-Order
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to create an order in |
| type | string | Yes | 'market' or 'limit' |
| side | string | Yes | 'buy' or 'sell' |
| amount | float | Yes | how much you want to trade in units of the base currency |
| price | float | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders, and used as the execution price for contract stop-loss / take-profit orders |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.cost | float | No | spot only how much you want to trade in units of the quote currency, for market buy orders only |
| params.triggerPrice | float | No | swap only The price at which a trigger order is triggered at |
| params.stopLossPrice | float | No | swap only The price at which a stop loss order is triggered at |
| params.takeProfitPrice | float | No | swap only The price at which a take profit order is triggered at |
| params.takeProfit | object | No | takeProfit object in params containing the triggerPrice at which the attached take profit order will be triggered (perpetual swap markets only) |
| params.takeProfit.triggerPrice | float | No | swap only take profit trigger price |
| params.stopLoss | object | No | stopLoss object in params containing the triggerPrice at which the attached stop loss order will be triggered (perpetual swap markets only) |
| params.stopLoss.triggerPrice | float | No | swap only stop loss trigger price |
| params.timeInForce | string | No | "GTC", "IOC", "FOK", or "PO" |
| params.marginMode | string | No | 'isolated' or 'cross' for spot margin trading |
| params.loanType | string | No | spot margin only 'normal', 'autoLoan', 'autoRepay', or 'autoLoanAndRepay' default is 'normal' |
| params.holdSide | string | No | contract stopLossPrice, takeProfitPrice only Two-way position: ('long' or 'short'), one-way position: ('buy' or 'sell') |
| params.stopLoss.price | float | No | swap only the execution price for a stop loss attached to a trigger order |
| params.takeProfit.price | float | No | swap only the execution price for a take profit attached to a trigger order |
| params.stopLoss.type | string | No | swap only the type for a stop loss attached to a trigger order, 'fill_price', 'index_price' or 'mark_price', default is 'mark_price' |
| params.takeProfit.type | string | No | swap only the type for a take profit attached to a trigger order, 'fill_price', 'index_price' or 'mark_price', default is 'mark_price' |
| params.trailingPercent | string | No | swap and future only the percent to trail away from the current market price, rate can not be greater than 10 |
| params.trailingTriggerPrice | string | No | swap and future only the price to trigger a trailing stop order, default uses the price argument |
| params.triggerType | string | No | swap and future only 'fill_price', 'mark_price' or 'index_price' |
| params.oneWayMode | boolean | No | swap and future only required to set this to true in one_way_mode and you can leave this as undefined in hedge_mode, can adjust the mode using the setPositionMode() method |
| params.hedged | bool | No | swap and future only true for hedged mode, false for one way mode, default is false |
| params.reduceOnly | bool | No | true or false whether the order is reduce-only |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
| params.posSide | string | No | uta only hedged two-way position side, long or short |
bitget.createOrder (symbol, type, side, amount, price?, params?)createOrders
create a list of trade orders (all orders should be of the same symbol)
Kind: instance method of bitget
Returns: object - an order structure
See
- https://www.bitget.com/api-doc/spot/trade/Batch-Place-Orders
- https://www.bitget.com/api-doc/contract/trade/Batch-Order
- https://www.bitget.com/api-doc/margin/isolated/trade/Isolated-Batch-Order
- https://www.bitget.com/api-doc/margin/cross/trade/Cross-Batch-Order
- https://www.bitget.com/api-doc/uta/trade/Place-Batch
| Param | Type | Required | Description |
|---|---|---|---|
| orders | Array | Yes | list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params |
| params | object | No | extra parameters specific to the api endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.createOrders (orders, params?)editOrder
edit a trade order
Kind: instance method of bitget
Returns: object - an order structure
See
- https://www.bitget.com/api-doc/spot/plan/Modify-Plan-Order
- https://www.bitget.com/api-doc/spot/trade/Cancel-Replace-Order
- https://www.bitget.com/api-doc/contract/trade/Modify-Order
- https://www.bitget.com/api-doc/contract/plan/Modify-Tpsl-Order
- https://www.bitget.com/api-doc/contract/plan/Modify-Plan-Order
- https://www.bitget.com/api-doc/uta/trade/Modify-Order
- https://www.bitget.com/api-doc/uta/strategy/Modify-Strategy-Order
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | cancel order id |
| symbol | string | Yes | unified symbol of the market to create an order in |
| type | string | Yes | 'market' or 'limit' |
| side | string | Yes | 'buy' or 'sell' |
| amount | float | Yes | how much you want to trade in units of the base currency |
| price | float | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.triggerPrice | float | No | the price that a trigger order is triggered at |
| params.stopLossPrice | float | No | swap only The price at which a stop loss order is triggered at |
| params.takeProfitPrice | float | No | swap only The price at which a take profit order is triggered at |
| params.takeProfit | object | No | takeProfit object in params containing the triggerPrice at which the attached take profit order will be triggered (perpetual swap markets only) |
| params.takeProfit.triggerPrice | float | No | swap only take profit trigger price |
| params.stopLoss | object | No | stopLoss object in params containing the triggerPrice at which the attached stop loss order will be triggered (perpetual swap markets only) |
| params.stopLoss.triggerPrice | float | No | swap only stop loss trigger price |
| params.stopLoss.price | float | No | swap only the execution price for a stop loss attached to a trigger order |
| params.takeProfit.price | float | No | swap only the execution price for a take profit attached to a trigger order |
| params.stopLoss.type | string | No | swap only the type for a stop loss attached to a trigger order, 'fill_price', 'index_price' or 'mark_price', default is 'mark_price' |
| params.takeProfit.type | string | No | swap only the type for a take profit attached to a trigger order, 'fill_price', 'index_price' or 'mark_price', default is 'mark_price' |
| params.trailingPercent | string | No | swap and future only the percent to trail away from the current market price, rate can not be greater than 10 |
| params.trailingTriggerPrice | string | No | swap and future only the price to trigger a trailing stop order, default uses the price argument |
| params.newTriggerType | string | No | swap and future only 'fill_price', 'mark_price' or 'index_price' |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.editOrder (id, symbol, type, side, amount, price?, params?)cancelOrder
cancels an open order
Kind: instance method of bitget
Returns: object - An order structure
See
- https://www.bitget.com/api-doc/spot/trade/Cancel-Order
- https://www.bitget.com/api-doc/spot/plan/Cancel-Plan-Order
- https://www.bitget.com/api-doc/contract/trade/Cancel-Order
- https://www.bitget.com/api-doc/contract/plan/Cancel-Plan-Order
- https://www.bitget.com/api-doc/margin/cross/trade/Cross-Cancel-Order
- https://www.bitget.com/api-doc/margin/isolated/trade/Isolated-Cancel-Order
- https://www.bitget.com/api-doc/uta/trade/Cancel-Order
- https://www.bitget.com/api-doc/uta/strategy/Cancel-Strategy-Order
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | order id |
| symbol | string | Yes | unified symbol of the market the order was made in |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | string | No | 'isolated' or 'cross' for spot margin trading |
| params.trigger | boolean | No | set to true for canceling trigger orders |
| params.planType | string | No | swap only either profit_plan, loss_plan, normal_plan, pos_profit, pos_loss, moving_plan or track_plan |
| params.trailing | boolean | No | set to true if you want to cancel a trailing order |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
| params.clientOrderId | string | No | the clientOrderId of the order, id does not need to be provided if clientOrderId is provided |
bitget.cancelOrder (id, symbol, params?)cancelOrders
cancel multiple orders
Kind: instance method of bitget
Returns: object - an array of order structures
See
- https://www.bitget.com/api-doc/spot/trade/Batch-Cancel-Orders
- https://www.bitget.com/api-doc/contract/trade/Batch-Cancel-Orders
- https://www.bitget.com/api-doc/contract/plan/Cancel-Plan-Order
- https://www.bitget.com/api-doc/margin/cross/trade/Cross-Batch-Cancel-Order
- https://www.bitget.com/api-doc/margin/isolated/trade/Isolated-Batch-Cancel-Orders
- https://www.bitget.com/api-doc/uta/trade/Cancel-Batch
| Param | Type | Required | Description |
|---|---|---|---|
| ids | Array<string> | Yes | order ids |
| symbol | string | Yes | unified market symbol, default is undefined |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | string | No | 'isolated' or 'cross' for spot margin trading |
| params.trigger | boolean | No | contract only set to true for canceling trigger orders |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.cancelOrders (ids, symbol, params?)cancelAllOrders
cancel all open orders
Kind: instance method of bitget
Returns: Array<object> - a list of order structures
See
- https://www.bitget.com/api-doc/spot/trade/Cancel-Symbol-Orders
- https://www.bitget.com/api-doc/spot/plan/Batch-Cancel-Plan-Order
- https://www.bitget.com/api-doc/contract/trade/Batch-Cancel-Orders
- https://www.bitget.com/api-doc/margin/cross/trade/Cross-Batch-Cancel-Order
- https://www.bitget.com/api-doc/margin/isolated/trade/Isolated-Batch-Cancel-Orders
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | string | No | 'isolated' or 'cross' for spot margin trading |
| params.trigger | boolean | No | contract only set to true for canceling trigger orders |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.cancelAllOrders (symbol, params?)fetchOrder
fetches information on an order made by the user
Kind: instance method of bitget
Returns: object - An order structure
See
- https://www.bitget.com/api-doc/spot/trade/Get-Order-Info
- https://www.bitget.com/api-doc/contract/trade/Get-Order-Details
- https://www.bitget.com/api-doc/uta/trade/Get-Order-Details
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | the order id |
| symbol | string | Yes | unified symbol of the market the order was made in |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
| params.clientOrderId | string | No | the clientOrderId of the order, id does not need to be provided if clientOrderId is provided |
bitget.fetchOrder (id, symbol, params?)fetchOpenOrders
fetch all unfilled currently open orders
Kind: instance method of bitget
Returns: Array<Order> - a list of order structures
See
- https://www.bitget.com/api-doc/spot/trade/Get-Unfilled-Orders
- https://www.bitget.com/api-doc/spot/plan/Get-Current-Plan-Order
- https://www.bitget.com/api-doc/contract/trade/Get-Orders-Pending
- https://www.bitget.com/api-doc/contract/plan/get-orders-plan-pending
- https://www.bitget.com/api-doc/margin/cross/trade/Get-Cross-Open-Orders
- https://www.bitget.com/api-doc/margin/isolated/trade/Isolated-Open-Orders
- https://www.bitget.com/api-doc/uta/strategy/Get-Unfilled-Strategy-Orders
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| since | int | No | the earliest time in ms to fetch open orders for |
| limit | int | No | the maximum number of open order structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | the latest time in ms to fetch orders for |
| params.planType | string | No | contract stop only 'normal_plan': average trigger order, 'profit_loss': opened tp/sl orders, 'track_plan': trailing stop order, default is 'normal_plan' |
| params.trigger | boolean | No | set to true for fetching trigger orders |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
| params.isPlan | string | No | swap only 'plan' for stop orders and 'profit_loss' for tp/sl orders, default is 'plan' |
| params.trailing | boolean | No | set to true if you want to fetch trailing orders |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.fetchOpenOrders (symbol, since?, limit?, params?)fetchClosedOrders
fetches information on multiple closed orders made by the user
Kind: instance method of bitget
Returns: Array<Order> - a list of order structures
See
- https://www.bitget.com/api-doc/spot/trade/Get-History-Orders
- https://www.bitget.com/api-doc/spot/plan/Get-History-Plan-Order
- https://www.bitget.com/api-doc/contract/trade/Get-Orders-History
- https://www.bitget.com/api-doc/contract/plan/orders-plan-history
- https://www.bitget.com/api-doc/margin/cross/trade/Get-Cross-Order-History
- https://www.bitget.com/api-doc/margin/isolated/trade/Get-Isolated-Order-History
- https://www.bitget.com/api-doc/uta/trade/Get-Order-History
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the closed orders |
| since | int | No | timestamp in ms of the earliest order |
| limit | int | No | the max number of closed orders to return |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | the latest time in ms to fetch orders for |
| params.planType | string | No | contract stop only 'normal_plan': average trigger order, 'profit_loss': opened tp/sl orders, 'track_plan': trailing stop order, default is 'normal_plan' |
| params.trigger | boolean | No | set to true for fetching trigger orders |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
| params.isPlan | string | No | swap only 'plan' for stop orders and 'profit_loss' for tp/sl orders, default is 'plan' |
| params.trailing | boolean | No | set to true if you want to fetch trailing orders |
bitget.fetchClosedOrders (symbol, since?, limit?, params?)fetchCanceledOrders
fetches information on multiple canceled orders made by the user
Kind: instance method of bitget
Returns: object - a list of order structures
See
- https://www.bitget.com/api-doc/spot/trade/Get-History-Orders
- https://www.bitget.com/api-doc/spot/plan/Get-History-Plan-Order
- https://www.bitget.com/api-doc/contract/trade/Get-Orders-History
- https://www.bitget.com/api-doc/contract/plan/orders-plan-history
- https://www.bitget.com/api-doc/margin/cross/trade/Get-Cross-Order-History
- https://www.bitget.com/api-doc/margin/isolated/trade/Get-Isolated-Order-History
- https://www.bitget.com/api-doc/uta/trade/Get-Order-History
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the canceled orders |
| since | int | No | timestamp in ms of the earliest order |
| limit | int | No | the max number of canceled orders to return |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | the latest time in ms to fetch orders for |
| params.planType | string | No | contract stop only 'normal_plan': average trigger order, 'profit_loss': opened tp/sl orders, 'track_plan': trailing stop order, default is 'normal_plan' |
| params.trigger | boolean | No | set to true for fetching trigger orders |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
| params.isPlan | string | No | swap only 'plan' for stop orders and 'profit_loss' for tp/sl orders, default is 'plan' |
| params.trailing | boolean | No | set to true if you want to fetch trailing orders |
bitget.fetchCanceledOrders (symbol, since?, limit?, params?)fetchCanceledAndClosedOrders
fetches information on multiple canceled and closed orders made by the user
Kind: instance method of bitget
Returns: Array<Order> - a list of order structures
See
- https://www.bitget.com/api-doc/spot/trade/Get-History-Orders
- https://www.bitget.com/api-doc/spot/plan/Get-History-Plan-Order
- https://www.bitget.com/api-doc/contract/trade/Get-Orders-History
- https://www.bitget.com/api-doc/contract/plan/orders-plan-history
- https://www.bitget.com/api-doc/margin/cross/trade/Get-Cross-Order-History
- https://www.bitget.com/api-doc/margin/isolated/trade/Get-Isolated-Order-History
- https://www.bitget.com/api-doc/uta/trade/Get-Order-History
- https://www.bitget.com/api-doc/uta/strategy/Get-History-Strategy-Orders
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market orders were made in |
| since | int | No | the earliest time in ms to fetch orders for |
| limit | int | No | the maximum number of order structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | the latest time in ms to fetch orders for |
| params.planType | string | No | contract stop only 'normal_plan': average trigger order, 'profit_loss': opened tp/sl orders, 'track_plan': trailing stop order, default is 'normal_plan' |
| params.trigger | boolean | No | set to true for fetching trigger orders |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
| params.isPlan | string | No | swap only 'plan' for stop orders and 'profit_loss' for tp/sl orders, default is 'plan' |
| params.trailing | boolean | No | set to true if you want to fetch trailing orders |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.fetchCanceledAndClosedOrders (symbol, since?, limit?, params?)fetchLedger
fetch the history of changes, actions done by the user or operations that altered the balance of the user
Kind: instance method of bitget
Returns: object - a ledger structure
See
- https://www.bitget.com/api-doc/spot/account/Get-Account-Bills
- https://www.bitget.com/api-doc/contract/account/Get-Account-Bill
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | No | unified currency code, default is undefined |
| since | int | No | timestamp in ms of the earliest ledger entry, default is undefined |
| limit | int | No | max number of ledger entries to return, default is undefined |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | end time in ms |
| params.symbol | string | No | contract only unified market symbol |
| params.productType | string | No | contract only 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES' |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
bitget.fetchLedger (code?, since?, limit?, params?)fetchMyTrades
fetch all trades made by the user
Kind: instance method of bitget
Returns: Array<Trade> - a list of trade structures
See
- https://www.bitget.com/api-doc/spot/trade/Get-Fills
- https://www.bitget.com/api-doc/contract/trade/Get-Order-Fills
- https://www.bitget.com/api-doc/margin/cross/trade/Get-Cross-Order-Fills
- https://www.bitget.com/api-doc/margin/isolated/trade/Get-Isolated-Transaction-Details
- https://www.bitget.com/api-doc/uta/trade/Get-Order-Fills
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| since | int | No | the earliest time in ms to fetch trades for |
| limit | int | No | the maximum number of trades structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | the latest time in ms to fetch trades for |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
bitget.fetchMyTrades (symbol, since?, limit?, params?)fetchPosition
fetch data on a single open contract trade position
Kind: instance method of bitget
Returns: object - a position structure
See
- https://www.bitget.com/api-doc/contract/position/get-single-position
- https://www.bitget.com/api-doc/uta/trade/Get-Position
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market the position is held in |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.fetchPosition (symbol, params?)fetchPositions
fetch all open positions
Kind: instance method of bitget
Returns: Array<object> - a list of position structure
See
- https://www.bitget.com/api-doc/contract/position/get-all-position
- https://www.bitget.com/api-doc/contract/position/Get-History-Position
- https://www.bitget.com/api-doc/uta/trade/Get-Position
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | list of unified market symbols |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.marginCoin | string | No | the settle currency of the positions, needs to match the productType |
| params.productType | string | No | 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES' |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
| params.useHistoryEndpoint | boolean | No | default false, when true will use the historic endpoint to fetch positions |
| params.method | string | No | either (default) 'privateMixGetV2MixPositionAllPosition', 'privateMixGetV2MixPositionHistoryPosition', or 'privateUtaGetV3PositionCurrentPosition' |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.fetchPositions (symbols?, params?)fetchFundingRateHistory
fetches historical funding rate prices
Kind: instance method of bitget
Returns: Array<object> - a list of funding rate structures
See
- https://www.bitget.com/api-doc/contract/market/Get-History-Funding-Rate
- https://www.bitget.com/api-doc/uta/public/Get-History-Funding-Rate
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the funding rate history for |
| since | int | No | timestamp in ms of the earliest funding rate to fetch |
| limit | int | No | the maximum amount of funding rate structures to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
bitget.fetchFundingRateHistory (symbol, since?, limit?, params?)fetchFundingRate
fetch the current funding rate
Kind: instance method of bitget
Returns: object - a funding rate structure
See
- https://www.bitget.com/api-doc/contract/market/Get-Current-Funding-Rate
- https://www.bitget.com/api-doc/contract/market/Get-Symbol-Next-Funding-Time
- https://www.bitget.com/api-doc/uta/public/Get-Current-Funding-Rate
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
| params.method | string | No | either (default) 'publicMixGetV2MixMarketCurrentFundRate' or 'publicMixGetV2MixMarketFundingTime' |
bitget.fetchFundingRate (symbol, params?)fetchFundingRates
fetch the current funding rates for all markets
Kind: instance method of bitget
Returns: object - a dictionary of funding rate structures, indexed by market symbols
See: https://www.bitget.com/api-doc/contract/market/Get-All-Symbol-Ticker
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | list of unified market symbols |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.subType | string | No | contract only 'linear', 'inverse' |
| params.productType | string | No | contract only 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES' |
| params.method | string | No | either (default) 'publicMixGetV2MixMarketTickers' or 'publicMixGetV2MixMarketCurrentFundRate' |
bitget.fetchFundingRates (symbols?, params?)fetchFundingIntervals
fetch the funding rate interval for multiple markets
Kind: instance method of bitget
Returns: Array<object> - a list of funding rate structures
See: https://www.bitget.com/api-doc/contract/market/Get-All-Symbol-Ticker
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | list of unified market symbols |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.productType | string | No | 'USDT-FUTURES' (default), 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES' |
bitget.fetchFundingIntervals (symbols?, params?)fetchFundingHistory
fetch the funding history
Kind: instance method of bitget
Returns: Array<object> - a list of funding history structures
See: https://www.bitget.com/api-doc/contract/account/Get-Account-Bill
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| since | int | No | the starting timestamp in milliseconds |
| limit | int | No | the number of entries to return |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | the latest time in ms to fetch funding history for |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
bitget.fetchFundingHistory (symbol, since?, limit?, params?)reduceMargin
remove margin from a position
Kind: instance method of bitget
Returns: object - a margin structure
See: https://www.bitget.com/api-doc/contract/account/Change-Margin
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| amount | float | Yes | the amount of margin to remove |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.reduceMargin (symbol, amount, params?)addMargin
add margin
Kind: instance method of bitget
Returns: object - a margin structure
See: https://www.bitget.com/api-doc/contract/account/Change-Margin
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| amount | float | Yes | the amount of margin to add |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.addMargin (symbol, amount, params?)fetchLeverage
fetch the set leverage for a market
Kind: instance method of bitget
Returns: object - a leverage structure
See: https://www.bitget.com/api-doc/contract/account/Get-Single-Account
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.fetchLeverage (symbol, params?)setLeverage
set the level of leverage for a market
Kind: instance method of bitget
Returns: object - response from the exchange
See
- https://www.bitget.com/api-doc/contract/account/Change-Leverage
- https://www.bitget.com/api-doc/uta/account/Change-Leverage
| Param | Type | Required | Description |
|---|---|---|---|
| leverage | int | Yes | the rate of leverage |
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.holdSide | string | No | isolated only position direction, 'long' or 'short' |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
| params.posSide | boolean | No | required for uta isolated margin, long or short |
bitget.setLeverage (leverage, symbol, params?)setMarginMode
set margin mode to 'cross' or 'isolated'
Kind: instance method of bitget
Returns: object - response from the exchange
See: https://www.bitget.com/api-doc/contract/account/Change-Margin-Mode
| Param | Type | Required | Description |
|---|---|---|---|
| marginMode | string | Yes | 'cross' or 'isolated' |
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.setMarginMode (marginMode, symbol, params?)setPositionMode
set hedged to true or false for a market
Kind: instance method of bitget
Returns: object - response from the exchange
See
- https://www.bitget.com/api-doc/contract/account/Change-Hold-Mode
- https://www.bitget.com/api-doc/uta/account/Change-Position-Mode
| Param | Type | Required | Description |
|---|---|---|---|
| hedged | bool | Yes | set to true to use dualSidePosition |
| symbol | string | Yes | not used by bitget setPositionMode () |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.productType | string | No | required if not uta and symbol is undefined: 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES' |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.setPositionMode (hedged, symbol, params?)fetchOpenInterest
retrieves the open interest of a contract trading pair
Kind: instance method of bitget
Returns: object - an open interest structure/docs/manual#open-interest-structure
See
- https://www.bitget.com/api-doc/contract/market/Get-Open-Interest
- https://www.bitget.com/api-doc/uta/public/Get-Open-Interest
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified CCXT market symbol |
| params | object | No | exchange specific parameters |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.fetchOpenInterest (symbol, params?)fetchTransfers
fetch a history of internal transfers made on an account
Kind: instance method of bitget
Returns: Array<object> - a list of transfer structures
See: https://www.bitget.com/api-doc/spot/account/Get-Account-TransferRecords
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code of the currency transferred |
| since | int | No | the earliest time in ms to fetch transfers for |
| limit | int | No | the maximum number of transfers structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | the latest time in ms to fetch entries for |
bitget.fetchTransfers (code, since?, limit?, params?)transfer
transfer currency internally between wallets on the same account
Kind: instance method of bitget
Returns: object - a transfer structure
See: https://www.bitget.com/api-doc/spot/account/Wallet-Transfer
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| amount | float | Yes | amount to transfer |
| fromAccount | string | Yes | account to transfer from |
| toAccount | string | Yes | account to transfer to |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.symbol | string | No | unified CCXT market symbol, required when transferring to or from an account type that is a leveraged position-by-position account |
| params.clientOid | string | No | custom id |
bitget.transfer (code, amount, fromAccount, toAccount, params?)fetchDepositWithdrawFees
fetch deposit and withdraw fees
Kind: instance method of bitget
Returns: object - a list of fee structures
See: https://www.bitget.com/api-doc/spot/market/Get-Coin-List
| Param | Type | Required | Description |
|---|---|---|---|
| codes | Array<string>, undefined | Yes | list of unified currency codes |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.fetchDepositWithdrawFees (codes, params?)borrowCrossMargin
create a loan to borrow margin
Kind: instance method of bitget
Returns: object - a margin loan structure
See: https://www.bitget.com/api-doc/margin/cross/account/Cross-Borrow
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code of the currency to borrow |
| amount | string | Yes | the amount to borrow |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.borrowCrossMargin (code, amount, params?)borrowIsolatedMargin
create a loan to borrow margin
Kind: instance method of bitget
Returns: object - a margin loan structure
See: https://www.bitget.com/api-doc/margin/isolated/account/Isolated-Borrow
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| code | string | Yes | unified currency code of the currency to borrow |
| amount | string | Yes | the amount to borrow |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.borrowIsolatedMargin (symbol, code, amount, params?)repayIsolatedMargin
repay borrowed margin and interest
Kind: instance method of bitget
Returns: object - a margin loan structure
See: https://www.bitget.com/api-doc/margin/isolated/account/Isolated-Repay
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| code | string | Yes | unified currency code of the currency to repay |
| amount | string | Yes | the amount to repay |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.repayIsolatedMargin (symbol, code, amount, params?)repayCrossMargin
repay borrowed margin and interest
Kind: instance method of bitget
Returns: object - a margin loan structure
See: https://www.bitget.com/api-doc/margin/cross/account/Cross-Repay
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code of the currency to repay |
| amount | string | Yes | the amount to repay |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.repayCrossMargin (code, amount, params?)fetchMyLiquidations
retrieves the users liquidated positions
Kind: instance method of bitget
Returns: object - an array of liquidation structures
See
- https://www.bitget.com/api-doc/margin/cross/record/Get-Cross-Liquidation-Records
- https://www.bitget.com/api-doc/margin/isolated/record/Get-Isolated-Liquidation-Records
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | unified CCXT market symbol |
| since | int | No | the earliest time in ms to fetch liquidations for |
| limit | int | No | the maximum number of liquidation structures to retrieve |
| params | object | No | exchange specific parameters for the bitget api endpoint |
| params.until | int | No | timestamp in ms of the latest liquidation |
| params.marginMode | string | No | 'cross' or 'isolated' default value is 'cross' |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
bitget.fetchMyLiquidations (symbol?, since?, limit?, params?)fetchIsolatedBorrowRate
fetch the rate of interest to borrow a currency for margin trading
Kind: instance method of bitget
Returns: object - an isolated borrow rate structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.fetchIsolatedBorrowRate (symbol, params?)fetchCrossBorrowRate
fetch the rate of interest to borrow a currency for margin trading
Kind: instance method of bitget
Returns: object - a borrow rate structure
See
- https://www.bitget.com/api-doc/margin/cross/account/Get-Cross-Margin-Interest-Rate-And-Borrowable
- https://www.bitget.com/api-doc/uta/public/Get-Margin-Loans
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.fetchCrossBorrowRate (code, params?)fetchBorrowInterest
fetch the interest owed by the user for borrowing currency for margin trading
Kind: instance method of bitget
Returns: Array<object> - a list of borrow interest structures
See
- https://www.bitget.com/api-doc/margin/cross/record/Get-Cross-Interest-Records
- https://www.bitget.com/api-doc/margin/isolated/record/Get-Isolated-Interest-Records
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | No | unified currency code |
| symbol | string | No | unified market symbol when fetching interest in isolated markets |
| since | int | No | the earliest time in ms to fetch borrow interest for |
| limit | int | No | the maximum number of structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
bitget.fetchBorrowInterest (code?, symbol?, since?, limit?, params?)closePosition
closes an open position for a market
Kind: instance method of bitget
Returns: object - An order structure
See
- https://www.bitget.com/api-doc/contract/trade/Flash-Close-Position
- https://www.bitget.com/api-doc/uta/trade/Close-All-Positions
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified CCXT market symbol |
| side | string | No | one-way mode: 'buy' or 'sell', hedge-mode: 'long' or 'short' |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.closePosition (symbol, side?, params?)closeAllPositions
closes all open positions for a market type
Kind: instance method of bitget
Returns: Array<object> - A list of position structures
See
- https://www.bitget.com/api-doc/contract/trade/Flash-Close-Position
- https://www.bitget.com/api-doc/uta/trade/Close-All-Positions
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.productType | string | No | 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES' |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.closeAllPositions (params?)fetchMarginMode
fetches the margin mode of a trading pair
Kind: instance method of bitget
Returns: object - a margin mode structure
See: https://www.bitget.com/api-doc/contract/account/Get-Single-Account
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the margin mode for |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.fetchMarginMode (symbol, params?)fetchPositionsHistory
fetches historical positions
Kind: instance method of bitget
Returns: Array<object> - a list of position structures
See
- https://www.bitget.com/api-doc/contract/position/Get-History-Position
- https://www.bitget.com/api-doc/uta/trade/Get-Position-History
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | unified contract symbols |
| since | int | No | timestamp in ms of the earliest position to fetch, default=3 months ago, max range for params["until"] - since is 3 months |
| limit | int | No | the maximum amount of records to fetch, default=20, max=100 |
| params | object | Yes | extra parameters specific to the exchange api endpoint |
| params.until | int | No | timestamp in ms of the latest position to fetch, max range for params["until"] - since is 3 months |
| params.productType | string | No | USDT-FUTURES (default), COIN-FUTURES, USDC-FUTURES, SUSDT-FUTURES, SCOIN-FUTURES, or SUSDC-FUTURES |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.fetchPositionsHistory (symbols?, since?, limit?, params)fetchConvertQuote
fetch a quote for converting from one currency to another
Kind: instance method of bitget
Returns: object - a conversion structure
See: https://www.bitget.com/api-doc/common/convert/Get-Quoted-Price
| Param | Type | Required | Description |
|---|---|---|---|
| fromCode | string | Yes | the currency that you want to sell and convert from |
| toCode | string | Yes | the currency that you want to buy and convert into |
| amount | float | No | how much you want to trade in units of the from currency |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.fetchConvertQuote (fromCode, toCode, amount?, params?)createConvertTrade
convert from one currency to another
Kind: instance method of bitget
Returns: object - a conversion structure
See: https://www.bitget.com/api-doc/common/convert/Trade
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | the id of the trade that you want to make |
| fromCode | string | Yes | the currency that you want to sell and convert from |
| toCode | string | Yes | the currency that you want to buy and convert into |
| amount | float | Yes | how much you want to trade in units of the from currency |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.price | string | Yes | the price of the conversion, obtained from fetchConvertQuote() |
| params.toAmount | string | Yes | the amount you want to trade in units of the toCurrency, obtained from fetchConvertQuote() |
bitget.createConvertTrade (id, fromCode, toCode, amount, params?)fetchConvertTradeHistory
fetch the users history of conversion trades
Kind: instance method of bitget
Returns: Array<object> - a list of conversion structures
See: https://www.bitget.com/api-doc/common/convert/Get-Convert-Record
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | No | the unified currency code |
| since | int | No | the earliest time in ms to fetch conversions for |
| limit | int | No | the maximum number of conversion structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.fetchConvertTradeHistory (code?, since?, limit?, params?)fetchConvertCurrencies
fetches all available currencies that can be converted
Kind: instance method of bitget
Returns: object - an associative dictionary of currencies
See: https://www.bitget.com/api-doc/common/convert/Get-Convert-Currencies
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.fetchConvertCurrencies (params?)fetchFundingInterval
fetch the current funding rate interval
Kind: instance method of bitget
Returns: object - a funding rate structure
See
- https://www.bitget.com/api-doc/contract/market/Get-Symbol-Next-Funding-Time
- https://www.bitget.com/api-doc/uta/public/Get-Current-Funding-Rate
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.fetchFundingInterval (symbol, params?)fetchLongShortRatioHistory
fetches the long short ratio history for a unified market symbol
Kind: instance method of bitget
Returns: Array<object> - an array of long short ratio structures
See
- https://www.bitget.com/api-doc/common/apidata/Margin-Ls-Ratio
- https://www.bitget.com/api-doc/common/apidata/Account-Long-Short
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the long short ratio for |
| timeframe | string | No | the period for the ratio |
| since | int | No | the earliest time in ms to fetch ratios for |
| limit | int | No | the maximum number of long short ratio structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.fetchLongShortRatioHistory (symbol, timeframe?, since?, limit?, params?)bitget
watching delivery future markets is not yet implemented (perpertual future & swap is implemented)
bitget.bitget ()watchTicker
watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
Kind: instance method of bitget
Returns: object - a ticker structure
See
- https://www.bitget.com/api-doc/spot/websocket/public/Tickers-Channel
- https://www.bitget.com/api-doc/contract/websocket/public/Tickers-Channel
- https://www.bitget.com/api-doc/uta/websocket/public/Tickers-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to watch the ticker for |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.watchTicker (symbol, params?)unWatchTicker
unsubscribe from the ticker channel
Kind: instance method of bitget
Returns: any - status of the unwatch request
See
- https://www.bitget.com/api-doc/spot/websocket/public/Tickers-Channel
- https://www.bitget.com/api-doc/contract/websocket/public/Tickers-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to unwatch the ticker for |
| params | object | No | extra parameters specific to the exchange API endpoint |
bitget.unWatchTicker (symbol, params?)watchTickers
watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
Kind: instance method of bitget
Returns: object - a ticker structure
See
- https://www.bitget.com/api-doc/spot/websocket/public/Tickers-Channel
- https://www.bitget.com/api-doc/contract/websocket/public/Tickers-Channel
- https://www.bitget.com/api-doc/uta/websocket/public/Tickers-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | Yes | unified symbol of the market to watch the tickers for |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.watchTickers (symbols, params?)watchBidsAsks
watches best bid & ask for symbols
Kind: instance method of bitget
Returns: object - a ticker structure
See
- https://www.bitget.com/api-doc/spot/websocket/public/Tickers-Channel
- https://www.bitget.com/api-doc/contract/websocket/public/Tickers-Channel
- https://www.bitget.com/api-doc/uta/websocket/public/Tickers-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | Yes | unified symbol of the market to fetch the ticker for |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.watchBidsAsks (symbols, params?)watchOHLCV
watches historical candlestick data containing the open, high, low, close price, and the volume of a market
Kind: instance method of bitget
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume
See
- https://www.bitget.com/api-doc/spot/websocket/public/Candlesticks-Channel
- https://www.bitget.com/api-doc/contract/websocket/public/Candlesticks-Channel
- https://www.bitget.com/api-doc/uta/websocket/public/Candlesticks-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | string | Yes | the length of time each candle represents |
| since | int | No | timestamp in ms of the earliest candle to fetch |
| limit | int | No | the maximum amount of candles to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.watchOHLCV (symbol, timeframe, since?, limit?, params?)unWatchOHLCV
unsubscribe from the ohlcv channel
Kind: instance method of bitget
Returns: object - A dictionary of order book structures indexed by market symbols
See
- https://www.bitget.com/api-doc/spot/websocket/public/Candlesticks-Channel
- https://www.bitget.com/api-doc/contract/websocket/public/Candlesticks-Channel
- https://www.bitget.com/api-doc/uta/websocket/public/Candlesticks-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to unwatch the ohlcv for |
| timeframe | string | No | the period for the ratio, default is 1 minute |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.unWatchOHLCV (symbol, timeframe?, params?)watchOrderBook
watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of bitget
Returns: object - A dictionary of order book structures indexed by market symbols
See
- https://www.bitget.com/api-doc/spot/websocket/public/Depth-Channel
- https://www.bitget.com/api-doc/contract/websocket/public/Order-Book-Channel
- https://www.bitget.com/api-doc/uta/websocket/public/Order-Book-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the order book for |
| limit | int | No | the maximum amount of order book entries to return |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.watchOrderBook (symbol, limit?, params?)unWatchOrderBook
unsubscribe from the orderbook channel
Kind: instance method of bitget
Returns: object - A dictionary of order book structures indexed by market symbols
See
- https://www.bitget.com/api-doc/spot/websocket/public/Depth-Channel
- https://www.bitget.com/api-doc/contract/websocket/public/Order-Book-Channel
- https://www.bitget.com/api-doc/uta/websocket/public/Order-Book-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the order book for |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.limit | int | No | orderbook limit, default is undefined |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.unWatchOrderBook (symbol, params?)watchOrderBookForSymbols
watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of bitget
Returns: object - A dictionary of order book structures indexed by market symbols
See
- https://www.bitget.com/api-doc/spot/websocket/public/Depth-Channel
- https://www.bitget.com/api-doc/contract/websocket/public/Order-Book-Channel
- https://www.bitget.com/api-doc/uta/websocket/public/Order-Book-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | Yes | unified array of symbols |
| limit | int | No | the maximum amount of order book entries to return |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.watchOrderBookForSymbols (symbols, limit?, params?)watchTrades
get the list of most recent trades for a particular symbol
Kind: instance method of bitget
Returns: Array<object> - a list of trade structures
See
- https://www.bitget.com/api-doc/spot/websocket/public/Trades-Channel
- https://www.bitget.com/api-doc/contract/websocket/public/New-Trades-Channel
- https://www.bitget.com/api-doc/uta/websocket/public/New-Trades-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch trades for |
| since | int | No | timestamp in ms of the earliest trade to fetch |
| limit | int | No | the maximum amount of trades to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.watchTrades (symbol, since?, limit?, params?)watchTradesForSymbols
get the list of most recent trades for a particular symbol
Kind: instance method of bitget
Returns: Array<object> - a list of trade structures
See
- https://www.bitget.com/api-doc/spot/websocket/public/Trades-Channel
- https://www.bitget.com/api-doc/contract/websocket/public/New-Trades-Channel
- https://www.bitget.com/api-doc/uta/websocket/public/New-Trades-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | Yes | unified symbol of the market to fetch trades for |
| since | int | No | timestamp in ms of the earliest trade to fetch |
| limit | int | No | the maximum amount of trades to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.watchTradesForSymbols (symbols, since?, limit?, params?)unWatchTrades
unsubscribe from the trades channel
Kind: instance method of bitget
Returns: any - status of the unwatch request
See
- https://www.bitget.com/api-doc/spot/websocket/public/Trades-Channel
- https://www.bitget.com/api-doc/contract/websocket/public/New-Trades-Channel
- https://www.bitget.com/api-doc/uta/websocket/public/New-Trades-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to unwatch the trades for |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.unWatchTrades (symbol, params?)watchPositions
watch all open positions
Kind: instance method of bitget
Returns: Array<object> - a list of position structure
See
- https://www.bitget.com/api-doc/contract/websocket/private/Positions-Channel
- https://www.bitget.com/api-doc/uta/websocket/private/Positions-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string>, undefined | Yes | list of unified market symbols |
| since | int | No | the earliest time in ms to fetch positions for |
| limit | int | No | the maximum number of positions to retrieve |
| params | object | Yes | extra parameters specific to the exchange API endpoint |
| params.instType | string | No | one of 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES', default is 'USDT-FUTURES' |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.watchPositions (symbols, since?, limit?, params)watchOrders
watches information on multiple orders made by the user
Kind: instance method of bitget
Returns: Array<object> - a list of order structures
See
- https://www.bitget.com/api-doc/spot/websocket/private/Order-Channel
- https://www.bitget.com/api-doc/spot/websocket/private/Plan-Order-Channel
- https://www.bitget.com/api-doc/contract/websocket/private/Order-Channel
- https://www.bitget.com/api-doc/contract/websocket/private/Plan-Order-Channel
- https://www.bitget.com/api-doc/margin/cross/websocket/private/Cross-Orders
- https://www.bitget.com/api-doc/margin/isolated/websocket/private/Isolate-Orders
- https://www.bitget.com/api-doc/uta/websocket/private/Order-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market orders were made in |
| since | int | No | the earliest time in ms to fetch orders for |
| limit | int | No | the maximum number of order structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.trigger | boolean | No | contract only set to true for watching trigger orders |
| params.marginMode | string | No | 'isolated' or 'cross' for watching spot margin orders] |
| params.type | string | No | 'spot', 'swap' |
| params.subType | string | No | 'linear', 'inverse' |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.watchOrders (symbol, since?, limit?, params?)watchMyTrades
watches trades made by the user
Kind: instance method of bitget
Returns: Array<object> - a list of trade structures
See
- https://www.bitget.com/api-doc/contract/websocket/private/Fill-Channel
- https://www.bitget.com/api-doc/uta/websocket/private/Fill-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | str | Yes | unified market symbol |
| since | int | No | the earliest time in ms to fetch trades for |
| limit | int | No | the maximum number of trades structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.watchMyTrades (symbol, since?, limit?, params?)watchBalance
watch balance and get the amount of funds available for trading or funds locked in orders
Kind: instance method of bitget
Returns: object - a balance structure
See
- https://www.bitget.com/api-doc/spot/websocket/private/Account-Channel
- https://www.bitget.com/api-doc/contract/websocket/private/Account-Channel
- https://www.bitget.com/api-doc/margin/cross/websocket/private/Margin-Cross-Account-Assets
- https://www.bitget.com/api-doc/margin/isolated/websocket/private/Margin-isolated-account-assets
- https://www.bitget.com/api-doc/uta/websocket/private/Account-Channel
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.type | str | No | spot or contract if not provided this.options['defaultType'] is used |
| params.instType | string | No | one of 'SPOT', 'MARGIN', 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES' |
| params.marginMode | string | No | 'isolated' or 'cross' for watching spot margin balances |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
bitget.watchBalance (params?)