Skip to main content

Get Current Orders

API Description

This interface allow users to get all the current unfilled spot orders for a specified instrument, providing details such as order ID, transaction time, amount, and status.

Note: Open Orders data is accessible via both RESTful and Websocket APIs. This page describes the RESTful API. For information on the websocket API, please click here

Precautions

  1. This interface only supports querying the current unfilled orders for a specified instrument. It does not support querying unfilled orders across all instruments.

Authentication

This is a private interface and requires authentication. For details on using the RESTful API, refer to Introduction > Authentication & Code Snippet > Spot > RESTful Private Interface.

Request Method

POST

Endpoint

/api/v1/private?command=returnOpenOrders

Frequency Limit

The frequency limit for this interface is 30 requests/2s per user ID. In addition to this per-interface limit, a global rate limit is also enforced.

For detailed information on Global rate limits and API Rate Limiting Policy, please refer to the "Frequency Limit" section at click here

Request Parameters

ParameterMandatoryTypeDescription
currencyPairTrueStringInstrument, e.g., BTC_USDT
startAtFalseLongStart time (timestamp)
endAtFalseLongEnd time (timestamp)

Response parameters

ParameterTypeDescription
orderNumberStringOrder ID
dateStringTransaction time (timestamp)
startingAmountStringOrder size in quote currency
totalStringOrder size in base currency
typeStringTrade direction: buy/sell
prizeStringOrder price set by user
success_countStringExecuted order size in base currency
success_amountStringExecuted order size in quote currency
statusStringStatus: 1: uncompleted, 2: partially completed,3: completely completed, 4: user canceled

Request Example

The following Python code shows how to get the current open orders for BTC-USDT.

Note: For a complete code example, please refer to Introduction > Authentication & Code Snippet > Spot > RESTful Private Interface.

api_url = "/api/v1/private?command=returnOpenOrders"
method = "post"
params = {
"currencyPair": "BTC_USDT",
"startAt": "1741671490745",
"endAt": "1741844290745"
}
SpotRestfulPrivate(host, api_url, method, api_key, params, secret_key) # function SpotRestfulPrivate() is defined in section (Introduction > Authentication & Code Snippet > Spot > RESTful Private Interface)

Note: For a complete Java code example, please refer to Introduction > Authentication & Code Snippet > Spot > RESTful Private Interface.

Response Example

The following is an example response returned by the above Python request:

{'code': '200',
'data': [{'orderNumber': 4624541508540145096,
'date': 1743669325942,
'startingAmount': '8.20',
'total': '0.0001',
'type': 'buy',
'prize': '82000.00',
'success_count': '0.0000',
'success_amount': '0.00',
'status': 1},
{'orderNumber': 4624586588413897537,
'date': 1743669298855,
'startingAmount': '8.20',
'total': '0.0001',
'type': 'buy',
'prize': '82000.00',
'success_count': '0.0000',
'success_amount': '0.00',
'status': 1}],
'msg': 'SUCCESS',
'success': True,
'failed': False}