Spot Trading (Market Maker)
Market Maker User's Spot Trading API
API Introduction
Access preparation
Trading pairs
A trading pair consists of a base currency and a quote currency. Taking the trading pair BTC/USDT as an example, BTC is the base currency, and USDT is the quote currency.
Apply for API Key
After successful creation, please be sure to remember the following information:
Access Key
API Access KeySecret Key
Key used for signature authentication encryption (visible only during application)
Interface Authentication
Public interfaces can be used to obtain basic information and market data. Public interfaces can be called without authentication.
Private interfaces can be used for trade management and account management. Each private request must be signed and verified using your API Key.
Access URLs
REST API
https://api.hibt0.co/open-api
Signature Authentication
API requests are susceptible to tampering during transmission over the internet. To ensure that the request has not been altered, private interfaces, excluding public interfaces (basic information, market data), must use your API Key for encryption to verify whether parameters or parameter values have changed during transmission. Each API Key needs appropriate permissions to access the corresponding interfaces, and each newly created API Key requires assignment of permissions. Before using an interface, please check the permission type for each interface and confirm that your API Key has the necessary permissions.
What is required for a legitimate request:
Method request address: That is, the access server address https://api.hibt0.co/open-api。
API Access Key (X-ACCESS-KEY) : The Access Key in the API Key you applied for.
Required and Optional Parameters: Each method has a set of required and optional parameters for defining API calls. You can review these parameters and their meanings in the documentation for each method.
Signature: The value calculated by encryption, used to ensure that the signature is valid and has not been tampered with, For the security of your API Key, a parameter signature will expire after 5 minutes.
Signature Required Parameters ** : For interfaces that require signature authentication, the reqTime parameter must be added (the value passed is the latest server time, which can be obtained through the/v1/common/systemTime interface).
Encryption
Standardize the Request for Signature Calculation: Because using HMAC for signature calculation results in completely different outcomes for different content, it's essential to standardize the request before performing signature calculation. The following example illustrates the process using a request to query details for a specific order:
Order Request URL
Sort parameters in ASCII order:
The result obtained by encrypting the sorted request parameters with HMAC SHA256 using secretKey:
Build HTTP request usage
Using X-ACCESS-KEY stores access key information and passes parameters in the header
Using X-Signature stores the generated signature information and passes parameters in the header
Request method
There are currently only two methods available: GET and POST
GET request: All parameters are in the path parameters
POST request: All parameters are sent in form data format in the request body
Response Format
All interfaces are in JSON format. At the top layer of JSON, there are three fields: message, code, and data.
The first two fields represent the request status and information, and the actual business data is in the data field.
Common failure codes
1xxx (access failure class)
2xxx (business failure category)
0
sccuess
1001
Interface request flow limiting
1101
API Key authentication failed
1102
Decryption of the key failed
1103
Access IP is not in the whitelist
2001
The parameter is empty
2002
Time range error
2003
The request time parameter is empty
2004
The request time has expired
2101
Account does not exist
2102
API key does not exist
2103
Trading pair does not exist
2201
User API Key disabled
2202
IP is disabled
9999
Other exception, please refer to the content of the message for details
Spot Interface
Basic Information Interface
Server Time
HTTP Request
GET
/v1/common/systemTime
Authentication: No
Rate Limit: 100 requests per second
Request Parameters
This interface does not accept any parameters.
Response Fields
data
long
Server timestamp
All Trading Pair Information
HTTP Request
GET
/v1/common/symbols
Authentication: No
Rate Limit: 5 requests per second
Request Parameters
This interface does not accept any parameters.
Response Fields
symbol
string
Trading Pair
baseCoinScale
integer
Quote Currency Quantity Precision
coinScale
integer
Base Currency Quantity Precision
priceScale
integer
Price Precision
baseSymbol
string
Quote Currency
coinSymbol
string
Base Currency
minTurnover
decimal
Min Order Execution Amount
minVolume
decimal
Min Order Quantity
maxVolume
decimal
Max Order Quantity
enable
integer
Is Trading Supported (0-No; 1-Yes)"
Market Data Interface
Last Trade Price
This interface provides the current latest transaction price for the trading pair.
HTTP Request
GET
/v1/market/ticker/price
Authentication: No
Rate Limit: 10 requests per second
Request Parameters
symbol
string
true
Trading Pair
Response Fields
tickerPrice
decimal
Last Trade Price
Order Book Data
This interface returns the current depth data for the specified trading pair.
HTTP Request
GET
/v1/market/depth
Authentication: No
Rate Limit: 10 requests per second
Request Parameters
symbol
string
true
Trading Pair
depth
integer
true
Number of Depth Levels Returned
最大 50 档
Response Fields
symbol
string
Trading Pair
bids
array
Bid Depth List
asks
array
Ask Depth List
timestamp
datetime
Time
Account Interface
Account Balance
HTTP Request
POST
/v1/account/balance
Authentication: Yes
Rate Limit: 5 requests per second
Request Parameters
coin
string
false
Currency
Response Fields
coin
string
Currency
balance
decimal
Balance
frozenBalance
decimal
Frozen Balance
isLock
string
Lock Status
Trading Interface
Open Orders
HTTP Request
POST
/v1/trade/openOrder
Authentication: Yes
Rate Limit: 10 requests per second
Request Parameters
symbol
string
true
Trading Pair
direction
integer
true
Direction (0-Buy; 1-Sell)
Response Fields
orderId
string
Order ID
clOrdId
string
Customer Custom Order ID
price
decimal
Order Price
avgPrice
decimal
Average Transaction Price
amount
decimal
Order Amount
tradedAmount
decimal
Filled Quantity
turnover
decimal
Transaction Amount (Filled Quantity * Transaction Price)
symbol
string
Trading Pair
baseSymbol
string
Quote Currency
coinSymbol
string
Base Currency
direction
integer
Direction (0-Buy; 1-Sell)
status
integer
Status (0-In Progress; 1-Completed; 2-Canceled; 3-Timeout; 4-Partially Filled)
type
integer
Type (0-Market Order; 1-Limit Order)
completedTime
long
Order Completion Time
canceledTime
long
Order Cancel Time
time
long
Order Create Time
Historical Orders (Last 3 Months)
HTTP Request
POST
/v1/trade/history
Authentication: Yes
Rate Limit: 10 requests per second
Request Parameters
symbol
string
true
Trading Pair
startTime
long
true
Start Time (milliseconds)
endTime
long
true
End Time (milliseconds)
Response Fields
orderId
string
Order ID
clOrdId
string
Customer Custom Order ID
price
decimal
Order Price
avgPrice
decimal
Average Transaction Price
amount
decimal
Order Amount
tradedAmount
decimal
Filled Quantity
turnover
decimal
Transaction Amount (Filled Quantity * Transaction Price)
symbol
string
Trading Pair
baseSymbol
string
Quote Currency
coinSymbol
string
Base Currency
direction
integer
Direction (0-Buy; 1-Sell)
status
integer
Status (0-In Progress; 1-Completed; 2-Canceled; 3-Timeout; 4-Partially Filled)
type
integer
Type (0-Market Order; 1-Limit Order)
completedTime
long
Order Completion Time
canceledTime
long
Order Cancel Time
time
long
Order Create Time
Create Order
HTTP Request
POST
/v1/trade/order
Authentication: Yes
Rate Limit: 20 requests per second
Request Parameters
symbol
string
true
Trading Pair
price
decimal
true
Price (Set to 0 for Market Order)
amount
decimal
true
Quantity (For Market Buy Order: Represents the amount to buy in USDT; For Market Sell Order: Represents the quantity of base currency to sell)
direction
integer
true
Direction (0-Buy; 1-Sell)
type
integer
true
Type (0-Market Order; 1-Limit Order)
Response Fields
data
string
Order ID
Cancel Order
HTTP Request
POST
/v1/trade/cancel
Authentication: Yes
Rate Limit: 20 requests per second
Request Parameters
symbol
string
true
Trading Pair
orderId
string
true
Order ID
Response Fields
Last updated