Input parameter otptoken changed from required to non required.
2022.06.17
POST /v1/dw/withdraw/api/create
update
Please check whether the handling fee is too high through the handling fee interface before withdrawal to avoid losses, and cancel the operation through the "Cancel the Withdrawal" interface before successful withdrawal.
2022.06.14
POST /v2/sub-user/api-key-generation, POST /v2/sub-user/api-key-modification
Update
An API key not linked with an IP address but has trading or withdrawal permissions will be automatically deactivated after 90 days of inactivity.
2022.03.02
GET v1/common/symbols, GET /v1/settings/common/market-symbols
POST /v1/order/batch-orders, POST /v1/order/orders/place
update
Add Request Parameters "self-match-prevent"
2021.11.30
GET /v1/query/withdraw/client-order-id
Add
Add "Query withdrawal order by client order id"
2021.11.30
POST /v1/dw/withdraw/api/create
update
Add Request Parameters "client-order-id"
2021.8.19
accounts.update#${mode}
Update
Add "Serial Number of Account Change" parameter:"seqNum"
2021.8.19
GET /v1/account/accounts/{account-id}/balance
Update
Add "Serial Number of Account Change" parameter:"seq-num"
2021.8.12
market.$symbol.ticker
Add
Add Market Ticker data
2021.8.12
market.$symbol.mbp.$levels
Update
Add 400 depth data
2021.7.23
GET /v1/account/history
Update
Detailed in detail the type of change in the account flow interface, that is, "Transact-Types" increases classification, such as Note 3.
2021.6.12
GET/v2/account/valuation
Add
Get The Total Valuation of Platform Assets
2021.5.26
GET /v1/order/orders/getClientOrder POST /v1/order/orders/place POST/v1/order/orders/submitCancelClientOrder
Update
For completed orders, clientOrderId will be valid for 2 hours since the order creation (it is still valid for 8 hours concerning other orders). The uniqueness of the clientOrderId passed in when you place an order will no longer be verified.
2021.5.12
GET /v2/etp/transactions
Update
"etpNames" and "transactTypes" are changed to "required" and "Only supports filling in one value"
2021.3.1
POST /v2/sub-user/deduct-mode
Add
Set a deduction for master and sub user
2021.3.1
GET /v2/sub-user/account-list
Update
Add deduct mode parameters
2021.2.28
Account and Order WebSocket v1
Delete
Account and WebSocket v1 was offline
2021.2.1
POST /v2/account/repayment
Update
Support isolated repayment
2021.1.22 19:00
GET /v1/order/matchresults
Add
Add timestamp parameters
2021.1.19 19:00
GET /v2/etp/limit
Add
Add "Get Holding Limit of Leveraged ETP" endpoints
2020.1.8 19:00
POST/v2/algo-orders/cancel-all-after
Add
Add Dead man’s switch endpoints
2020.1.5 19:00
accounts.update#${mode}
Update
added Specify "mode" as 2: accounts.update#2 Whenever account balance or available balance changed, it will be updated together.
2020.12.16 19:00
GET /v1/order/matchresults and GET /v1/order/orders/{order-id}/matchresults
Update
Add "fee-deduct-state" parameter to indicate the status of "In deduction" and "deduction completed"
2020.12.14 19:00
POST /v2/etp/{transactId}/cancel andPOST /v2/etp/batch-cancel
Add
Add "Submit Cancel for ETP Multiple Orders" and"Submit Cancel for an ETP Order" endpoints
2020.11.26 19:00
GET /v2/user/uid
Add
Add Get UID endpoints
2020.10.16 19:00
orders#${symbol}
Add
Add accountId for order creation event
2020.10.10 19:00
POST /v2/account/repayment, GET /v2/account/repayment
Add
Added general repayment and query
2020.8.28 19:00
GET /v1/common/symbols
Update
Added API trading eligibility flag
2020.8.4 19:00
accounts.update#${mode}, accounts
Update
Added new event type deposit and withdraw
2020.8.11 19:00
GET /v1/common/symbols, GET /market/etp, market.$symbol.etp, GET /market/history/kline, market.$symbol$.kline.$period$, GET /v2/etp/reference, POST /v2/etp/creation, POST /v2/etp/redemption, GET /v2/etp/transactions, GET /v2/etp/transaction, GET /v2/etp/rebalance
Add & Update
Added/updated relevant channels/endpoints to support ETP
2020.8.10 19:00
GET v1/stable-coin/quote, POST v1/stable-coin/exchange
Update
Added new response field for exchange fee
2020.8.4 19:00
GET /v1/account/history
Update
Added new response field "next-id"
2020.8.3 19:00
POST /v2/algo-orders, GET /v2/algo-orders/opening, GET /v2/algo-orders/history, GET /v2/algo-orders/specific
Update
Added trailing stop order
2020.7.24 19:00
trade.clearing#${symbol}#${mode}
Update
Added order cancellation event
2020.7.17 19:00
GET /v2/account/asset-valuation
Add
Add new endpoint for getting asset valuation
2020.7.16 19:00
GET /v1/common/symbols
Update
Add six response fields
2020.7.10 19:00
GET /v2/point/account, POST /v2/point/transfer
Add
Added point balance querying endpoint and point transfer endpoint
2020.7.10 19:00
POST /v1/order/batch-orders
Update
Adjusted rate limit value
2020.7.8 19:00
orders#{symbol}
Update
Added two new event types
2020.6.27 19:00
GET /v2/market-status
Add
Added new endpoint for market status querying
2020.6.27 19:00
market.$symbol.mbp.$levels
Update
Added 5-level incremental update in tick by tick mode
2020.6.27 19:00
Added some new endpoints
Add
Added new endpoint for conditional order
2020.6.24 19:00
GET /v1/order/orders/{order-id}/matchresults & GET /v1/order/matchresults
Update
Added response field 'fee-currency'
2020.6.24 19:00
GET /v2/account/withdraw/address
Add
Query withdraw address
2020.6.23 19:00
Added some new endpoints
Add
Added new endpoint for C2C lending and borrowing
2020.6.16 10:00
GET /v2/sub-user/user-list, GET /v2/sub-user/user-state, GET /v2/sub-user/account-list
Add
Added new endpoints for querying sub user's list, sub user's status, sub user's accounts
2020.6.15 19:00
POST /v2/sub-user/api-key-generation, POST /v2/sub-user/api-key-modification
Update
Expand the limit of API key creation per user; Expand the limit of IP binding to each API key.
2020.6.11 19:00
POST /v1/account/transfer
Update
Add transfer asset between spot account and individual isolated-margin account; Add transfer asset between individual isolated-margin accounts.
2020.6.11 19:00
GET /v1/query/deposit-withdraw
Update
Return the reasons of the withdrawal failure
2020.6.5 19:00
POST /v2/sub-user/api-key-generation, GET /v2/user/api-key, POST /v2/sub-user/api-key-modification, POST /v2/sub-user/api-key-deletion
Add
API Key management of parent user and sub users
2020.6.4 19:00
Some of private REST endpoints
Update
Adjusted rate limit value
2020.6.1 19:00
orders#${symbol}
Update
support creation event for taker's order
2020.6.1 19:00
GET /v2/reference/transact-fee-rate, GET /v1/order/orders/{order-id}/matchresults, GET /v1/order/matchresults, trade.clearing#${symbol}, GET /v1/account/history, accounts, accounts.update#${mode}
Update
Support transaction rebate
2020.5.29 19:00
POST /v2/sub-user/tradable-market
Add
Parent user to set sub user's trading permission
2020.5.29 19:00
POST /v2/sub-user/transferability
Add
Parent user to set sub user's asset transfer permission
GET /v2/account/deposit/address, GET /v2/sub-user/deposit-address, GET /v1/query/deposit-withdraw, GET /v2/sub-user/query-deposit
Add
Allow sub user to deposit
2020.4.3 11:00
orders#${symbol}
Add
Added order update topic v2
2020.3.31 21:00
accounts.update#${mode}
Update
Disseminate current static values of individual accounts first just after subscription
2020.3.31 11:00
GET /v2/account/ledger
Add
Added account ledger query endpoint
2020.3.30 19:00
market.$symbol.mbp.refresh.$levels
Add
Added MBP refresh update topic
2020.3.30 19:00
POST /v1/order/orders/place, POST /v1/order/batch-orders, GET /v1/order/openOrders, GET /v1/order/orders/{order-id}, GET /v1/order/orders/getClientOrder, GET /v1/order/orders/{order-id}/matchresults, GET /v1/order/orders, GET /v1/order/history, GET /v1/order/matchresults, orders.$symbol, trade.clearing#${symbol}, orders.$symbol.update, orders.list
Update
Added FOK order type
2020.3.27 19:00
GET /v1/order/orders GET /v1/order/orders
Update
Shorten the queriable period of "canceled" orders from 1 day to 2 hours.
2020.3.24 19:00
market.$symbol.mbp.$levels
Update
Added retrievable symbols
2020.3.17 19:00
GET /v1/order/matchresults
Update
The maximum value of the size field is increased from 100 to 500
2020.3.12 19:00
GET /market/tickers
Update
Added best bid/offer fields
2020.3.5 19:00
GET /v1/fee/fee-rate/get
Delete
Removed the endpoint
2020.3.2 11:00
GET https://status.huobigroup.com /api/v2/summary.json
New
Added "Get system status" endpoint
2020.2.28 11:00
GET /v1/cross-margin/loan-orders, GET /v1/cross-margin/accounts/balance
Update
Added new optional request parameter
2020.2.28 11:00
GET /v1/subuser/aggregate-balance, GET /v1/account/accounts/{sub-uid}
Update
Added new enum value to account type
2020.2.28 11:00
POST /v1/cross-margin/transfer-in, POST /v1/cross-margin/transfer-out, GET /v1/cross-margin/loan-info, POST /v1/cross-margin/orders, POST /v1/cross-margin/orders/{order-id}/repay, GET /v1/cross-margin/loan-orders, GET /v1/cross-margin/accounts/balance
Update
Authorised sub user's access is allowed
2020.2.5 19:00
GET /v1/order/orders/{order-id}, GET /v1/order/orders/getClientOrder, GET /v1/order/openOrders, GET /v1/order/orders, GET /v1/order/history
Update
Added new field "client-order-id" in response message
2020.2.5 19:00
GET /v1/order/orders
Update
Added new request field "start-time"/"end-time".
2020.2.3 19:00
GET /v2/reference/transact-fee-rate
New
Added new endpoint for transaction fee rate querying
2020.2.3 19:00
GET /v2/reference/currencies
Update
Added new field for base chain information
2020.2.3 19:00
GET /v1/margin/loan-info
Update
Added new field for actual interest rate post deduction
2020.1.10 19:00
GET /v1/cross-margin/loan-info
Update
Added new field for actual interest rate post deduction
Added new subscription topic for trade updates and account change updates
2019.11.22 15:00
GET /v1/order/orders GET /v1/order/history
Update
The query time range of canceled order is shortened to the last 1 day
2019.11.13 19:00
GET /v1/margin/loan-info GET /v1/cross-margin/loan-info
New
Added loan interest and amount query
2019.11.08 19:45
GET /v1/order/orders/{order-id}/matchresult GET /v1/order/matchresults
New
Added response field trade-id
2019.10.18 19:00
GET /v1/account/history
New
Added account history querying
2019.10.12 11:00
POST /v1/dw/withdraw/api/create
Update
Adjusted ERC20 as default chain for USDT
2019.10.11 10:00
Cross margin related
New
Added cross margin trading
2019.10.09 20:00
GET /market/trade GET /market/history/trade market.$symbol.trade.detail
Update
Added new response field "trade id"
2019.09.25 20:00
GET /v2/account/withdraw/quota
New
Added withdraw quota querying
2019.09.23 15:00
POST /v1/order/orders/{order-id}/submitcancel POST /v1/order/orders/batchcancel
Update
Optimized error message
2019.09.20 10:00
GET /v2/reference/currencies
New
Added querying reference information of currency and chains
2019.09.19 16:00
market.$symbol.bbo
New
Added best bid/offer update in tick by tick mode
2019.09.18 20:00
GET /v1/subuser/aggregate-balance GET /v1/account/accounts/{sub-uid} GET /v1/margin/loan-orders GET /v1/margin/accounts/balance
New
Added sub account isolated margin trading
2019.09.16 15:00
GET /v2/account/deposit/address
New
Added deposit address querying
2019.09.11 17:00
GET v1/stable-coin/quote POST v1/stable-coin/exchange
New
Added stable coin exchange
2019.09.11 16:00
N/A
Delete
Removed part of code demo.
2019.09.10 10:00
Order related API Except POST /v1/order/orders/submitCancelClientOrder & GET /v1/order/openOrders
Update
Removed order state values submitting and cancelling
2019.09.09 11:00
POST /v1/order/orders/submitCancelClientOrder
Update
Revised response message detail
2019.09.09 10:00
GET /v1/order/orders GET /v1/order/matchresults
Update
Revised description of default value and value range for "start-date" and "end-date"
2019.09.02 18:00
POST /v1/order/orders/batchCancelOpenOrders
Update
Revised description of request field symbol
2019.09.02 16:00
"Stable Coin Exchange" related
Delete
Deleted "Stable Coin Exchange" relavant API
2019.08.29 21:00
Order related
New
Add stop-limit order classification
2019.08.21 18:00
GET /v1/order/openOrders
Update
Corrected query parameters
2019.08.05 18:00
orders.$symbol.update
New
Added new fileds "client-order-id" and "order-type"。
2019.08.02 18:00
orders.$symbol.update
Update
Revised the description of field "unfilled-amount"
2019.07.23 21:00
GET /v1/order/orders/{order-id}/matchresult GET /v1/order/matchresults
New
Added transaction fee deduction details
2019.07.23 20:00
GET /v1/fee/fee-rate/get
New
Added transaction fee rate
2019.07.22 12:00
GET /v1/order/orders/{order-id}/matchresults GET /v1/order/matchresults
New
Added new fields role to indicate the order was "taker" or "maker"
2019.07.11 20:00
POST /v1/order/orders/place POST /v1/order/orders/submitCancelClientOrder GET /v1/order/orders/getClientOrder
Update New
Support client order ID。
2019.07.08 12:00
Websocket Asset and order topics
Update
Enhanced Websocket heartbeat and rate limit
2019.06.14 16:00
POST /v1/dw/withdraw/api/create
Update
support 'fast withdraw'
2019.06.17 16:00
GET /v1/stable_coin/exchange_rate POST /v1/stable_coin/exchange
New
Support user query Stable Coin exchange rate, and perform exchange
2019.06.12 16:00
GET /v1/common/symbols
Update
Add more reference information of a symbol
2019.06.06 18:00
GET /v1/query/deposit-withdraw
Update
Ehanced the request parameters
2019.06.05 20:00
All APIs that need authentication
Update
Set up 3 permission for API Key: Read, Trade and Withdraw
2019.06.10 00:00
GET /v1/order/orders GET /v1/order/matchresults
Update
Adjusted query window as 48 hours
2019.05.15 10:00
POST /v1/futures/transfer
New
Allow a user to tranfer fund between spot account and future contract account.
2019.04.29 19:00
GET /v1/order/history
New
Support historical order querying within 48 hours. With the launching of this new endpoint, the existing REST endpoint "v1/order/orders" will be kept in service. However, the new endpoint "/v1/order/history" will have better service level than the "/v1/order/orders", especially when the service loading exceeds the threshold of our system, which means in some extremely cases, "v1/order/orders" would become unavailable, but "/v1/order/history" would be kept alive. Meanwhile, Huobi is planning to have a delegated data service to support users’ demands on long-term history data. Once this new service become available, the "v1/order/orders" will be deprecated. We will keep you informed promptly once the timeline determined.
2019.04.17 10:00
GET /v1/order/orders
Update
Add clarification on the value range for start-date in documents
2019.04.16 10:00
GET /v1/order/openOrders
Update
Correct the documents error. Both account-id and symbol are required
2019.01.17 07:00
Websocket accounts
Update
Add subscription parameter model Subscription does not return frozen balance of sub-user anymore
2018.07.10 11:00
GET /market/history/kline
Update
The size parameter value range changes from [1-1000] to [1-2000]
2018.07.06 16:00
POST /v1/order/orders/place
Update
Added buy-limit-maker and sell-limit-maker order types
2018.07.06 16:00
GET /v1/order/openOrders POST /v1/order/orders/batchCancelOpenOrders
New
Added open orders query Added batch cancel open orders
2018.07.02 16:00
ETF related
New
Support transfer in/out of HB10.
2018.06.20 16:00
GET /market/tickers
New
Added tickers query
Introduction
Welcome to Huobi API!
This is the official Huobi API document, and will be continue updating. Huobi will also publish API announcement in advance for any API change. Please subscribe to our announcements so that you can get the latest updates.
You can click Here to view the announcements. If you want to subscribe, please click "Follow" button in the top right of the page. After login and click "Follow" again, then choose the type you want to follow. After you subscribe, the button will be changed to "Following". If you don't have any account, you need to register first in the login dialog.
How to read this document
The top of the document is the navigation menu for different API business; The language button in the top right is for different languages, it supports Chinese and English right now.
The main content of each API document has three parts, the left hand side is the contents, the middle part is the document body, and the right hand side is the request and response sameple.
Below is the content for Spot API document
The first part is the overview:
Quick Start: It introduces the overall knowledge of Huobi API, and suitability for new Huobi API user
API Explorer: It introduces the API Explorer online tool, which is convenient for user to invoke and observe the API
FAQ: It lists the frequently asked questions regardless the specific API
Contact Us: It introduces how to contact us according to different subjects
The second part is detail for each API. Each API category is listed in one section, and each each section has below contents:
Introduction: It introduces notes and description for this API category
Specific API: It introduces the usage, rate limit, request, parameters and response for each API
Error Code: It lists the common error code and the description for this API category
FAQ: It lists the frequently asked questions for this API category
Quick Start
Preparation
Before you use API, you need to login the website to create API Key with proper permissions. The API key is shared for all instruments in Huobi including spot, futures, swap, options.
The testnet has been alive for months, however the active user count is rather low and the cost is high, after considering carefully we decide to shutdown the testnet environment.
It is suggest you use live environment, which is more stable and has more liquidity.
Interface Type
There are two types of interface, you can choose the proper one according to your scenario and preferences.
REST API
REST (Representational State Transfer) is one of the most popular communication mechanism under HTTP, each URL represents a type of resource.
It is suggested to use Rest API for one-off operation, like trading and withdraw.
WebSocket API
WebSocket is a new protocol in HTML5. It is full-duplex between client and server. The connection can be established by a single handshake, and then server can push the notification to client actively.
It is suggest to use WebSocket API to get data update, like market data and order update.
Authentication
Both API has two levels of authentication:
Public API: It is for basic information and market data. It doesn't need authentication.
Private API: It is for account related operation like trading and account management. Each private API must be authenticated with API Key.
Access URLs
You can compare the network latency between two domain api.huobi.pro and api-aws.huobi.pro, and then choose the better one for you.
In general, the domain api-aws.huobi.pro is optimized for AWS client, the latency will be lower.
REST API
https://api.huobi.pro
https://api-aws.huobi.pro
Websocket Feed (market data except MBP incremental)
wss://api.huobi.pro/ws
wss://api-aws.huobi.pro/ws
Websocket Feed (market data only MBP incremental)
wss://api.huobi.pro/feed
wss://api-aws.huobi.pro/feed
Websocket Feed (account and order)
wss://api.huobi.pro/ws/v2
wss://api-aws.huobi.pro/ws/v2
Authentication
Overview
The API request may be tampered during internet, therefore all private API must be signed by your API Key (Secrete Key).
Each API Key has permission property, please check the API permission, and make sure your API key has proper permission.
A valid request consists of below parts:
API Path: for example api.huobi.pro/v1/order/orders
API Access Key: The 'Access Key' in your API Key
Signature Method: The Hash method that is used to sign, it uses HmacSHA256
Signature Version: The version for the signature protocol, it uses 2
Timestamp: The UTC time when the request is sent, e.g. 2017-05-11T16:22:06. It is useful to prevent the request to be intercepted by third-party.
Parameters: Each API Method has a group of parameters, you can refer to detailed document for each of them.
For GET request, all the parameters must be signed.
For POST request, the parameters needn't be signed and they should be put in request body.
Signature: The value after signed, it is guarantee the signature is valid and the request is not be tempered.
Signature Method
The signature may be different if the request text is different, therefore the request should be normalized before signing. Below signing steps take the order query as an example:
This is a full URL to query one order:
https://api.huobi.pro/v1/order/orders?
AccessKeyId=e2xxxxxx-99xxxxxx-84xxxxxx-7xxxx
&SignatureMethod=HmacSHA256
&SignatureVersion=2
&Timestamp=2017-05-11T15:19:30
&order-id=1234567890
1. The request Method (GET or POST, WebSocket use GET), append line break "\n"
GET\n
2. The host with lower case, append line break "\n"
Example:
api.huobi.pro\n
3. The path, append line break "\n"
For example, query orders:
/v1/order/orders\n
For example, WebSocket v2
/ws/v2
4. The parameters are URL encoded, and ordered based on ASCII
For example below is the original parameters:
AccessKeyId=e2xxxxxx-99xxxxxx-84xxxxxx-7xxxx
order-id=1234567890
SignatureMethod=HmacSHA256
SignatureVersion=2
Timestamp=2017-05-11T15%3A19%3A30
Then above parameter should be ordered like below:
Sub user can be used to isolate the assets and trade, the assets can be transferred between parent and sub users. Sub user can only trade with the sub user. The assets can not be transferred between sub users, only parent user has the transfer permission.
Sub user has independent login password and API Key, they are managed under parent user in website.
Each parent user can create 200 sub user, each sub user can create at most 5 API Key, each API key can have two permissions: read and trade.
The sub user API Key can also bind IP address, the expiry policy is the same with parent user.
You can access here to create and manage sub user.
The sub user can access all public API (including basic information and market data), below are the private APIs that sub user can access:
The trading symbols are consist of base currency and quote currency. Take the symbol BTC/USDT as an example, BTC is the base currency, and USDT is the quote currency.
Account
The account-id defines the Identity for different business type, it can be retrieved from API /v1/account/accounts , where the account-type is the business types.
The types include:
spot: Spot account
otc: OTC account
margin: Isolated margin account, the detailed currency type is defined in subType
super-margin / cross-margin: Cross-margin account
investment: c2c margin lending account
borrow: c2c margin borrowing account
point: Point card account
minepool: Minepool account
etf: ETF account
You can refer to Huobi Course to get detailed information
API Access
Overview
Category
URL Path
Description
Common
/v1/common/*
Common interface, including currency, currency pair, timestamp, etc
Market Data
/market/*
Market data interface, including trading, depth, quotation, etc
Account
/v1/account/* /v1/subuser/*
Account interface, including account information, sub-user ,etc
Order
/v1/order/*
Order interface, including order creation, cancellation, query, etc
Margin
/v1/margin/*
Margin interface, including debit, payment, query, etc
Cross Margin
/v1/cross-margin/*
Cross margin interface, including debit, payment, query, etc
Above is a general category, it doesn't cover all API, you can refer to detailed API document according to your requirement.
New Version Rate limit Rule
The new version rate limit is applied on UID basis, which means, the overall access rate, from all API keys under same UID, to single endpoint, shouldn’t exceed the rate limit applied on that endpoint.
It is suggested to read HTTP Header X-HB-RateLimit-Requests-Remain and X-HB-RateLimit-Requests-Expire to get the remaining count of request and the expire time for current rate limit time window, then you can adjust the API access rate dynamically.
Request Format
The API is restful and there are two method: GET and POST.
GET request: All parameters are included in URL, and do not carry body(content-length>0), in otherwise will return 403 error code.
POST request: All parameters are formatted as JSON and put int the request body
Response Format
The response is JSON format.There are four fields in the top level: status, ch, ts and data. The first three fields indicate the general status, the business data is is under data field.
The data stream. It may be empty as some API doesn't have data stream
ts
int
The UTC timestamp when API respond, the unit is millisecond
data
object
The body data in response
Data Type
The JSON data type described in this document is defined as below:
string: a sequence of characters that are quoted
int: a 32-bit integer, mainly used for status code, size and count
long: a 64-bit integer, mainly used for Id and timestamp
float: a fraction represented in decimal format, mainly used for volume and price, recommend to use high precision decimal data types in program
Best Practice
Security
It is strongly suggested to bind your IP with your API Key to ensure that your API Key can only be used in your machine. Furthermore, your API Key will be expired after 90 days if it is not binded with any IP.
It is strongly suggested not to share your API Key with any body or third-party software, otherwise your personal information and asset may be stolen. If your expose your API Key by accident, please do delete the API Key and create a new one.
General
API Access
It is suggested not to use temporary domain or proxy, which may be not stable.
It is suggested to use AWS Japan to access API for lower latency
It is suggested to connect to domain api-aws.huobi.pro if your server is based on AWS, because this domain is optimized for AWS client, the latency will be lower.
New Version Rate limit Rule
Only those endpoints marked with rate limit value separately are applied with new rate limit rule.
It is suggested to read HTTP Header X-HB-RateLimit-Requests-Remain and X-HB-RateLimit-Requests-Expire to get the remaining count of request and the expire time for current rate limit time window, then you can adjust the API access rate dynamically.
The overall access rate, from all API keys under same UID, to single endpoint, shouldn’t exceed the rate limit applied on that endpoint.
Market
Market data
It is suggested to use WebSocket interface to subscribe the market update and then cache the data locally, because WebSocket notification has lower latency and not have rate limit.
It is suggested not to subscribe too many topics in a single websocket connection, it may generate more notifications and cause network latency and disconnection.
Latest trade
It is suggested to subscribe WebSocket topic market.$symbol.trade.detail, the response field price represents the latest price, and it has lower latency.
It is suggested to use tradeId to de-duplicate if you subscribe WebSocket topic market.$symbol.trade.detail.
Depth
It is suggested to subscribe WebSocket topic market.$symbol.bbo if you only need the best bid and best offer.
It is suggested to subscribe WebSocket topic market.$symbol.depth.$type if you need multiple bid and offer with normal latency.
It is suggested to subscribe WebSocket topic market.$symbol.mbp.$level if you need multiple bid and offer with lower latency
It is suggested to use version field to de-duplicate and discard the smaller data if you use Rest interface /market/depth and WebSocket topic market.$symbol.depth.$type. It is suggest to use seqNum to de-duplicate and discard the smaller data if yo subscribe WebSocket topic market.$symbol.mbp.$levels.
Order
Place an order (/v1/order/orders/place)
It is suggested to follow the symbol reference (/v1/common/symbols) to validate the amount and value before placing the older, otherwise you may place an invalid order and waste your time.
It is suggested to provide an unique client-order-id field when placing the order, it is useful to track your orders status if you fail to get the order id response. Later you can use the client-order-id to match the WebSocket order notification or query order detail by interface /v1/order/orders/getClientOrder.The uniqueness of the clientOrderId passed in when you place an order will no longer be verified. We recommend you to manage clientOrderId by yourself to ensure its uniqueness. If multiple orders use the same clientOrderId, the latest order corresponding to the clientOrderId will be returned when querying/canceling an order.
Search history olders (/v1/order/orders)
It is recommended to use start-time and end-time to query, that are two timestamps with 13 digits (millisecond). The maximum query time window is 48 hours (2 days), the more precision you provide, the better performance you will get. You can query for multiple iterations.
Order update
It is suggested to subscribe WebSocket topic orders.$symbol, which has lower latency and more accurate sequence.
Account
Asset update
It is suggested to subscribe both WebSocket topic orders.$symbol and account.update#${mode}. The former one tells the order status update and arrives earlier than the latter one, and the latter one confirms the final asset balance.
It is suggested not to subscribe WebSocket topic accounts, which is replaced by accounts.update#${mode}, and will be retired later.
API Explorer
API Explorer allows user to invoke and observe each API request and response without writing any program. The UI is designed as the same as document, which has input parameters and response description, user can use it easily without any additional user guide.
This Explorer encapsulates a shared API Key, and will show the signature calcuation steps and request parameters when it invokes API. If you encounter signature problem, you can copy the API Key and timestamp to your program and compare with the result in Explorer.
Frequently Asked Questions
This section lists the frequently asked questions regardless the specific API, such as network, signature or common errors.
For specific API question, please check the Error Code and FAQ in each API category.
Q1:What is UID and account-id?
UID is the unique ID for a user (including master user and sub user), it can be found in Web or App personal information part, or retrieved from API GET /v2/user/uid.
The account-id defines the identity for different account type under one user, it can be retrieved from API /v1/account/accounts , where the account-type is the account types.
The types include but not limited to below types, contract account types (futures/swap/option) are not included:
spot: Spot account
otc: OTC account
margin: Isolated margin account, the detailed currency type is defined in subType
super-margin / cross-margin: Cross-margin account
investment: c2c margin lending account
borrow: c2c margin borrowing account
point: Point card account
minepool: Minepool account
etf: ETF account
Q2:How many API Keys one user can apply?
Every user can create 20 API Keys, and each API Key can be granted with 3 permissions: read, trade and withdraw.
Each user could create up to 200 sub users, and each sub user could create 20 API Keys, each API key can be granted with 2 permissions: read and trade.
Below are the explanation for permissions:
Read permission: It is used to query data, for example, query orders, query trades.
Trade permission: it is used to place order, cancel order and transfer.
Withdraw permission: it is used to withdraw, cancel withdraw.
Q3:Why APIs are always disconnected or timeout?
Please follow below suggestions:
It is unstable if the client's server locates in China mainland, it is suggested to invoke API from a server at AWS Japan.
It is suggested to invoke API only to host api.huobi.pro or api-was.huobi.pro.
Q4:Why the WebSocket is often disconnected?
Please check below possible reasons:
The client didn't respond 'Pong'. It is requird to respond 'Pong' after receive 'Ping' from server.
The server didn't receive 'Pong' successfully due to network issue.
The connection is broken due to network issue.
It is suggested to implement WebSocket re-connect mechanism. If Ping/Pong works well but the connection is broken, the application should be able to re-connect automatically.
Q5:What is the difference between api.huobi.pro and api-aws.huobi.pro?
The host api-aws.huobi.pro is optimized for AWS client, the latency is lower.
Q6:Why the signature authentication always fail?
Please check whether you follow below rules:
1.The parameter in signature text should be ordered by ASCII, for example below is the original parameters:
AccessKeyId=e2xxxxxx-99xxxxxx-84xxxxxx-7xxxx
order-id=1234567890
SignatureMethod=HmacSHA256
SignatureVersion=2
Timestamp=2017-05-11T15%3A19%3A30
They should be ordered like below:
AccessKeyId=e2xxxxxx-99xxxxxx-84xxxxxx-7xxxx
SignatureMethod=HmacSHA256
SignatureVersion=2
Timestamp=2017-05-11T15%3A19%3A30
order-id=1234567890
2.The signature text should be URL encoded, for example
The semicolon :should be encoded as %3A, The space should be encoded as %20.
The timestamp should be formatted as YYYY-MM-DDThh:mm:ss and after encoded it should be like 2017-05-11T15%3A19%3A30
3.The signature should be base64 encoded.
4.The parameter for Get request should be included in signature request.
5.The Timestamp should be UTC time and the format should be YYYY-MM-DDTHH:mm:ss.
6.The time difference between your timestamp and standard should be less than 1 minute.
7.The message body doesn't need URL encoded if you are using WebSocket for authentication.
8.The host in signature text should be the same as the host in your API request.
The proxy may change the request host, you can try without proxy;
Some http/websocket library may include port in the host, you can try to append port in signature host, like "api.huobi.pro:443"
9.The hidden text in API Key and Secret Key may have impact on the signature.
10.Check the byte[] is directly to be Base64 encoded after generated from the HmacSHA256 signature, instead of hexadecimal string to be Base64 encoded.
Right now the official SDK supports multiple languages, you can refer to the signature implementation, or below three signature examples.
Please check whether Access Key is wrong in URL request, such as:
The AccessKeyId is not included in URL parameter
The length of AccessKey is wrong
The AccessKey is already deleted
The URL request is not assembled correctly which cause AccessKey is parsed unexpected in server side.
Q8:Why the API return 'gateway-internal-error'?
Please check below possible reasons:
It may be due to network issue or server internal error, please try again later.
The data format should be correct (standard JSON).
The Content-Type in POST header should be application/json .
Q9:Why the API return 'login-required'?
Please check below possible reasons:
The URL request parameter should include AccessKeyId.
The URL request parameter should include Signature.
Q10: Why the API return HTTP 405 'method-not-allowed'?
It indicates the request path doesn't exist, please check the path spelling carefully. Due to the Nginx setting, the request path is case sensitive, please follow the path definition in document.
Contact Us
Market Maker Program
It is very welcome for market maker who has good market making strategy and large trading volume. If your Huobi Spot account or Contract account has at least 10 BTC, you can send your email to:
Contact customer support from Help Center or send email to [email protected].
If you encounter API errors, please use below template in your feedback:
1. Problem description 2. UID, Account Id and Order Id (if related with account and order) 3. Raw URL request 4. Raw JSON request (if any) 5. Raw JSON response 6. Problem time and frequency (such as, when this problem occurs, whether it is reproducible) 7. Pre-signed text (Required for authentication issue)
Below is an example:
1. Problem description: API authentication error 2. UID:123456 3. Raw URL request: https://api.huobi.pro/v1/account/accounts?&SignatureVersion=2&SignatureMethod=HmacSHA256&Timestamp=2019-11-06T03%3A25%3A39&AccessKeyId=rfhxxxxx-950000847-boooooo3-432c0&Signature=HhJwApXKpaLPewiYLczwfLkoTPnFPHgyF61iq0iTFF8%3D 4. Raw JSON request: N/A 5. Raw JSON response:{"status":"error","err-code":"api-signature-not-valid","err-msg":"Signature not valid: Incorrect Access key [Access key错误]","data":null} 6. Problem time and frequency: It occurs every time 7. Pre-signed text: GET\n api.huobi.pro\n /v1/account/accounts\n AccessKeyId=rfhxxxxx-950000847-boooooo3-432c0&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2019-11-06T03%3A26%3A13
Note:It is safe to share your Access Key, which is to prove your identity, and it will not affect your account safety. Remember do not share your Secret Key to any one. If you expose your Secret Key by accident, please remove the related API Key immediately.
Reference Data
Introduction
Reference data APIs provide public reference information such as system status, market status, symbol info, currency info, chain info and server timestamp.
Get system status
This endpoint allows users to get system status, Incidents and planned maintenance.
The system status can also be obtained through email, SMS, webhook, RSS/Atom feed. Users can click here to subscribe. The subscription function depends on Google services. Before you subscribe, please ensure that you can access Google services normally.
GET https://status.huobigroup.com/api/v2/summary.json
Request Parameters
No parameter is available for this endpoint.
Response:
{"page":{//Basicinformationofhuobispotstatuspage"id":"p0qjfl24znv5",//pageid"name":"Huobi",//pagename"url":"https://status.huobigroup.com",//pageurl"time_zone":"Etc/UTC",//timezone"updated_at":"2020-02-07T10:25:14.717Z"//pageupdatetime},"components":[//Systemcomponentsandtheirstatus{"id":"h028tnzw1n5l",//componentid"name":"Deposit",//componentname"status":"operational",//componentstatus"created_at":"2019-12-05T02:07:12.372Z",//componentcreatetime"updated_at":"2020-02-07T09:27:15.563Z",//componentupdatetime"position":1,"description":null,"showcase":true,"group_id":"gtd0nyr3pf0k","page_id":"p0qjfl24znv5","group":false,"only_show_if_degraded":false}],"incidents":[//Systemfaultincidentsandtheirstatus{"id":"rclfxz2g21ly",//incidentid"name":"Market data is delayed",//incidentname"status":"investigating",//incidentstatus"created_at":"2020-02-11T03:15:01.913Z",//incidentcreatedtime"updated_at":"2020-02-11T03:15:02.003Z",//incidentupdatedtime"monitoring_at":null,"resolved_at":null,"impact":"minor",//incidentimpact"shortlink":"http://stspg.io/pkvbwp8jppf9","started_at":"2020-02-11T03:15:01.906Z","page_id":"p0qjfl24znv5","incident_updates":[{"id":"dwfsk5ttyvtb","status":"investigating","body":"Market data is delayed","incident_id":"rclfxz2g21ly","created_at":"2020-02-11T03:15:02.000Z","updated_at":"2020-02-11T03:15:02.000Z","display_at":"2020-02-11T03:15:02.000Z","affected_components":[{"code":"nctwm9tghxh6","name":"Market data","old_status":"operational","new_status":"degraded_performance"}],"deliver_notifications":true,"custom_tweet":null,"tweet_id":null}],"components":[{"id":"nctwm9tghxh6","name":"Market data","status":"degraded_performance","created_at":"2020-01-13T09:34:48.284Z","updated_at":"2020-02-11T03:15:01.951Z","position":8,"description":null,"showcase":false,"group_id":null,"page_id":"p0qjfl24znv5","group":false,"only_show_if_degraded":false}]}],"scheduled_maintenances":[//Systemscheduledmaintenanceeventsandtheirstatus{"id":"k7g299zl765l",//incidentid"name":"Schedule maintenance",//incidentname"status":"scheduled",//incidentstatus"created_at":"2020-02-11T03:16:31.481Z",//incidentcreatetime"updated_at":"2020-02-11T03:16:31.530Z",//incidentupdatetime"monitoring_at":null,"resolved_at":null,"impact":"maintenance",//incidentimpact"shortlink":"http://stspg.io/md4t4ym7nytd","started_at":"2020-02-11T03:16:31.474Z","page_id":"p0qjfl24znv5","incident_updates":[{"id":"8whgr3rlbld8","status":"scheduled","body":"We will be undergoing scheduled maintenance during this time.","incident_id":"k7g299zl765l","created_at":"2020-02-11T03:16:31.527Z","updated_at":"2020-02-11T03:16:31.527Z","display_at":"2020-02-11T03:16:31.527Z","affected_components":[{"code":"h028tnzw1n5l","name":"Deposit And Withdraw - Deposit","old_status":"operational","new_status":"operational"}],"deliver_notifications":true,"custom_tweet":null,"tweet_id":null}],"components":[{"id":"h028tnzw1n5l","name":"Deposit","status":"operational","created_at":"2019-12-05T02:07:12.372Z","updated_at":"2020-02-10T12:34:52.970Z","position":1,"description":null,"showcase":false,"group_id":"gtd0nyr3pf0k","page_id":"p0qjfl24znv5","group":false,"only_show_if_degraded":false}],"scheduled_for":"2020-02-15T00:00:00.000Z",//scheduledmaintenancestarttime"scheduled_until":"2020-02-15T01:00:00.000Z"//scheduledmaintenanceendtime}],"status":{//Theoverallcurrentstatusofthesystem"indicator":"minor",//systemindicator"description":"Partially Degraded Service"//systemdescription}}
Response Content
Field
Data Type
Description
page
basic information of huobi spot status page
{id
string
page id
name
string
page name
url
string
page url
time_zone
string
time zone
updated_at}
string
page update time
components
System components and their status
[{id
string
component id
name
string
component name, including Order submission, Order cancellation, Deposit etc.
status
string
component status, value range: operational, degraded_performance, partial_outage, major_outage, under maintenance
created_at
string
component created time
updated_at
string
component updated time
.......}]
for details of other fields, please refer to the return example
incidents
System fault incident and their status. If there is no fault at present, it will return to null
[{id
string
incident id
name
string
incident name
status
string
incident status, value range: investigating, identified, monitoring, resolved
created_at
string
incident creat time
updated_at
string
incident update time
.......}]
for details of other fields, please refer to the return example
scheduled_maintenances
System scheduled maintenance incident and status. If there is no scheduled maintenance at present, it will return to null
[{id
string
incident id
name
string
incident name
status
string
incident staus, value range: scheduled, in progress, verifying, completed
created_at
string
incident created time
updated_at
string
incident updated time
scheduled_for
string
scheduled maintenance start time
scheduled_until
string
scheduled maintenance end time
.......}]
for details of other fields, please refer to the return example
status
The overall current status of the system
{indicator
string
system indicator, value range: none, minor, major, critical, maintenance
description}
string
system description, value range: All Systems Operational, Minor Service Outager, Partial System Outage, Partially Degraded Service, Service Under Maintenance
Get Market Status
The endpoint returns current market status
The enum values of market status includes: 1 - normal (order submission & cancellation are allowed),2 - halted (order submission & cancellation are prohibited),3 - cancel-only(order submission is prohibited but order cancellation is allowed).
Halt reason includes: 2 - emergency maintenance,3 - schedule maintenance.
Halt start time (unix time in millisecond) , only valid for marketStatus=halted or cancel-only
haltEndTime
long
FALSE
Estimated halt end time (unix time in millisecond) , only valid for marketStatus=halted or cancel-only; if this field is not returned during marketStatus=halted or cancel-only, it implicates the halt end time cannot be estimated at this time.
haltReason
integer
FALSE
Halt reason (2=emergency-maintenance, 3=scheduled-maintenance) , only valid for marketStatus=halted or cancel-only
affectedSymbols
string
FALSE
Affected symbols, separated by comma. If affect all symbols just respond with value ‘all’. Only valid for marketStatus=halted or cancel-only
</data>
Get all Supported Trading Symbol(V2)
API Key Permission:Read
GET /v2/settings/common/symbols
Request Parameters
Parameter
Data Type
Required
Description
ts
long
false
timestamp to get incremental data
Note
It returns updated data from this timestample to the current time if filled in with ts. If there is no update, the "data" of response is "[]".
symbol status. unknown,not-online,pre-online,online,suspend,offline,transfer-board,fuse
whe
white_enabled
boolean
white enabled
cd
country_disabled
boolean
country disabled
te
trade_enabled
boolean
trade enabled
toa
trade_open_at
long
the time trade open at
sp
symbol_partition
string
symbol partition
w
weight
int
weight sort
ttp
trade_total_precision
decimal(10,6)
trade total precision
tap
trade_amount_precision
decimal(10,6)
trade amount precision
tpp
trade_price_precision
decimal(10,6)
trade price precision
fp
fee_precision
decimal(10,6)
fee precision
suspend_desc
suspend_desc
string
suspend desc
transfer_board_desc
transfer_board_desc
string
transfer board desc
tags
tags
string
Tags, multiple tags are separated by commas, such as: st, hadax
lr
leverage_ratio
decimal
leverage ratio, such as: 3.5, or null if the symbol does not support this leverage ratio
smlr
super_margin_leverage_ratio
decimal
super-margin leverage ratio, such as: 3, or null if the symbol does not support super-margin
flr
funding_leverage_ratio
String
C2C leverage ratio, such as:3, or null if the symbol does not support C2C
wr
withdraw_risk
string
withdraw_risk, such as: 3, or null if the symbol does not support super-margin
d
direction
int
direction: 1 for long and 2 for short
elr
etp_leverage_ratio
string
etp leverage ratio
p
partitions
Object
castate
ca state
string
not Required. The state of the call auction; it will only be displayed when it is in the 1st and 2nd stage of the call auction. Enumeration values: "ca_1", "ca_2"
ca1oa
ca1 open at
long
not Required. this information is only available for that symbols configured with call auction. The total number of milliseconds since 0:0:0:00,000 on January 1, 1970 UTC to the present.
ca2oa
ca2 open at
long
not Required. this information is only available for that symbols configured with call auction. The total number of milliseconds since 0:0:0:00,000 on January 1, 1970 UTC to the present.
</data>
ts
ts
String
timestamp of incremental data
full
full
int
full data flag: 0 for no and 1 for yes
err_code
err_code
string
error code(returned when the interface reports an error)
err_msg
err_msg
string
error msg(returned when the interface reports an error)
Get all Supported Currencies(V2)
API Key Permission:Read
GET /v2/settings/common/currencies
Request Parameters
Parameter
Data Type
Required
Description
ts
long
false
timestamp to get incremental data
Note
It returns updated data from this timestample to the current time if filled in with ts. If there is no update, the "data" of response is "[]".
response
{"status":"ok","data":[{"tags":"","cawt":false,"fc":12,"sc":12,"dma":"1","wma":"10","ft":"eth","whe":false,"cd":false,"qc":true,"sp":"8","wp":6,"fn":"Tether USDT","at":1,"cc":"usdt","v":true,"de":true,"wed":true,"w":10006,"state":"online","dn":"USDT","dd":"Please don’t deposit any other digital assets except USDT to the above address. Otherwise, you may lose your assets permanently. !>_<!Depositing to the above address requires confirmations of the entire network. It will arrive after 12 confirmations, and it will be available to withdraw after 12 confirmations. !>_<!Minimum deposit amount: 1 USDT. Any deposits less than the minimum will not be credited or refunded.!>_<!Your deposit address won’t change often. If there are any changes, we will notify you via announcement or email.!>_<!Please make sure that your computer and browser are secure and your information is protected from being tampered or leaked.","svd":null,"swd":null,"sdd":null,"wd":"Minimum withdrawal amount: 10 USDT (ERC20). !>_<!To ensure the safety of your funds, your withdrawal request will be manually reviewed if your security strategy or password is changed. Please wait for phone calls or emails from our staff.!>_<!Please make sure that your computer and browser are secure and your information is protected from being tampered or leaked."}],"ts":"1641869938436","full":1}
visible or not -- users who have offline currency but have assets can see it
whe
white_enabled
boolean
white enabled
cd
country_disabled
boolean
country disabled--users who have country disabled currency but have assets can see it
de
deposit_enabled
boolean
deposit enabled
wed
withdraw_enabled
boolean
withdraw enabled
cawt
currency_addr_with_tag
boolean
currency addr with tag
fc
fast_confirms
int
fast confirms
sc
safe_confirms
int
safe confirms
swd
suspend_withdraw_desc
string
suspend withdraw desc
wd
withdraw_desc
string
withdraw desc
sdd
suspend_deposit_desc
string
suspend deposit desc
dd
deposit_desc
string
deposit desc
svd
suspend_visible_desc
string
suspend visible desc
tags
tags
string
Tags, multiple tags are separated by commas, such as: st, hadax
</data>
ts
ts
String
timestamp of incremental data
full
full
int
full data flag: 0 for no and 1 for yes
err_code
err_code
string
error code(returned when the interface reports an error)
err_msg
err_msg
string
error msg(returned when the interface reports an error)
Get Currencys Settings
API Key Permission:Read
GET /v1/settings/common/currencys
Request Parameters
Parameter
Data Type
Required
Description
ts
long
false
timestamp to get incremental data
Note
It returns updated data from this timestample to the current time if filled in with ts. If there is no update, the "data" of response is "[]".
response
{"status":"ok","data":[{"tags":"","name":"usdt","state":"online","cawt":false,"fc":12,"sc":12,"sp":"8","iqc":true,"ct":"eth","de":true,"we":true,"cd":false,"oe":1,"v":true,"whe":false,"wet":1609430400000,"det":1609430400000,"cp":"all","vat":1508839200000,"ss":["INSTITUTION","MINEPOOL","OTC"],"fn":"Tether USDT","wp":6,"w":10006,"dma":"1","wma":"10","dn":"USDT","dd":"Please don’t deposit any other digital assets except USDT to the above address. Otherwise, you may lose your assets permanently. !>_<!Depositing to the above address requires confirmations of the entire network. It will arrive after 12 confirmations, and it will be available to withdraw after 12 confirmations. !>_<!Minimum deposit amount: 1 USDT. Any deposits less than the minimum will not be credited or refunded.!>_<!Your deposit address won’t change often. If there are any changes, we will notify you via announcement or email.!>_<!Please make sure that your computer and browser are secure and your information is protected from being tampered or leaked.","svd":null,"swd":null,"sdd":null,"wd":"Minimum withdrawal amount: 10 USDT (ERC20). !>_<!To ensure the safety of your funds, your withdrawal request will be manually reviewed if your security strategy or password is changed. Please wait for phone calls or emails from our staff.!>_<!Please make sure that your computer and browser are secure and your information is protected from being tampered or leaked."}],"ts":"1641872721891","full":1}
Response Content
Parameter
Full Name
Data Type
Description
status
status
string
status
data
<data>
Object
name
name
string
currency name
dn
display-name
string
currency display name
vat
visible-assets-timestamp
long
visible assets timestamp
det
deposit-enable-timestamp
long
deposit enable timestamp
wet
withdraw-enable-timestamp
long
withdraw enable timestamp
wp
withdraw-precision
int
withdraw precision
ct
currency-type
string
currency type
cp
currency-partition
string
currency partition. INVALID, all(PRO and HADAX), pro, hadax
ss
support-sites
array
support sites. unknown, otc, futures(coin-m futures), minepool( not supports mulan), institution, swap(coin-m swap), asset(mulan does not support transfer, it is only used for reconciliation, cfd(cfd contract in Japan), chat(Huobi Chat IM), option, linear-swap(usdt-m), custody(funding account in HK), turbine, margin, super-margin
symbol status. unknown,not-online,pre-online,online,suspend,offline,transfer-board,fuse
ve
visible-enabled
boolean
visible
we
white-enabled
boolean
white enabled
dl
delist
boolean
delist
cd
country-disabled
boolean
country disabled
te
trade-enabled
boolean
trade enabled
ce
cancel-enabled
boolean
cancel enabled
tet
trade-enable-timestamp
long
trade enable timestamp
toa
trade-open-at
long
the time trade open at
tca
trade-close-at
long
the time trade close at
voa
visible-open-at
long
visible open at
vca
visible-close-at
long
visible close at
sp
symbol-partition
string
symbol partition
tm
trade-market
string
symbol partition
w
weight
int
weight sort
ttp
trade-total-precision
decimal(10,6)
trade total precision
tap
trade-amount-precision
decimal(10,6)
trade amount precision
tpp
trade-price-precision
decimal(10,6)
trade price precision
fp
fee-precision
decimal(10,6)
fee precision
tags
tags
string
Tags, multiple tags are separated by commas, such as: st, hadax
d
direction
bcdn
base_currency_display_name
string
base currency display name
qcdn
quote_currency_display_name
string
quote currency display name
elr
etp_leverage_ratio
string
etp leverage ratio
castate
ca state
string
Not required. The state of the call auction; it will only be displayed when it is in the 1st and 2nd stage of the call auction. Enumeration values: "ca_1", "ca_2"
ca1oa
ca1 open at
long
not Required. the open time of call auction phase 1, total milliseconds since January 1, 1970 0:0:0:00ms UTC
ca1ca
ca1 close at
long
not Required. the close time of call auction phase 1, total milliseconds since January 1, 1970 0:0:0:00ms UTC
ca2oa
ca2 open at
long
not Required. the open time of call auction phase 2, total milliseconds since January 1, 1970 0:0:0:00ms UTC
ca2ca
ca2 close at
long
not Required. the close time of call auction phase 2, total milliseconds since January 1, 1970 0:0:0:00ms UTC
</data>
ts
ts
String
timestamp of incremental data
full
full
int
full data flag: 0 for no and 1 for yes
err-code
err-code
string
error code(returned when the interface reports an error)
err-msg
err-msg
string
error msg(returned when the interface reports an error)
Get Market Symbols Setting
API Key Permission:Read
GET /v1/settings/common/market-symbols
Request Parameters
Parameter
Data Type
Required
Description
symbols
string
false
symbols. NA means all symbols, multiple symbols separated with comma
ts
long
false
timestamp to get incremental data
Note
It returns updated data from this timestample to the current time if filled in with ts. If there is no update, the "data" of response is "[]".
symbol status. unknown,not-online,pre-online,online,suspend,offline,transfer-board,fuse
sp
symbol-partition
string
symbol partition
tags
tags
string
Tags, multiple tags are separated by commas, such as: st, hadax
lr
leverage_ratio
decimal
leverage ratio of margin symbol, provided by Global
smlr
super_margin_leverage_ratio
decimal
leverage ratio of super-margin symbol, provided by Global
pp
price-precision
integer
price precision
ap
amount-precision
integer
amount precision
vp
value-precision
integer
value precision
minoa
min-order-amt
decimal
min order amount
maxoa
max-order-amt
decimal
max order amount
minov
min-order-value
decimal
min order value
lominoa
limit-order-min-order-amt
decimal
min amount of limit price order
lomaxoa
limit-order-max-order-amt
decimal
max amount of limit price order
lomaxba
limit-order-max-buy-amt
decimal
max amount of limit price buy order
lomaxsa
limit-order-max-sell-amt
decimal
max amount of limit price sell order
smminoa
sell-market-min-order-amt
decimal
min amount of market price sell order
smmaxoa
sell-market-max-order-amt
decimal
max amount of market price sell order
bmmaxov
buy-market-max-order-value
decimal
max amount of market price buy order
blmlt
buy-limit-must-less-than
decimal(10,6)
Buy limit must less than
slmgt
sell-limit-must-greater-than
decimal(10,6)
Sell limit must greater than
msormlt
market-sell-order-rate-must-less-than
decimal(10,6)
Market sell order rate must less than
mbormlt
market-buy-order-rate-must-less-than
decimal(10,6)
Market buy order rate must less than
at
api-trading
string
trading by api interface
u
underlying
string
ETP: symbol
mfr
mgmt-fee-rate
decimal
ct
charge-time
string
charge time(unix time in millisecond, just for symbols of ETP)
rt
rebal-time
string
rebal time(unix time in millisecond, just for symbols of ETP)
rthr
rebal-threshold
decimal
rebal threshold(just for symbols of ETP)
in
init-nav
decimal
ETP: init nav
maxov
max-order-value
decimal
max value of market price order
flr
funding-leverage-ratio
decimal
C2C: funding leverage ratio
castate
ca state
string
not Required. The state of the call auction; it will only be displayed when it is in the 1st and 2nd stage of the call auction. Enumeration values: "ca_1", "ca_2"
</data>
ts
ts
String
timestamp of incremental data
full
full
int
full data flag: 0 for no and 1 for yes
err-code
err-code
string
error code(returned when the interface reports an error)
err-msg
err-msg
string
error msg(returned when the interface reports an error)
Get Chains Information
API Key Permission:Read
GET /v1/settings/common/chains
Request Parameters
Parameter
Data Type
Required
Description
show-desc
string
false
show desc, 0: no, 1: all, 2: suspend deposit/withdrawal and chain exchange
currency
string
false
currency
ts
long
false
timestamp to get incremental data
Note
It returns updated data from this timestample to the current time if filled in with ts. If there is no update, the "data" of response is "[]".
response
{"status":"ok","data":[{"chain":"hrc20nft","currency":"nft","code":"hrc20nft","ct":"live","ac":"eth","default":0,"dma":"160298","wma":"160298","de":true,"we":true,"wp":6,"ft":"eth","dn":"HECO","fn":"","awt":false,"adt":false,"ao":false,"fc":10,"sc":20,"v":true,"sda":"","swa":"","deposit-tips-desc":"Minimum deposit amount:160298\nAny deposits less than the minimum amount will not be credited or refunded.","withdraw-desc":"Minimum withdrawal amount: 160298 NFT(HECO). !>_<!To ensure the safety of your funds, your withdrawal request will be manually reviewed if your security strategy or password is changed. Please wait for phone calls or emails from our staff.!>_<!Please make sure that your computer and browser are secure and your information is protected from being tampered or leaked.","suspend-deposit-desc":"","suspend-withdraw-desc":"","replace-chain-info-desc":"","replace-chain-notification-desc":"","replace-chain-popup-desc":""}],"ts":"1641880897191","full":1}
Response Content
Parameter
Full Name
Data Type
Description
status
status
string
status
data
<data>
Object
adt
addr-deposit-tag
boolean
has addr deposit tag
ac
address-chain
string
address of chain
ao
addr-oneoff
boolean
addr oneoff
awt
addr-with-tag
boolean
addr with tag
chain
chain
string
chain name
ct
chain-type
string
chain type. plain, live, old, new, legal, tooold
code
code
string
obsolete, please to use chain
currency
currency
string
currency
deposit-desc
deposit-desc
string
deposit desc
de
deposit-enable
boolean
deposit enable
dma
deposit-min-amount
string
deposit-min-amount, if the amount is less than this amount will be: 1. The small amount will exceed the deposit-min-amount and then be credited 2. The small amount will not be accumulated and will never be credited to the account
deposit-tips-desc
deposit-tips-desc
string
deposit tips desc
dn
display-name
string
display name, general be upper
fc
fast-confirms
integer
fast-confirms, when height of the exchange node to that chain tail is greater than this number, the deposit and withdrawal will be not settled to the user account, this deposit order is regarded as an unsafe deposit, and the available amount in the withdrawal and account transfer must be excluded that amount from this order.
ft
fee-type
string
fee type
default
is-default
integer
is default
replace-chain-info-desc
replace-chain-info-desc
string
replace chain info desc
replace-chain-notification-desc
replace-chain-notification-desc
string
replace chain notification desc
replace-chain-popup-desc
replace-chain-popup-desc
string
replace chain popup desc
sc
safe-confirms
integer
safe confirms, When the distance between the height of the current exchange's chain node and the chain tail is greater than this number, the asset management DW will mark this order as a safe deposit, and it will be regarded as the available amount when withdrawing and transferring funds.
sda
suspend-deposit-announcement
string
suspend deposit announcement
suspend-deposit-desc
suspend-deposit-desc
string
suspend deposit desc
swa
suspend-withdraw-announcement
string
suspend withdraw announcement
suspend-withdraw-desc
suspend-withdraw-desc
string
suspend withdraw desc
v
visible
boolean
visible
withdraw-desc
withdraw-desc
string
withdraw desc
we
withdraw-enable
boolean
withdraw enable
wma
withdraw-min-amount
string
withdraw min amount, refused to withdraw if less than this amount
wp
withdraw-precision
integer
withdraw precision, refused to withdraw if greater than this amount
fn
full-name
string
withdraw-tips-desc
withdraw-tips-desc
string
withdraw tips desc
suspend-visible-desc
suspend-visible-desc
string
suspend visible desc
</data>
ts
ts
String
timestamp of incremental data
full
full
int
full data flag: 0 for no and 1 for yes
err-code
err-code
string
error code(returned when the interface reports an error)
err-msg
err-msg
string
error msg(returned when the interface reports an error)
APIv2 - Currency & Chains
API user could query static reference information for each currency, as well as its corresponding chain(s). (Public Endpoint)
All trading symbol supported, e.g. btcusdt, bccbtcn (to retrieve candlesticks for ETP NAV, symbol = ETP trading symbol + suffix 'nav',for example: btc3lusdtnav)
The valuation according to the certain fiat currency
timestamp
true
long
Return time
</data>
Asset Transfer
API Key Permission:Trade
This endpoint allows parent user and sub user to transfer asset between accounts.
Features now supported for both parent user and sub user include:
1.transfer asset between spot account and individual isolated-margin account;
2.transfer asset between individual isolated-margin accounts;
Features now supported for parent user include:
1.Transfer asset between parent user's spot account and sub user's spot account;
2.Transfer asset from sub user’s spot account to another sub user’s spot account that is under the same parent user;
Features now supported for sub user include:
1.Transfer asset from authorized sub user’s spot account to another sub user’s spot account that is under the same parent user.The authorization endpoint is POST /v2/sub-user/transferability.
2.Transfer asset from sub user’s spot account to parent user’s spot account;
Other transfer functions will be gradually launched later, please take note on API announcement in near future.
The start time of the query window (unix time in millisecond). Searching based on transact-time. The maximum size of the query window is 1 hour. The query window can be shifted within 30 days.
((end-time) – 1hour)
[((end-time) – 1hour), (end-time)]
end-time
false
long
The end time of the query window (unix time in millisecond). Searching based on transact-time. The maximum size of the query window is 1 hour. The query window can be shifted within 30 days.
current-time
[(current-time) – 29days,(current-time)]
sort
false
string
Sorting order
asc
asc or desc
size
false
int
Maximum number of items in each response
100
[1-500]
from-id
false
long
First record ID in this query (only valid for next page querying, see Note 2)
The above command returns JSON structured like this:
Amount change (positive value if income, negative value if outcome)
transact-type
string
Amount change types
avail-balance
string
Available balance
acct-balance
string
Account balance
transact-time
long
Transaction time (database time)
record-id
long
Unique record ID in the database
</data>
next-id
long
First record ID in next page (only valid if exceeded page size, see Note 2)
Note 1:
If ‘transact-type’ is shown as ‘rebate’, it implicates a paid maker rebate.
A paid maker rebate could possibly include rebate from multiple trades.
Note 2:
Only when the number of items within the query window (between "start-time" and "end-time") exceeded the page limitation (defined by "size"), Huobi server returns "next-id". Once received "next-id", API user should –
1) Be aware of that, some items within the query window were not returned due to the page size limitation.
2) In order to get these items from Huobi server, adopt the "next-id" as "from-id" and submit another request, with other request parameters no change.
3) As database record ID, "next-id" and "from-id" are for recurring query purpose and the ID itself does not have any business implication.
Note 3:
Change type contains a detailed list of account types:
This endpoint returns the amount changes of specified user's account.
Phase 1 release only supports historical assets transfer querying ("transactType" = "transfer").
The maximum query window size set by "startTime" & "endTime" is 10-day, which mean a maximum of 10-day records are queriable per request.
The query window can be within the last 180 days, which means, by adjusting "startTime" & "endTime" accordingly, the records in last 180 days are queriable.
First record ID in next page (only valid if exceeded page size. please refer to note 3.)
Note 3:
Only when the number of items within the query window (between "startTime" and "endTime") exceeded the page limitation (defined by "limit"), Huobi server returns "nextId". Once received "nextId", API user should –
1) Be aware of that, some items within the query window were not returned due to the page size limitation.
2) In order to get these items from Huobi server, adopt the "nextId" as "fromId" and submit another request, with other request parameters no change.
3) As database record ID, "nextId" and "fromId" are for recurring query purpose and the ID itself does not have any business implication.
Transfer Fund Between Spot Account and Future Contract Account
API Key Permission:Trade
This endpoint allows a user to transfer fund between spot accounts and futrue contract accounts.
Transferring from a spot account to a contract account, the type is pro-to-futures; transferring from a contract account to a spot account, the type is futures-to-pro
error code. Please refer to the err-code list below for details
err-msg
string
error message. Please refer to the err-code and err-msg list below for details
error code
err-code
err-msg
Comments
base-msg
Other errors, please refer to err-msg list below for details.
base-currency-error
The currency is invalid
frequent-invoke
the operation is too frequent. Please try again later
Rate limit is 10/min
banned-by-blacklist
Blacklist restriction
dw-insufficient-balance
Insufficient balance. You can only transfer {0} at most.
Insufficient balance of spot account
dw-account-transfer-unavailable
account transfer unavailable
This API endpoint is not available.
dw-account-transfer-error
account transfer error
dw-account-transfer-failed
Failed to transfer. Please try again later.
dw-account-transfer-failed-account-abnormality
Account abnormality, failed to transfer。Please try again later.
error message for 'base-msg' err-code
err-code
err-msg
Comments
base-msg
Unable to transfer in currently. Please contact customer service.
base-msg
Unable to transfer out currently. Please contact customer service.
base-msg
Abnormal contracts status. Can’t transfer.
base-msg
Sub-account doesn't own the permissions to transfer in. Please contact customer service.
base-msg
Sub-account doesn't own the permissions to transfer out. Please contact customer service.
base-msg
The sub-account does not have transfer permissions. Please login main account to authorize.
base-msg
Insufficient amount available.
Insufficient amount of Future Contract Account
base-msg
The single transfer-out amount must be no less than {0}{1}.
base-msg
The single transfer-out amount must be no more than {0}{1}.
base-msg
The single transfer-in amount must be no less than {0}{1}.
base-msg
The single transfer-in amount must be no more than {0}{1}.
base-msg
Your accumulative transfer-out amount is over the daily maximum, {0}{1}. You can't transfer out for the time being.
base-msg
Your accumulative transfer-in amount is over the daily maximum, {0}{1}. You can't transfer in for the time being.
base-msg
Your accumulative net transfer-out amount is over the daily maximum, {0}{1}. You can't transfer out for the time being.
base-msg
Your accumulative net transfer-in amount is over the daily maximum, {0}{1}. You can't transfer in for the time being.
base-msg
The platform's accumulative transfer-out amount is over the daily maximum. You can't transfer out for the time being.
base-msg
The platform's accumulative transfer-in amount is over the daily maximum. You can't transfer in for the time being.
base-msg
The platform's accumulative net transfer-out amount is over the daily maximum. You can't transfer out for the time being.
base-msg
The platform's accumulative net transfer-in amount is over the daily maximum. You can't transfer in for the time being.
base-msg
Transfer failed. Please try again later or contact customer service.
base-msg
Abnormal service, transfer failed. Please try again later.
base-msg
You don’t have access permission as you have not opened contracts trading.
base-msg
This contract type doesn't exist.
There is no corresponding Future Contract for the currency defined in the request.
Get Point Balance
Via this endpoint, user should be able to query ‘termless’ point’s balance, as well as ‘terminable’ point’s balance including its group IDs and individual expiration date.
Via this endpoint, user could only query point’s balance instead of any other cryptocurrency’s balance.
Via this endpoint, parent user could query either parent user’s point balance, or sub user’s point balance.
User can only exchange Huobi point via Huobi official web or app.
API Key Permission:Read
Rate Limit: 2times/s
Callable by sub user
HTTP Request
GET /v2/point/account
Request Parameters
Field
Data Type
Required
Description
subUid
string
FALSE
Sub user’s UID (only valid for scenario of parent user querying sub user’s point balance)
Account status (working, lock, fl-sys, fl-mgt, fl-end, fl-negative)
acctBalance
string
TRUE
Account balance
<groupIds>
object
TRUE
Group ID list
groupId
long
TRUE
Group ID
expiryDate
long
TRUE
Expiration date (unix time in millisecond)
remainAmt
string
TRUE
Remaining amount
</groupIds>
</data>
Note:
Group ID is the transaction ID generated while parent user exchanging the ‘terminable’ points.
Group ID of ‘termless’ points is 0.
Expiration date of ‘termless’ points is null.
Point Transfer
Via this endpoint, parent user should be able to transfer points between parent user and sub user, sub user should be able to transfer point to parent user. Both ‘termless’ and ‘terminable’ points are transferrable.
Via this endpoint, user could only transfer ‘termless’ and ‘terminable’ points instead of any other cryptocurrencies.
Parent user could transfer point between parent user and sub user in two ways.
Sub user could only transfer point from sub user to parent user.
Before parent user trying to transfer the terminable points back from sub user's account, parent user should query the sub user's point balance first in order to get the corresponding groupId.
API Key Permission:Trade
Rate Limit: 2times/s
Callable by sub user
HTTP Request
POST /v2/point/transfer
Request Parameters
Field
Data Type
Required
Description
fromUid
string
TRUE
Transferer’s UID
toUid
string
TRUE
Transferee’s UID
groupId
long
TRUE
Group ID
amount
string
TRUE
Transfer amount (precision: maximum 8 decimal places)
Note:
- If groupId=0, it implicates an ‘termless’ point transfer request.
Below is the error code, error message and description returned by Account APIs.
Error Code
Error Message
Description
500
system error
Server internal error
1002
forbidden
Operation is forbidden, such as the account Id and UID doesn't match
2002
"invalid field value in currency"
Parameter currency is invalid
2002
"invalid field value in transactTypes"
Parameter transactTypes is invalid (should be transfer)
2002
"invalid field value in sort"
Parameter sort is invalid (should be 'asc' or 'desc')
2002
"value in fromId is not found in record"
Value fromId doesn't exist
2002
"invalid field value in accountId"
Parameter accountId is invalid (should not be empty)
2002
"value in startTime exceeded valid range"
Value startTime is later than current time or earlier than 180 days ago
2002
"value in endTime exceeded valid range")
Value endTime is earlier than startTime, or 10 days later than startTime
Wallet (Deposit and Withdraw)
Introduction
Wallet APIs provide query functionality for deposit address, withdraw address, withdraw quota, deposit and withdraw history, and also provide withdraw and cancel-withdraw functionality.
Query Deposit Address
Parent user and sub user could query deposit address of corresponding chain, for a specific crypto currency (except IOTA).
API Key Permission:Read
Rate Limit (NEW): 20times/2s
HTTP Request
GET /v2/account/deposit/address
Request Parameters
Field Name
Data Type
Required
Default Value
Description
currency
string
true
N/A
Crypto currency,refer to GET /v1/common/currencys
The above command returns JSON structured like this:
First record ID in next page (only valid if exceeded page size)
Note:
Only when the number of items within the query window exceeded the page limitation (defined by "limit"), Huobi server returns "nextId". Once received "nextId", API user should –
1) Be aware of that, some items within the query window were not returned due to the page size limitation.
2) In order to get these items from Huobi server, adopt the "nextId" as "fromId" and submit another request, with other request parameters no change.
3) "nextId" and "fromId" are for recurring query purpose and the ID itself does not have any business implication.
Create a Withdraw Request
API Key Permission:Withdraw
Rate Limit (NEW): 20times/2s
Parent user creates a withdraw request from spot account to an external address (exists in your withdraw address list), which doesn't require two-factor-authentication.
>=0,Please check whether the handling fee is too high through the handling fee interface before withdrawal to avoid losses, and cancel the operation through the "Cancel the Withdrawal" interface before successful withdrawal
chain
string
false
NA
Refer toGET /v2/reference/currencies.Set as "usdt" to withdraw USDT to OMNI, set as "trc20usdt" to withdraw USDT to TRX
addr-tag
string
false
NA
A tag specified for this address
client-order-id
string
false
NA
client order id
Note
If the client-order-id(the id of withdrawal order) is not empty, idempotent verification will be performed. For the withdrawal request with the same client-order-id, the previously submitted successful withdrawal order id will be directly returned
The above command returns JSON structured like this:
{"data":1000}
Response Content
Field
Data Type
Description
data
integer
Transfer id
Query withdrawal order by client order id
API Key Permission: Read
HTTP Request
GET /v1/query/withdraw/client-order-id
Request Parameters
Parameter
Required
Data Type
Description
Value Range
clientOrderId
true
string
client order id (max 32 char)
Note
query the information of withdrawal order, which submitted by api interface. (it will return the information of withdrawal order which submitted with client order id. in the other it will return the null that withdrawal order submitted without with client order id)
API Key Permission:Withdraw
Rate Limit (NEW): 20times/2s
Parent user cancels a previously created withdrawal request by its transfer id.
HTTP Request
POST /v1/dw/withdraw-virtual/{withdraw-id}/cancel
'withdraw-id': the id returned when previously created a withdraw request
Request Parameters
The above command returns JSON structured like this:
{"data":700}
Response Content
Parameter
Data Type
Description
data
integer
Withdraw cancel id
Search for Existed Withdraws and Deposits
API Key Permission:Read
Rate Limit (NEW): 20times/2s
Parent user and sub user search for all existed withdraws and deposits and return their latest status.
HTTP Request
GET /v1/query/deposit-withdraw
Request Parameters
Parameter
Data Type
Required
Description
Value Range
Default Value
currency
string
false
The crypto currency to withdraw
NA
When currency is not specified, the response would include the records of ALL currencies.
type
string
true
Define transfer type to search
deposit, withdraw, sub user can only use deposit
from
string
false
The transfer id to begin search
1 ~ latest record ID
When 'from' is not specified, the default value would be 1 if 'direct' is 'prev' with the response in ascending order, the default value would be the ID of latest record if 'direct' is 'next' with the response in descending order.
size
string
false
The number of items to return
[1-500]
100
direct
string
false
the order of response
'prev' (ascending), 'next' (descending)
'prev'
The above command returns JSON structured like this:
Define transfer type to search, possible values: [deposit, withdraw] Sub-user can only put "deposit"
currency
string
The crypto currency to withdraw
tx-hash
string
The on-chain transaction hash. If this is a "fast withdraw", then it is not on-chain transfer, and this value is empty.
chain
string
Block chain name
amount
float
The number of crypto asset transfered in its minimum unit
address
string
The deposit or withdraw target address
address-tag
string
The user defined address tag
fee
float
Withdrawal fee
state
string
The state of this transfer (see below for details)
error-code
string
Error code for withdrawal failure, only returned when the type is "withdraw" and the state is "reject", "wallet-reject" and "failed".
error-msg
string
Error description of withdrawal failure, only returned when the type is "withdraw" and the state is "reject", "wallet-reject" and "failed".
created-at
integer
The timestamp in milliseconds for the transfer creation
updated-at
integer
The timestamp in milliseconds for the transfer's latest update
</data>
List of possible deposit state
State
Description
unknown
On-chain transfer has not been received
confirming
On-chain transfer waits for first confirmation
confirmed
On-chain transfer confirmed for at least one block, user is able to transfer and trade
safe
Multiple on-chain confirmed, user is able to withdraw
orphan
On-chain transfer confirmed but currently in an orphan branch
List of possible withdraw state
State
Description
verifying
Awaiting verification
failed
verification failed
submitted
Withdraw request submitted successfully
reexamine
Under examination for withdraw validation
canceled
Withdraw canceled by user
pass
Withdraw validation passed
reject
Withdraw validation rejected
pre-transfer
Withdraw is about to be released
wallet-transfer
On-chain transfer initiated
wallet-reject
Transfer rejected by chain
confirmed
On-chain transfer completed with one confirmation
confirm-error
On-chain transfer faied to get confirmation
repealed
Withdraw terminated by system
Error Code
Below is the response code, message and description returned by Wallet APIs.
Response Code
Message
Description
200
success
Successful
500
error
Server internal error
1002
unauthorized
User is unautherized
1003
invalid signature
API signature is wrong
2002
invalid field value in "field name"
Parameter is invalid
2003
missing Required field "field name"
Parameter is missing
FAQ
Q1:Why the API returns error 'api-not-support-temp-addr' when withdrawing?
A:User has to include the address into the pre-defined address table on Huobi official website before withdrawing through API.
Q2:Why the API returns error 'Invaild-Address' when withdraw USDT?
A:USDT locates on multiple chains, therefore the withdraw order should clearly specify which chain the withdrawal goes to. See the table below:
Chain
Field Value
ERC20 (default)
usdterc20
OMNI
usdt
TRX
trc20usdt
If leaving the field empty, default target chain is ERC20, or you can explicitly set the chain to usdterc20.
If the target chain is OMNI or TRX, the field value should be usdt or trc20usdt.
The full chain name list for all currencies can be retrieved from endpoint GET /v2/reference/currencies.
Q3:How to specify 'fee' when creating a withdraw request?
A:Please refer to the response from endpoint GET /v2/reference/currencies, where the field withdrawFeeType defining different fee types below:
transactFeeWithdraw : The withdraw fee per request (only applicable when withdrawFeeType=fixed).
minTransactFeeWithdraw : The minimum withdraw fee per request (only applicable when withdrawFeeType=circulated or ratio).
maxTransactFeeWithdraw : The maximum withdraw fee per request (only applicable when withdrawFeeType=circulated or ratio).
transactFeeRateWithdraw : The withdraw fee rate per request (only applicable when withdrawFeeType=ratio).
Q4:How to query my withdraw quota?
A:Please refer to the response from endpoint GET /v2/account/withdraw/quota, where quota per request, daily quota, annual quota, overall quota are available.
Note: If you need to withdraw large amount which breaking the limitation, you can contact customer support for assistance.
Sub user management
Introduction
Sub user management APIs provide sub user account management (creation, query, permission, transfer), sub user API key management (creation, update, query, deletion), sub user address (deposit, withdraw) query and balance query.
Set a deduction for parent and sub user
This interface is to set the deduction fee for parent and sub user (HT or point ).
API Key Permission:Trade
HTTP Request
POST /v2/sub-user/deduct-mode
Request Parameters
Parameter
Required
Data Type
Description
Default
Value Range
subUids
true
long
Sub user's UID list (maximum 50 UIDs, separated by comma)
Sub user name, an important identifier of the sub user's identity, requires unique within the huobi platform
NA
The combination of 6 to 20 letters and numbers, or only letters. Letter is not case sensitive. The first character has to be a letter.
note
false
string
Sub user note, no unique requirements
NA
Up to 20 characters, unlimited character types
</userList>
Response:
{"code":200,"data":[{"userName":"test123","note":"huobi","uid":123},{"userName":"test456","note":"huobi two","errCode":"2002","errMessage":"value in user name duplicated with existing record"}]}
Response Content
Parameter
Required
Data Type
Description
Value Range
code
true
int
Status code
message
false
string
Error message (if any)
<data>
true
object
userName
true
string
Sub user name
note
false
string
Sub user note (only valid for sub-users with note))
uid
false
long
Sub user UID (only valid for successfully created sub users)
errCode
false
string
Error code for creation failure (only valid for sub users that failed to create)
errMessage
false
string
Cause of creation failure error (only valid for sub users that failed to create)
</data>
Get Sub User's List
Via this endpoint parent user is able to query a full list of sub user's UID as well as their status.
API Key Permission: Read
HTTP Request
GET /v2/sub-user/user-list
Request Parameter
Field
Required
Data Type
Description
Default Value
Possible Value
fromId
FALSE
long
First record ID in next page (only valid if exceeded page size)
Parent user is able to set tradable market for a batch of sub users through this endpoint.
By default, sub user’s trading permission in spot market is activated.
HTTP Request
POST /v2/sub-user/tradable-market
Request Parameters
Parameter
Required
Data Type
Length
Description
Possible Value
subUids
true
string
-
Sub user's UID list (maximum 50 UIDs, separated by comma)
Error code in case of rejection (only valid when the requested UID being rejected)
errMessage
false
string
-
Error message in case of rejection (only valid when the requested UID being rejected)
</data>
Set Asset Transfer Permission for Sub Users
API Key Permission: Trade
Parent user is able to set asset transfer permission for a batch of sub users.
By default, the asset transfer from sub user’s spot account to parent user’s spot account is allowed.
HTTP Request
POST /v2/sub-user/transferability
Request Parameters
Parameter
Required
Data Type
Length
Description
Possible Value
subUids
true
string
-
Sub user's UID list (maximum 50 UIDs, separated by comma)
-
accountType
false
string
-
Account type (if not available, adopt default value 'spot')
spot
transferrable
true
bool
-
Transferrablility
true,false
Response:
{"code":200,"data":[{"accountType":"spot","transferrable":true,"subUid":245686628},{"accountType":"spot","subUid":2215699261,"errCode":2002,"errMessage":"invalid field value in `2,215,699,261`"}],"ok":true}
Response Content
Parameter
Required
Data Type
Length
Description
Possible Value
code
true
int
-
Status code
message
false
string
-
Error message (if any)
<data>
true
object
subUid
true
long
-
Sub user's UID
-
accountType
true
string
-
Account type
spot
transferrable
true
bool
-
Transferrability
true,false
errCode
false
int
-
Error code in case of rejection (only valid when the requested UID being rejected)
errMessage
false
string
-
Error code in case of rejection (only valid when the requested UID being rejected)
</data>
Get Sub User's Account List
Via this endpoint parent user is able to query account list of sub user by specifying a UID.
Transfer permission (only valid for accountType=spot)
true, false
<accountIds>
FALSE
object
accountId
TRUE
string
Account ID
subType
FALSE
string
Account sub type (only valid for accountType=isolated-margin)
accountStatus
TRUE
string
Account status
normal, locked
</accountIds>
</list>
</data>
Sub user API key creation
This endpoint is used by the parent user to create the API key of the sub user
API Key Permission:Trade
HTTP Request
POST /v2/sub-user/api-key-generation
Request Parameters
Parameter
Required
Data Type
Description
Default
Value Range
otpToken
false
string
Google verification code of the parent user, the parent user must be bound to Google Authenticator for verification on the web
NA
6 characters, pure numbers
subUid
true
long
Sub user UID
NA
note
true
string
API key note
NA
Up to 255 characters with any font
permission
true
string
API key permissions
NA
Valid value: readOnly, trade; multiple inputs are allowed, separated by comma, i.e. readOnly, trade; readOnly is required permission for any API key, while trade permission is optional.
ipAddresses
false
string
The IPv4/IPv6 host address or IPv4 network address bound to the API key
NA
At most 20 IPv4/IPv6 host address(es) and/or IPv4 network address(es) can bind with one API key, separated by comma. For example: 202.106.196.115, 202.106.96.0/24. An API key not linked with an IP address but has trading or withdrawal permissions will be automatically deactivated after 90 days of inactivity.
This endpoint is used by the parent user to modify the API key of the sub user
API Key Permission:Trade
HTTP Request
POST /v2/sub-user/api-key-modification
Request Parameters
Parameter
Required
Data Type
Description
Default
Value Range
subUid
true
long
sub user uid
NA
accessKey
true
string
Access key for sub user API key
NA
note
false
string
API key note for sub user API key
NA
Up to 255 characters
permission
false
string
API key permission for sub user API key
NA
Valid value: readOnly, trade; multiple inputs are allowed, separated by comma, i.e. readOnly, trade; readOnly is required permission for any API key, while trade permission is optional.
ipAddresses
false
string
At most 20 IPv4/IPv6 host address(es) and/or IPv4 network address(es) can bind with one API key, separated by comma. For example: 202.106.196.115, 202.106.96.0/24. An API key not linked with an IP address but has trading or withdrawal permissions will be automatically deactivated after 90 days of inactivity.
Note 2:
endTime valid range: Unlimited
endTime default value: current time
Note 3:
Only when the number of items within the query window (between "startTime" and "endTime") exceeded the page limitation (defined by "limit"), Huobi server returns "nextId". Once received "nextId", API user should –
1) Be aware of that, some items within the query window were not returned due to the page size limitation.
2) In order to get these items from Huobi server, adopt the "nextId" as "fromId" and submit another request, with other request parameters no change.
3) "nextId" and "fromId" are for recurring query purpose and the ID itself does not have any business implication.
The above command returns JSON structured like this:
The type of this account: spot, margin, otc, point,super-margin
<list>
TRUE
object
currency
TRUE
string
The currency of this balance
type
TRUE
string
The balance type: trade, frozen, loan, interest, lock, bank
balance
TRUE
string
The balance in the main currency unit
</list>
symbol
TRUE
string
</data>
Error Code
Below is the error code, error message and description returned by Sub user management APIs
Error Code
Error Message
Description
1002
forbidden
Operation is forbidden, such as sub user creation is not allowed for current user
1003
unauthorized
Signature is wrong
2002
invalid field value
Parameter is invalid
2014
number of sub account in the request exceeded valid range
number of sub account exceeded
2014
number of api key in the request exceeded valid range
number of API Key exceeded
2016
invalid request while value specified in sub user states
lock or unlock failure
Trading
Introduction
Trading APIs provide trading related functionality, including placing order, canceling order, order history query, trading history query, transaction fee query.
Below is the glossary of trading related field:
order type: The order type is consist of trade direction and behavior type: [direction]-[type]
direction:
buy
sell
type:
market : The price is not required in order creation request, you only need to specify either volume or amount. The matching and trade will happen automatically according to the request.
limit: Both of the price and amount should be specified in order creation request.
limit-maker: The price is specified in order creation request as market maker. It will not be matched in the matching queue.
ioc: ioc stands for "immediately or cancel", it means the order will be canceled if it couldn't be matched. If the order is partially traded, the remaining part will be canceled.
limit-fok: fok stands for "fill or kill", it means the order will be cancelled if it couldn't be fully matched. Even if the order can be partially filled, the entire order will be cancelled.
market-grid: Grid trading market order (not supported by API)
limit-grid: Grid trading limit order (not supported by API)
stop-limit: The price in order creation request is the trigger price. The order will be put into matching queue only when the market price reaches the trigger price. This type is replaced by conditional order, please use conditional order APIs
order source: the origin of the order
spot-api: API order from spot account
margin-api:API order from margin account
super-margin-api:API order from cross-margin account
c2c-margin-api:API order from c2c account
grid-trading-sys:grid order (not supported by API)
order state:
created: The order is created, and not in the matching queue yet.
submitted: The order is submitted, and already in the matching queue, waiting for deal.
partial-filled: The order is already in the matching queue and partially traded, and is waiting for further matching and trade.
filled: The order is already traded and not in the matching queue any more.
partial-canceled: The order is not in the matching queue any more. The status is transferred from 'partial-filled', the order is partially trade, but remaining is canceled.
canceling: The order is under canceling, but haven't been removed from matching queue yet.
canceled: The order is not in the matching queue any more, and completely canceled. There is no trade associated with this order.
IDs: The frequently used identities are listed below:
order-id: The unique identity for order.
client-order-id: The identity defined by the client. This id is included in order creation request, and will be returned as order-id. For completed orders, clientOrderId will be valid for 2 hours since the order creation (it is still valid for 8 hours concerning other orders). That is to say, if an order has been created for more than 2 hours, clientOrderId can’t be used to query the completed order (It is recommended to check it with orderid). Among them, the status of the completed order includes partially canceled, canceled, and fully executed. The allowed characters are letters (case sensitive), digit, underscore (_) and hyphen (-), no more than 64 chars.
match-id : The identity for order matching.
trade-id : The unique identity for the trade.
Place a New Order
API Key Permission:Trade
Rate Limit (NEW): 100times/2s
This endpoint places a new order and sends to the exchange to be matched.
order size (for buy market order, it's order value)
NA
price
string
false
NA
The order price (not available for market order)
NA
source
string
false
spot-api
When trade with spot use 'spot-api';When trade with isolated margin use 'margin-api'; When trade with cross margin use 'super-margin-api';When trade with c2c-margin use 'c2c-margin-api';
api, margin-api,super-margin-api,c2c-margin-api
client-order-id
string
false
NA
Client order ID (maximum 64-character length, to be unique within 8 hours)
self-match-prevent
int
false
0
self match prevent. 0: no, means allowing self-trading; 1: yes, means not allowing self-trading
stop-price
string
false
NA
Trigger price of stop limit order
operator
string
false
NA
operation charactor of stop price
gte – greater than and equal (>=), lte – less than and equal (<=)
The above command returns JSON structured like this:
{"status":"ok","data":"356501383558845"}
Response Content
If client order ID duplicates with a previous order (within 8 hours), the endpoint reverts error message invalid.client.order.id.
buy-limit-maker
If the order price is greater than or equal to the lowest selling price in the market, the order will be rejected.
If the order price is less than the lowest selling price in the market, the order will be accepted.
sell-limit-maker
If the order price is less than or equal to the highest buy price in the market, the order will be rejected.
If the order price is greater than the highest buy price in the market, the order will be accepted.
Place a Batch of Orders
API Key Permission:Trade
Rate Limit (NEW): 50times/2s
The account id, refer to GET /v1/account/accounts. Use 'spot' account-id for spot trading, use 'margin' account-id for isolated margin trading, use ‘super-margin’ account-id for cross margin trading. use borrow account id for c2c margin trading
symbol
string
true
NA
The trading symbol, i.e. btcusdt, ethbtc...(Refer to GET /v1/common/symbols)
type
string
true
NA
The type of order, including 'buy-market', 'sell-market', 'buy-limit', 'sell-limit', 'buy-ioc', 'sell-ioc', 'buy-limit-maker', 'sell-limit-maker' (refer to detail below), 'buy-stop-limit', 'sell-stop-limit', buy-limit-fok, sell-limit-fok, buy-stop-limit-fok, sell-stop-limit-fok.
amount
string
true
NA
The order size (for buy market order, it's order value)
price
string
false
NA
The order price (not available for market order)
source
string
false
spot-api
When trade with spot use 'spot-api';When trade with margin use 'margin-api'; When trade with super-margin use 'super-margin-api';When trade with c2c-margin use 'c2c-margin-api'
client-order-id
string
false
NA
Client order ID (maximum 64-character length)
self-match-prevent
int
false
0
self match prevent. 0: no, means allowing self-trading; 1: yes, means not allowing self-trading
stop-price
string
false
NA
Trigger price of stop limit order
operator}]
string
false
NA
Operation character of stop price, use 'gte' for greater than and equal (>=), use 'lte' for less than and equal (<=)
buy-limit-maker
If the order price is greater than or equal to the lowest selling price in the market, the order will be rejected.
If the order price is less than the lowest selling price in the market, the order will be accepted.
sell-limit-maker
If the order price is less than or equal to the highest buy price in the market, the order will be rejected.
If the order price is greater than the highest buy price in the market, the order will be accepted.
Response:
{"status":"ok","data":[{"order-id":361560582529749,"client-order-id":"2345"},{"client-order-id":"23456","err-code":"order-value-min-error","err-msg":"Order total cannot be lower than: 5 USDT"}]}
Response Content
Field
Data Type
Description
status
string
status
<data>
object
order-id
long
The order id
client-order-id
string
The client order id (if available)
err-code
string
The error code (only for rejected order)
err-msg
string
The error message (only for rejected order)
</data>
If client order ID duplicates with a previous order , the endpoint responds that previous order's Id and client order ID.
Submit Cancel for an Order
API Key Permission:Trade
Rate Limit (NEW): 100times/2s
This endpoint submits a request to cancel an order.
HTTP Request
POST /v1/order/orders/{order-id}/submitcancel
'order-id': the previously returned order id when order was created
Request Parameters
Parameter
Data Type
Required
Default
Description
order-id
string
true
NA
order id which needs to be filled in the path
symbol
string
false
NA
symbol which needs to be filled in the URL
The above command returns JSON structured like this:
{"status":"ok","data":"356501495694025"}
Response Content
Error Code
Response:
{"status":"error","err-code":"order-orderstate-error","err-msg":"Incorrect order state","data":null,"order-state":7//currentorderstate}
The possible values of "order-state" includes -
order-state
Description
-1
order was already closed in the long past (order state = cancelled, partially-cancelled, filled, partially-filled)
1
created
3
submitted
4
partial-filled
5
partially-cancelled
6
filled
7
cancelled
10
cancelling
Submit Cancel for an Order (based on client order ID)
API Key Permission:Trade
Rate Limit (NEW): 100times/2s
This endpoint submit a request to cancel an order based on client-order-id .
HTTP Request
POST /v1/order/orders/submitCancelClientOrder
{"client-order-id":"a0001"}
Request Parameters
Parameter
Data Type
Required
Default
Description
client-order-id
string
true
NA
Client order ID, it must exist within 8 hours, otherwise it is not allowed to use when placing a new order
The above command returns JSON structured like this:
{"status":"ok","data":10}
Response Content
Field
Data Type
Description
data
int
Cancellation status code
Status Code
Description
-1
order was already closed in the long past (order state = cancelled, partially-cancelled, filled, partially-filled)
0
client-order-id not found
1
created
3
submitted
4
partial-filled
5
partially-cancelled
6
filled
7
cancelled
10
cancelling
Get All Open Orders
API Key Permission:Read
Rate Limit (NEW): 50times/2s
This endpoint returns all open orders which have not been filled completely.
Client order id, can be returned from all open orders (if specified).
symbol
string
The trading symbol to trade, e.g. btcusdt, bccbtc
price
string
The limit price of limit order
created-at
long
The timestamp in milliseconds when the order was created
type
string
All possible order type (refer to introduction in this section)
filled-amount
string
The amount which has been filled
filled-cash-amount
string
The filled total in quote currency
filled-fees
string
Transaction fee (Accurate fees refer to matchresults endpoint)
source
string
The source where the order was triggered, possible values: sys, web, api, app
state
string
Order status, valid values: created, submitted, partial-filled
stop-price
string
false
operator
string
false
</data>
Submit Cancel for Multiple Orders by Criteria
API Key Permission:Trade
Rate Limit (NEW): 50times/2s
This endpoint submit cancellation for multiple orders (not exceeding 100 orders per request) at once with given criteria.
This endpoint only submit the cancellation request, the actual cancellation result will need to be confirmed by other endpoints
like order status, matchresult, etc.
the next order id that can be cancelled, -1 indicates no open orders
</data>
Submit Cancel for Multiple Orders by IDs
API Key Permission:Trade
Rate Limit (NEW): 50times/2s
This endpoint submit cancellation for multiple orders at once with given ids. It is suggested to use order-ids instead of
client-order-ids, so that the cancellation is faster, more accurate and more stable.
HTTP Request
POST /v1/order/orders/batchcancel
{"client-order-ids":["12345","123456"]}
Request Parameters
Parameter
Data Type
Required
Description
Value Range
order-ids
string[]
false
The order ids to cancel (Either order-ids or client-order-ids can be filled in one batch request). It is suggest to use order-ids rather than client-order-ids, the former is faster and more stable
No more than 50 orders per request
client-order-ids
string[]
false
The client order ids to cancel (Either order-ids or client-order-ids can be filled in one batch request), it must exist already, otherwise it is not allowed to use when placing a new order
No more than 50 orders per request
The above command returns JSON structured like this:
{"status":"ok","data":{"success":["12345"],"failed":[{"err-msg":"Incorrect order state","order-state":7,"order-id":"357631450723117","err-code":"order-orderstate-error","client-order-id":"123456"}]}}
Response Content
Field
Data Type
Description
status
string
状态
<data>
object
success
array
Cancelled order list (Can be order ID list or client order list, based on the request)
<failed>
object
Failed order list (Can be order ID list or client order list, based on the request)
order-id
string
The order id (if the request is based on order-ids)
client-order-id
string
The client order id (if the request is based on client-order-ids)
err-code
string
The error code (only applicable for rejected order)
err-msg
string
The error message (only applicable for rejected order)
order-state
string
Current order state (if available)
</failed>
</data>
The possible values of "order-state" includes -
order-state
Description
-1
order was already closed in the long past (order state = canceled, partial-canceled, filled, partial-filled)
1
created
3
submitted
4
partial-filled
5
partial-canceled
6
filled
7
canceled
10
cancelling
Dead man’s switch
API Key Permission:Trade
The Dead man’s switch protects the user’s assets when the connection to the exchange is lost due to network or system errors.
Turn on/off the Dead man’s switch. If the Dead man’s switch is turned on and the API call isn’t sent twice within the set time, the platform will cancel all of your orders on the spot market(a maximum cancellation of 500 orders).
HTTP Request
POST /v2/algo-orders/cancel-all-after
Request:
{"timeout":"10"}
Request Parameters
Parameter
Data Type
Required
Default
Description
Value Range
timeout
true
int
time out duration (unit:second); see notes for details
Client order id ("client-order-id" (if specified) can be returned from all open orders. "client-order-id" (if specified) can be returned only from closed orders (state <> canceled) created within 7 days. "client-order-id" (if specified) can be returned only from closed orders (state = canceled) created within 8 hours.)
symbol
string
The trading symbol to trade, e.g. btcusdt, bccbtc
account-id
string
The account id which this order belongs to
amount
string
The amount of base currency in this order
price
string
The limit price of limit order
created-at
int
The timestamp in milliseconds when the order was created
finished-at
int
The timestamp in milliseconds when the order was changed to a final state. This is not the time the order is matched.
canceled-at
int
The timestamp in milliseconds when the order was canceled, if not canceled then has value of 0
type
string
All possible order type (refer to introduction in this section)
filled-amount
string
The amount which has been filled
filled-cash-amount
string
The filled total in quote currency
filled-fees
string
Transaction fee (Accurate fees refer to matchresults endpoint)
source
string
All possible order source (refer to introduction in this section)
state
string
All possible order state (refer to introduction in this section)
stop-price
string
trigger price of stop limit order
operator
string
operation character of stop price: gte, lte
</data>
Get the Order Detail of an Order (based on client order ID)
API Key Permission:Read
Rate Limit (NEW):50times/2s
This endpoint returns the detail of one order by specified client order id (within 8 hours). The order created via API will no longer be queryable after being cancelled for more than 2 hours. It is suggested to cancel orders via GET /v1/order/orders/{order-id}, which is faster and more stable.
HTTP Request
GET /v1/order/orders/getClientOrder
Request Parameters
Parameter
Data Type
Required
Default
Description
clientOrderId
string
true
NA
Client order ID
The above command returns JSON structured like this:
The timestamp in milliseconds when this record is created (slightly later than trade time)
type
string
All possible order type (refer to introduction in this section)
filled-amount
string
The amount which has been filled
filled-fees
string
Transaction fee (positive value). If maker rebate applicable, revert maker rebate value per trade (negative value).
fee-currency
string
Currency of transaction fee or transaction fee rebate (transaction fee of buy order is based on base currency, transaction fee of sell order is based on quote currency; transaction fee rebate of buy order is based on quote currency, transaction fee rebate of sell order is based on base currency)
source
string
All possible order source (refer to introduction in this section)
role
string
the role in the transaction: taker or maker
filled-points
string
deduction amount (unit: in ht or hbpoint)
fee-deduct-currency
string
deduction type. if blank, the transaction fee is based on original currency; if showing value as "ht", the transaction fee is deducted by HT; if showing value as "hbpoint", the transaction fee is deducted by HB point.
The calculated maker rebate value inside ‘filled-fees’ would not be paid immediately.
Search Past Orders
API Key Permission:Read
Rate Limit (NEW): 50times/2s
This endpoint returns orders based on a specific searching criteria. The order created via API will no longer be queryable after being cancelled for more than 2 hours.
If the user does not fill in the start-time and end-time any parameters, the server will return the historical orders from near to far [now, now - 48 hours].
If the user fills in the start-time but does not fill in the end-time parameter, the server will return the historical order from near to far [start-time + 48 hours, start-time].
If the user does not fill in the start-time but fills in the end-time parameter, the server will return the historical order from near to far [end-time, end-time - 48 hours].
If the user fills in both start-time and end-time parameters, the server will return historical orders from near to far [end-time, start-time].
The maximum range of each query is 48 hours, and the last 180 days data can be queried continuously.
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 2 hours for cancelled order (state = "canceled")
end-time
long
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 2 hours for cancelled order (state = "canceled")
states
string
true
NA
One or more states of order to include in the search, use comma to separate.
filled, partial-canceled, canceled
from
string
false
NA
Search order id to begin with
NA
direct
string
false
both
Search direction when 'from' is used
next, prev
size
integer
false
100
The number of orders to return
[1-100]
The above command returns JSON structured like this:
Client order id ("client-order-id" (if specified) can be returned from all open orders. "client-order-id" (if specified) can be returned only from closed orders (state <> canceled) created within 7 days. only those closed orders (state = canceled) created within 8 hours can be returned.)
account-id
long
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
long
The timestamp in milliseconds when the order was created
canceled-at
long
The timestamp in milliseconds when the order was canceled, or 0 if not canceled
finished-at
long
The timestamp in milliseconds when the order was finished, or 0 if not finished
type
string
All possible order type (refer to introduction in this section)
filled-amount
string
The amount which has been filled
filled-cash-amount
string
The filled total in quote currency
filled-fees
string
Transaction fee (Accurate fees refer to matchresults endpoint)
source
string
All possible order source (refer to introduction in this section)
state
string
filled, partial-canceled, 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
</data>
Error code for invalid start-time/end-time
err-code
scenarios
invalid_interval
Start time is later than end time; the time between start time and end time is greater than 2 days
invalid_start_time
Start time is a future time; or start time is earlier than 180 days ago.
invalid_end_time
end time is a future time; or end time is earlier than 180 days ago.
Search Historical Orders within 48 Hours
API Key Permission:Read
Rate Limit (NEW): 20times/2s
This endpoint returns orders based on a specific searching criteria.
The orders created via API will no longer be queryable after being cancelled for more than 2 hours.
All supported trading symbol, e.g. btcusdt, bccbtc.Refer to GET /v1/common/symbols
start-time
false
long
Start time (included)
The time 48 hours ago
UTC time in millisecond
end-time
false
long
End time (included)
The query time
UTC time in millisecond
direct
false
string
Direction of the query. (Note: If the total number of items in the search result is within the limitation defined in "size", this field does not take effect.)
next
prev, next
size
false
int
Number of items in each response
100
[10-1000]
The above command returns JSON structured like this:
Transaction fee (Accurate fees refer to matchresults endpoint)
finished-at
long
Last trade time
id
long
Order ID
client-order-id
string
Client order id ("client-order-id" (if specified) can be returned only from closed orders (state <> canceled) created within 48 hours, upon order creation time. only those closed orders (state = canceled) created within 8 hours can be returned.)
price
string
Order price
source
string
All possible order source (refer to introduction in this section)
state
string
Order status ( filled, partial-canceled, canceled )
symbol
string
Trading symbol
stop-price
string
trigger price of stop limit order
operator
string
operation character of stop price. e.g. get, lte
type
string
All possible order type (refer to introduction in this section)
</data>
next-time
long
Next query "start-time" (in response of "direct" = prev), Next query "end-time" (in response of "direct" = next). Note: Only when the total number of items in the search result exceeded the limitation defined in "size", this field exists. UTC time in millisecond.
Search Match Results
API Key Permission:Read
Rate Limit (NEW): 20times/2s
This endpoint returns the match results of past and current filled, or partially filled orders based on specific search criteria.
HTTP Request
GET /v1/order/matchresults
Request Parameters
Parameter
Data Type
Required
Default
Description
Value Range
symbol
string
true
N/A
The trading symbol to trade
All supported trading symbol, e.g. btcusdt, bccbtc.Refer to GET /v1/common/symbols
Far point of time of the query window (unix time in millisecond). Searching based on transact-time. The maximum size of the query window is 48 hour. The query window can be shifted within 120 days.
((end-time) – 48hour)
[((end-time) – 48hour), (end-time)]
end-time
false
long
Near point of time of the query window (unix time in millisecond). Searching based on transact-time. The maximum size of the query window is 48 hour. The query window can be shifted within 120 days.
current-time
[(current-time) – 120days,(current-time)]
from
string
false
N/A
Search internal id to begin with
if search next page, then this should be the last id (not trade-id) of last page; if search previous page, then this should be the first id (not trade-id) of last page
direct
string
false
next
Search direction when 'from' is used
next, prev
size
int
false
100
The number of orders to return
[1-500]
The above command returns JSON structured like this:
Record id, non sequential, it can be used in "from" field for next request
symbol
string
The trading symbol to trade, e.g. btcusdt, bccbtc
order-id
long
The order id of this order
match-id
long
The match id of this match
trade-id
long
Unique trade ID
price
string
The limit price of limit order
created-at
long
The timestamp in milliseconds when this record is created
type
string
All possible order type (refer to introduction in this section)
filled-amount
string
The amount which has been filled
filled-fees
string
Transaction fee (positive value). If maker rebate applicable, revert maker rebate value per trade (negative value).
fee-currency
string
Currency of transaction fee or transaction fee rebate (transaction fee of buy order is based on base currency, transaction fee of sell order is based on quote currency; transaction fee rebate of buy order is based on quote currency, transaction fee rebate of sell order is based on base currency)
source
string
All possible order source (refer to introduction in this section)
The calculated maker rebate value inside ‘filled-fees’ would not be paid immediately.
Error code for invalid start-time/end-time
err-code
scenarios
invalid_interval
Start time is later than end time; the time between start time and end time is greater than 2 days
invalid_start_time
Start time is a future time; or start time is earlier than 120 days ago.
invalid_end_time
end t
[Page truncated to keep GeezerVison snappy.]
You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.