HTX is going to include “time” filter in existing historical order querying endpoint in REST API –-GET /v1/order/orders

Dear API users,

Currently, existing REST endpoint “GET /v1/order/orders” supports historical order querying based on user defined “start-date” & “end-date”.

Since the effective day of this notification, following new fields will be added into existing REST endpoint “GET /v1/order/orders” –
1) start-time
2) end-time

Upon user defined “start-time” AND/OR “end-time”, HTX server will revert back historical orders whose order creation time falling into the period. The maximum time span between “start-time” and “end-time” is 2-hour. Farthest order searchable should be within recent 180 days.

In case either “start-time” or “end-time” is defined, HTX server will ignore “start-date” and “end-date” regardless they were filled or not.

If user does neither define “start-time” nor “end-time”, but “start-date”/”end-date”, the order searching will be based on defined “date range”, as usual.

If user does not define either of “start-time”/”end-time”/”start-date”/”end-date”, by default HTX server will treat current time as “end-time”, and then revert back historical orders within recent 48 hours.

HTX suggests API users to search historical orders based on “time” filter instead of “date”. In the near future, HTX would remove “start-date”/”end-date” fields from the endpoint, through another notification.

Effective Date: February 6, 2020 (GMT+8)
All the changes will be updated on https://huobiapi.github.io/docs/spot/v1/en/

HTX
February 7, 2020

The following are change details:

REST API – Search Past Orders

GET /v1/order/orders (API Key Permission: Read)

 Request Parameters

Parameter Data Type Required Default Description Value Range
symbol string true NA The trading symbol All supported trading symbols, e.g. btcusdt, bccbtc
types string false NA One or more types of order to include in the search, use comma to separate. buy-market, sell-market, buy-limit, sell-limit, buy-ioc, sell-ioc, buy-stop-limit, sell-stop-limit
start-time string false -48h Search starts time, UTC time in millisecond Value range [((end-time) – 48h), (end-time)], maximum query window size is 48 hours, query window shift should be within past 180 days, query window shift should be within past 24 hours for cancelled order (state = "canceled")
end-time string false present Search ends time, UTC time in millisecond Value range [(present-179d), present], maximum query window size is 48 hours, query window shift should be within past 180 days, queriable range should be within past 24 hours for cancelled order (state = "canceled")
start-date string false -1d Search starts date, in format yyyy-mm-dd Value range [((end-date) – 1), (end-date)], maximum query window size is 2 days, query window shift should be within past 180 days, query window shift should be within past 1 day for cancelled order (state = "canceled")
end-date string false today Search ends date, in format yyyy-mm-dd Value range [(today-179), today], maximum query window size is 2 days, query window shift should be within past 180 days, queriable range should be within past 1 day for cancelled order (state = "canceled")
states string true NA One or more states of order to include in the search, use comma to separate. submitted, partial-filled, partial-canceled, filled, canceled, created
from string false NA Search order id to begin with NA
direct string false both Search direction when 'from' is used next, prev
size int false 100 The number of orders to return [1, 100]

Response Content

Field Data Type Description
id integer Order id
account-id integer Account id
user-id integer User id
amount string The amount of base currency in this order
symbol string The trading symbol to trade, e.g. btcusdt, bccbtc
price string The limit price of limit order
created-at int The timestamp in milliseconds when the order was created
canceled-at int The timestamp in milliseconds when the order was canceled, or 0 if not canceled
finished-at int The timestamp in milliseconds when the order was finished, or 0 if not finished
type string The order type, possible values are: buy-market, sell-market, buy-limit, sell-limit, buy-ioc, sell-ioc, buy-limit-maker, sell-limit-maker, buy-stop-limit, sell-stop-limit
filled-amount string The amount which has been filled
filled-cash-amount string The filled total in quote currency
filled-fees string Transaction fee paid so far
source string The source where the order was triggered, possible values: sys, web, api, app
state string created, submitted, partial-filled, filled, canceled, partial-canceled
exchange string Internal data
batch string Internal data
stop-price string trigger price of stop limit order
operator string operation character of stop price