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
- 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
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| currencyPair | True | String | Instrument, e.g., BTC_USDT |
| startAt | False | Long | Start time (timestamp) |
| endAt | False | Long | End time (timestamp) |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| orderNumber | String | Order ID |
| date | String | Transaction time (timestamp) |
| startingAmount | String | Order size in quote currency |
| total | String | Order size in base currency |
| type | String | Trade direction: buy/sell |
| prize | String | Order price set by user |
| success_count | String | Executed order size in base currency |
| success_amount | String | Executed order size in quote currency |
| status | String | Status: 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}