History Orders
GET/api/v1.0/sim-trade/{acc_id}/history-ordersGet historical orders (supports time range + pagination).
Parameters
| Parameter | Type | Location | Required | Description |
|---|---|---|---|---|
acc_id | string | path | Yes | Business account ID |
market | int | query | Yes | Market (from market_id in the account list) |
time_begin | int64 | query | No | Start time (Unix microseconds) |
time_end | int64 | query | No | End time (Unix microseconds) |
page_size | int | query | No | Page size (default 50) |
next_key | string | query | No | Pagination cursor |
Request Example
bash
curl -s "https://webapi.moomoo.com/api/v1.0/sim-trade/80303779/history-orders?market=1&page_size=10" -H "Authorization: Bearer <AccessToken>" | jqResponse Fields
Order fields are the same as Today's Orders, with additional pagination info: pagination.has_more (bool), pagination.next_key (string).
Response Example
json
{
"ret_code": 0,
"ret_msg": "success",
"data": {
"orders": []
},
"pagination": {
"has_more": false,
"next_key": ""
}
}Error response
HTTP status remains 200. A failed request returns ret_code != 0 and an error object.
json
{
"ret_code": -3,
"ret_msg": "invalid request",
"error": {"code": "invalid_parameter", "message": "invalid request"}
}