Bitget APIBitget API
UTAClassic
Legacy Doc
  • Overview
  • API Documentation
  • WebSocket
  • Agent Hub
  • SDK
  • Changelog
Copied to clipboard
Trading
    Order Management
      Place OrderpostModify OrderpostCancel OrderpostBatch OrderpostBatch Modify OrderspostBatch CancelpostCancel All OrderspostGet Order DetailsgetGet Open OrdersgetGet Order HistorygetGet Fill HistorygetCountDown Cancel AllpostPlace Reality OrderpostCancel Reality Orderpost
    Position Management
      Close All PositionspostMove PositionspostGet Move Position HistorygetGet Position InfogetGet Positions HistorygetGet Max Open AvailablepostGet Position ADL RankgetGet Loan Dataget
    Strategy Trading
      Place Strategy OrderpostModify Strategy OrderpostCancel Strategy OrderpostUnfilled Strategy OrdersgetHistory Strategy OrdersgetGet Strategy Sub-ordersget
    Grid Trading
      Add Investment AmountpostGet Grid Bot DetailgetClose Grid BotpostCreate Grid BotpostCreate Neutral Grid BotpostGet Grid Bot Order DetailsgetModify Grid Bot ParameterspostModify Grid Interval and Grid NumberpostModify Neutral Grid Bot ParameterspostModify Neutral Grid Interval and Grid NumberpostGet Neutral Grid Bot DetailgetGet Neutral Grid Bot Order DetailsgetValidate Neutral Grid ParameterspostValidate Grid Parameterspost
Trading
Trading

Position Management

Position Management


Close All Positions

POST
https://api.bitget.com
/api/v3/trade/close-positions

Rate limit: 5/sec/UID

Close positions by position side or category. All positions will be closed at market price, subject to slippage.

API Broker rebate identifier:

The following code block needs to be added to the HTTP Header of the request.

"X-CHANNEL-API-CODE":"your-channel-api-code"

  • Rate limit: 5/sec/UID
  • Permission: UTA trade (read & write)

Close All Positions › Request Parameters

category
​string · required

Product type USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures

symbol
​string

Symbol name e.g.,BTCUSDT If no symbol is provided, all positions in the corresponding category will be closed.

posSide
​string

Position side long/short
If this field is provided, only the position in the corresponding side will be closed.

Close All Positions › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object
list
​string[]

List

>orderId
​string

Order ID

>clientOid
​string

Client order ID

>msg
​string

Message

>code
​string

Code

POST/api/v3/trade/close-positions
curl https://api.bitget.com/api/v3/trade/close-positions \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "category": "category", "symbol": "symbol", "posSide": "posSide" }'
Example Request Body
{ "category": "category", "symbol": "symbol", "posSide": "posSide" }
json
Example Responses
{ "code": "00000", "data": { "list": [ { "orderId": "111111111111111111", "clientOid": "111111111111111111", "code": "24056", "msg": "notExisted" } ] }, "msg": "success", "requestTime": 1627293504612 }
json
application/json

Move Positions

POST
https://api.bitget.com
/api/v3/account/move-positions

Rate limit: 1/sec/UID

Supports position moves between master and sub-accounts, as well as between sub-accounts:

  1. Master account → Sub-account
  2. Sub-account → Master account
  3. Sub-account → Sub-account (must belong to the same master account)

This feature is only available to whitelisted users and can only be called using the master account's API Key. The fromUid and toUid must belong to the same master-sub account system. Currently only supports USDT futures and USDC futures. Only cross-margin mode is supported. The trades generated by position moves will not appear in the public market trades and no trading fees will be charged. Position moves are not supported within 5 minutes before or after each hour (funding fee settlement period). Position moves are not supported when the source account's MMR ≥ 80%. Before the position move, the system will cancel all pending orders for the corresponding symbol in both the source and target accounts. The move price defaults to and only supports the mark price. Users can trigger up to 100 position move requests per day per UID (counting from a successful call). Each request must be at least 30 seconds apart. A maximum of 10 positions can be moved per request. After the position move, the position mode and leverage are based on the target account's original settings.

  • Rate limit: 1/sec/UID
  • Business limit: 100 times/day/UID, minimum interval 30 seconds between requests
  • Permission: UTA trade (read & write)

