Skip to main content

Get Closed Options Positions

Query user's closed options positions, sorted by closeTime in descend order

info
  • Only supports users to query closed options positions in recently 6 months
  • Fee and price retain 8 decimal places and do not omit the last 0

HTTP Request

GET v5/position/get-closed-positions

Request Parameters

ParameterRequiredTypeComments
categorytruestringoption
symbolfalsestringSymbol name
startTimefalseintegerThe start timestamp (ms)
  • startTime and endTime are not passed, return 1 days by default
  • Only startTime is passed, return range between startTime and startTime+1 days
  • Only endTime is passed, return range between endTime-1 days and endTime
  • If both are passed, the rule is endTime - startTime <= 7 days
endTimefalseintegerThe end timestamp (ms)
limitfalseintegerLimit for data size per page. [1, 100]. Default: 50
cursorfalsestringCursor. Use the nextPageCursor token from the response to retrieve the next page of the result set

Response Parameters

ParameterTypeComments
nextPageCursorstringRefer to the cursor request parameter
categorystringProduct type
listarrayObject
> symbolstringSymbol name
> sidestringBuy, Sell
> totalOpenFeestringTotal Open Fee
> deliveryFeestringDelivery fee
> totalCloseFeestringTotal close fee
> qtystringOrder qty
> closeTimeintegerThe closed time (ms)
> avgExitPricestringAverage exit price
> deliveryPricestringDelivery price
> openTimeintegerThe opened time (ms)
> avgEntryPricestringAverage entry price
> totalPnlstringTotal PnL

Request Example

GET v5/position/get-closed-positions?category=option&limit=1 HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: xxxxxxxxxxxxxxxxxx
X-BAPI-TIMESTAMP: 1672284128523
X-BAPI-RECV-WINDOW: 5000

Response Example

{
"retCode": 0,
"retMsg": "Success",
"result": {
"nextPageCursor": "1749726002161%3A0%2C1749715220240%3A1",
"category": "option",
"list": [
{
"symbol": "BTC-12JUN25-104019-C-USDT",
"side": "Sell",
"totalOpenFee": "0.94506647",
"deliveryFee": "0.32184533",
"totalCloseFee": "0.00000000",
"qty": "0.02",
"closeTime": 1749726002161,
"avgExitPrice": "107281.77405000",
"deliveryPrice": "107281.77405031",
"openTime": 1749722990063,
"avgEntryPrice": "3371.50000000",
"totalPnl": "0.90760719"
},
{
"symbol": "BTC-12JUN25-104000-C-USDT",
"side": "Buy",
"totalOpenFee": "0.86379999",
"deliveryFee": "0.32287622",
"totalCloseFee": "0.00000000",
"qty": "0.02",
"closeTime": 1749715220240,
"avgExitPrice": "107625.40470150",
"deliveryPrice": "107625.40470159",
"openTime": 1749710568608,
"avgEntryPrice": "3946.50000000",
"totalPnl": "-7.60858218"
}
]
},
"retExtInfo": {

},
"time": 1749736532193
}