Move Positions › Request Parameters

fromUid
​string · required

Source account UID The account from which positions are transferred fromUid and toUid must belong to the same master-sub account system

toUid
​string · required

Target account UID The account to which positions are transferred fromUid and toUid must belong to the same master-sub account system

category
​string · required

Product type USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures

positionList
​string[] · required

Position list Maximum of 10 positions per request

>symbol
​string · required

Symbol name e.g., BTCUSDT

>side
​string · required

Order side (from the source account's perspective) buy/sell The logic is consistent for both one-way mode and hedge mode. When the source holds a long position, pass side=sell to reduce the position. When the source holds a short position, pass side=buy to reduce the position.

>qty
​string · required

Transfer quantity Must meet the minimum quantity precision requirement

Move Positions › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object
closePosition
​string[]

Source account position result list

>orderId
​string

Target order ID

>clientOid
​string

Target client order ID

>code
​string

Error code Returned when an error occurs during the open position operation

>msg
​string

Error message Returned when an error occurs during the open position operation

openPosition
​string[]

Target account position result list

POST/api/v3/account/move-positions
curl https://api.bitget.com/api/v3/account/move-positions \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "fromUid": "fromUid", "toUid": "toUid", "category": "category", "positionList": [ "string" ], ">symbol": ">symbol", ">side": ">side", ">qty": ">qty" }'
Example Request Body
{ "fromUid": "fromUid", "toUid": "toUid", "category": "category", "positionList": [ "string" ], ">symbol": ">symbol", ">side": ">side", ">qty": ">qty" }
json
Example Responses
{ "code": "00000", "msg": "success", "requestTime": 1695806875837, "data": { "closePosition": [ { "orderId": "121211212122", "clientOid": "131311313133", "code": "", "msg": "" } ], "openPosition": [ { "orderId": "121211212123", "clientOid": "131311313134", "code": "", "msg": "" } ] } }
json
application/json

Get Move Position History

GET
https://api.bitget.com
/api/v3/account/move-position-history

Rate limit: 5/sec/UID

Query the history of position moves. Only callable by the master account. You can query the move position history for a specified source account (master account or sub-account).

Query Range Constraint If endTime is not provided, the default query range is the last 30 days. The maximum supported time span is 90 days.

  • Rate limit: 5/sec/UID
  • Permission: UTA trade (read)

Get Move Position History › Request Parameters

category
​string · required

Product type USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures

symbol
​string

Symbol name e.g., BTCUSDT

startTime
​string

Start timestamp A Unix timestamp in milliseconds e.g., 1597026383085

endTime
​string

End timestamp A Unix timestamp in milliseconds e.g., 1597026383185 If not provided, defaults to querying the last 30 days. Maximum supported time span is 90 days

cursor
​string

Cursor Pagination is implemented by omitting the cursor in the first query and applying the cursor from the previous query for subsequent pages

limit
​string

Limit per page Default: 100. Maximum: 100

Get Move Position History › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object
list
​string[]

Move position history list

>category
​string

Product type USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures

>fromUid
​string

Source account UID

>toUid
​string

Target account UID

>orderId
​string

Order ID

>openExecId
​string

Open Position Execution ID

>closeExecId
​string

Close Position Execution ID

>symbol
​string

Symbol name e.g., BTCUSDT

>posSide
​string

Position side long Long position short Short position

>qty
​string

Transfer quantity

>price
​string

Transfer price

>status
​string

Transfer status processing In progress completed Completed failed Failed

>createdTime
​string

Created timestamp A Unix millisecond timestamp

>updatedTime
​string

Updated timestamp A Unix millisecond timestamp

cursor
​string

Cursor

GET/api/v3/account/move-position-history
curl 'https://api.bitget.com/api/v3/account/move-position-history?category=<string>'
Example Responses
{ "code": "00000", "msg": "success", "requestTime": 1730186348272, "data": { "list": [ { "category": "USDT-FUTURES", "fromUid": "111111111", "toUid": "222222222", "orderId": "121211212122", "openExecId": "343434343434", "closeExecId": "343434343435", "symbol": "BTCUSDT", "posSide": "long", "qty": "0.5", "price": "61000", "status": "completed", "createdTime": "1730181468493", "updatedTime": "1730181468593" } ], "cursor": "1233319323918499840" } }
json
application/json

Get Position Info

GET
https://api.bitget.com
/api/v3/position/current-position

Rate limit: 20/sec/UID

Query real-time position data by symbol, side, or category.

  • Rate limit: 20/sec/UID
  • Permission: UTA trade (read)

Get Position Info › Request Parameters

category
​string · required

Product type USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures

symbol
​string

Symbol name e.g.BTCUSDT If no symbol is provided, all positions in the corresponding category will be returned.

posSide
​string

Position side long/short If this field is provided, only the position in the corresponding side will be returned.

Get Position Info › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object
list
​string[]

Position list

>category
​string

Product Type USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures

>symbol
​string

Symbol name

>marginCoin
​string

Margin coin

>posSide
​string

Position side long/short

>positionBalance
​string

Position balance (margin amount) The unit is margin coin In isolated margin mode, reflects the isolated margin amount for this position

>available
​string

Available position

>frozen
​string

Frozen position

>total
​string

Total position (available + frozen)

>leverage
​string

Leverage multiple

>curRealisedPnl
​string

Current realised profit and loss

>avgPrice
​string

Average entry price

>marginMode
​string

Margin mode crossed crossed margin isolated isolated margin

>positionStatus
​string

Position status normal

>holdMode
​string

Holding mode one_way_mode/hedge_mode

>unrealisedPnl
​string

Unrealised profit and loss In isolated margin mode, reflects the unrealised PnL for this isolated position

>liquidationPrice
​string

Estimated liquidation price Less than or equal to 0 means liquidation will not occur

>mmr
​string

Maintenance margin rate

>profitRate
​string

Profit rate

>markPrice
​string

Mark price

>breakEvenPrice
​string

Break-even price

>totalFunding
​string

Total funding The accumulated fund fee during the position's duration. If the value is zero, it indicates no fees have been charged

>openFeeTotal
​string

Fees deducted on position opening Opening fees deducted during the position's lifetime

>closeFeeTotal
​string

Fees deducted on position closing Closing fees deducted during the position's lifetime

>cashDividend
​string

Cash dividend The unit is USDT

>createdTime
​string

Created timestamp A Unix millisecond timestamp

>updatedTime
​string

Updated timestamp A Unix millisecond timestamp

GET/api/v3/position/current-position
curl 'https://api.bitget.com/api/v3/position/current-position?category=<string>'
Example Responses
{ "code": "00000", "msg": "success", "requestTime": 1753103840140, "data": { "list": [ { "category": "USDT-FUTURES", "symbol": "BTCUSDT", "marginCoin": "USDT", "holdMode": "hedge_mode", "posSide": "long", "marginMode": "crossed", "positionBalance": "4701531.84941582", "available": "119.2068", "frozen": "0", "total": "119.2068", "leverage": "3", "curRealisedPnl": "0", "avgPrice": "108674", "positionStatus": "normal", "unrealisedPnl": "1124573.04243999", "liquidationPrice": "43099.9", "mmr": "0.015", "profitRate": "0.2391929010498401", "markPrice": "118097", "breakEvenPrice": "109208.6", "totalFunding": "-53076.32433032", "openFeeTotal": "-2842.86603479", "closeFeeTotal": "0", "cashDividend": "0", "createdTime": "1736378720620", "updatedTime": "1753102803148" } ] } }
json
application/json

Get Positions History

GET
https://api.bitget.com
/api/v3/position/history-position

Rate limit: 20/sec/UID

Query historical positions within the last 90 days.

  • Rate limit: 20/sec/UID
  • Permission: UTA trade (read & write)

Get Positions History › Request Parameters

category
​string · required

Product type USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures

symbol
​string

Symbol name e.g.,BTCUSDT

startTime
​string

Start timestamp A Unix timestamp in milliseconds e.g.,1597026383085 The access window is 90 days

endTime
​string

End timestamp A Unix timestamp in milliseconds e.g.,1597026383185 The time range between startTime and endTime must not exceed 30 days

limit
​string

Limit per page Default:100. Maximum:100

cursor
​string

Cursor Pagination is implemented by omitting the cursor in the first query and applying the cursor from the previous query for subsequent pages

Get Positions History › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object
list
​string[]

List

>positionId
​string

Position ID

>category
​string

Product Type USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures

>symbol
​string

Symbol name

>marginCoin
​string

Margin coin

>posSide
​string

Position side long/short

>openPriceAvg
​string

Average opening price

>closePriceAvg
​string

Average closing price

>openTotalPos
​string

Total open position

>closeTotalPos
​string

Total closed position

>marginMode
​string

Margin mode crossed/isolated

>holdMode
​string

Holding mode one_way_mode /hedge_mode

>cumRealisedPnl
​string

Cumulative realised profit and loss Excluding fees and funding costs

>netProfit
​string

Net profit and loss Including fees and funding costs

>totalFunding
​string

Total funding The accumulated fund fee during the position's duration. If the value is zero, it indicates no fees have been charged

>openFeeTotal
​string

Fees deducted on position opening Opening fees deducted during the position's lifetime

>closeFeeTotal
​string

Fees deducted on position closing Closing fees deducted during the position's lifetime

>cashDividend
​string

Cash dividend The unit is USDT

>createdTime
​string

Position created timestamp A Unix millisecond timestamp

>updatedTime
​string

Position updated timestamp A Unix millisecond timestamp

cursor
​string

Cursor

GET/api/v3/position/history-position
curl 'https://api.bitget.com/api/v3/position/history-position?category=<string>'
Example Responses
{ "code": "00000", "msg": "success", "requestTime": 1730186957802, "data": { "list": [ { "positionId": "1111111111111111111", "category": "USDT-FUTURES", "symbol": "EOSUSDT", "marginCoin": "USDT", "holdMode": "one_way_mode", "posSide": "long", "marginMode": "crossed", "openPriceAvg": "1960.001", "closePriceAvg": "1959.999", "openTotalPos": "58", "closeTotalPos": "58", "cumRealisedPnl": "-0.116", "netProfit": "-45.588", "totalFunding": "0", "openFeeTotal": "-22.7360116", "closeFeeTotal": "-22.7359884", "cashDividend": "0", "createdTime": "1729928018076", "updatedTime": "1729929656321" } ], "cursor": "1111111111111111111" } }
json
application/json

Get Max Open Available

POST
https://api.bitget.com
/api/v3/account/max-open-available

Rate limit: 5/sec/UID

Get max open available

  • Rate limit: 5/sec/UID
  • Permission: UTA trade (read)

Get Max Open Available › Request Parameters

category
​string · required

Product type SPOT Spot trading MARGIN Margin trading USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures

symbol
​string · required

Symbol name e.g.,BTCUSDT

orderType
​string · required

Order type limit/market

side
​string · required

Transaction direction buy/sell

price
​string

Order price This field is required when orderType is limit

size
​string

Order quantity, base coin

autoBorrow
​string

Auto borrow switch
yes Enable
no Disable (default)
Only applicable to spot orders. When enabled, if the obtained coin does not support borrowing while the consumed coin does, and the available balance of the consumed coin is insufficient, the system automatically borrows the consumed coin to make up the shortfall.

Get Max Open Available › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object
available
​string

Available For spot/margin When side=buy, it represents the number of quote coins; when side=sell, it represents the number of base coins. The futures represents the quantity of the quote coins

maxOpen
​string

Maximum openable size When side=buy, it represents the number of quote coins; when side=sell, it represents the number of base coins. Has a value for margin, and for spot when auto borrow (autoBorrow) is enabled.

buyOpenCost
​string

When buying, the quantity of the quote coin required to open a position is calculated based on the input size. Only the futures has a value.

sellOpenCost
​string

When selling, the quantity of the quote coin required to open a position is calculated based on the input size. Only the futures has a value.

maxBuyOpen
​string

The maximum position that can be opened for purchase. Base coin quantity calculated based on account balance. Only the futures has a value.

maxSellOpen
​string

The maximum position that can be opened for sale. Base coin quantity calculated based on account balance. Only the futures has a value.

maxBuyAvailable
​string

Maximum buy available

maxSellAvailable
​string

Maximum sell available

POST/api/v3/account/max-open-available
curl https://api.bitget.com/api/v3/account/max-open-available \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "category": "category", "symbol": "symbol", "orderType": "orderType", "side": "side", "price": "price", "size": "size", "autoBorrow": "autoBorrow" }'
Example Request Body
{ "category": "category", "symbol": "symbol", "orderType": "orderType", "side": "side", "price": "price", "size": "size", "autoBorrow": "autoBorrow" }
json
Example Responses
{ "code": "00000", "msg": "success", "requestTime": 1741851607871, "data": { "available": "52.008255", "maxOpen": "", "buyOpenCost": "", "sellOpenCost": "", "maxBuyOpen": "", "maxSellOpen": "", "maxBuyAvailable": "", "maxSellAvailable": "" } }
json
application/json

Get Position ADL Rank

GET
https://api.bitget.com
/api/v3/position/adlRank

Rate limit: 1/sec/UID

Get Position ADL Rank

  • Rate limit: 1/sec/UID
  • Permission: UTA trade (read & write)

Get Position ADL Rank › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object
symbol
​string

Symbol

marginCoin
​string

Margin Coin

adlRank
​string

ADL Ranking The ranking of your current position in the auto-deleveraging sequence. When an auto-deleveraging event occurs in the market, the closer the value is to 1, the higher the probability that your position will be reduced

holdSide
​string

Position Direction long long position short short position

GET/api/v3/position/adlRank
curl https://api.bitget.com/api/v3/position/adlRank
Example Responses
{ "code": "00000", "msg": "success", "requestTime": 1754035547922, "data": [ { "symbol": "MOVEUSDT", "marginCoin": "USDT", "adlRank": "0.4872", "holdSide": "long" } ] }
json
application/json

Get Loan Data

GET
https://api.bitget.com
/api/v3/trade/loan-data

Rate limit: 10/sec/UID

Query the current loan data for the unified trading account, including total borrowed amount, next interest payment time, and debt details by coin.

  • Rate limit: 10/sec/UID
  • Permission: UTA trade (read)

Get Loan Data › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object
currentLoans
​string

Total current borrowed amount (USD)

interestPaymentTime
​string

Next interest deduction time A Unix timestamp in milliseconds

​object[]

Debt coin list

GET/api/v3/trade/loan-data
curl https://api.bitget.com/api/v3/trade/loan-data
Example Responses
{ "code": "00000", "msg": "success", "requestTime": 1751972326323, "data": { "currentLoans": "1000.5", "interestPaymentTime": "1751976000000", "debtCoinList": [ { "coin": "USDT", "debt": "1000.5", "interestFreeAmount": "200", "interestRateNextHour": "0.0001" } ] } }
json
application/json

Order ManagementStrategy Trading