You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The upper limit of Api request frequency is 60 times/min for POST request and 180 times/min for GET request. When this limit is exceeded, all Api request will be forbidden for 5 minutes.
The field contentType in request header should be: application/x-www-form-urlencoded
Go to DigiFinex's official website (www.digifinex.com) and register an account. After login, go to 'User Center' -> 'API Setting' to apply your ApiKey and ApiSecret.
Error Code
The parameter 'code' is included in the response of each Api. If its value is 0, it means that the request is successful and the return data is valid. For non-zero values, please check the table below to find error explanations.
code
Description
0
Success
10002
Invalid ApiKey
10003
Sign doesn't match
10004
Illegal request parameters
10005
Request frequency exceeds the limit
10006
Unauthorized to execute this request
10007
IP address Unauthorized
10008
Timestamp for this request is invalid
20001
Trade is not open for this trading pair
20002
Trade of this trading pair is suspended
20003
Invalid price or amount
20004
Price exceeds daily limit
20005
Price exceeds down limit
20006
Cash Amount is less than 10CNY
20007
Price precision error
20008
Amount precision error
20009
Amount is less than the minimum requirement
20010
Cash Amount is less than the minimum requirement
20011
Insufficient balance
20012
Invalid trade type (valid value: buy/sell)
20013
No such order
20014
Invalid date (Valid format: 2018-07-25)
20015
Dates exceed the limit
Parameter signature
The 'sign' parameter is demanded for each api request. It is obtained by sorting all request parameters (without sign) and ApiSecret firstly and then perfoming the MD5.
code: Error Code
date: Second timestamp whern server returned the response
usdt_btc: Trading pair symbol, usdt is the quote asset and btc is the base asset
buy: 1st bid price
high: 24h highest price
last: latest price
low: 24h lowest price
sell: 1st ask price
vol: 24h volume
change: 24h Change(compared with price 24h ago), 0.0108 means +1.08% increasement
code: Error Code
date: Second timestamp whern server returned the response
asks: Ask depth in price ascending order
[Price, Amount]
bids: Bid depth in price descending order
[Price, Amount]
Recent Trade List
URL:https://openapi.digifinex.com/v2/trade_detail
Request Method: GET
Request Parameters:
Param Name
Type
Mandatory
Description
symbol
string
1
Specified trading pair, e.g. usdt_btc
apiKey
string
1
Your ApiKey
timestamp
int
1
The second timestamp(UTC+8) when the request was sent,e.g. timestamp=1410431266
code: Error Code
date: Second timestamp whern server returned the response
[4,2,0.001,10.0]:amount precision, price precision, minimum amount, minimum cash amount (cash amount = price * amount)
E.g. "usdt_btc":[4,2,0.001,10.0]
Quote asset is usdt, base asset is btc.
Amount(BTC) supports 4 decimal places, and price(USDT) supports 2 decimal places.
The minimum amount is 0.001BTC and the minimum cash amount is 10USDT.
The limit order would be placed successfully if all the requirements above are fulfilled.
Limit price order
URL:https://openapi.digifinex.com/v2/trade
Request Method: POST
Request Parameters:
Param Name
Type
Mandatory
Description
symbol
string
1
Specified trading pair, e.g. usdt_btc
price
float
1
Price
amount
float
1
Amount
type
string
1
Type: buy/sell
post_only
int
0
1: yes, 0: no. post_only order will always pay the maker fee. If it is not sent into order book, this order will be cancelled automatically
apiKey
string
1
Your ApiKey
timestamp
int
1
The second timestamp(UTC+8) when the request was sent,e.g. timestamp=1410431266
sign
string
1
Parameter signature
Example:
# Request
POST https://openapi.digifinex.com/v2/trade
POST Parameters:
symbol=usdt_btc
price=6000.12
amount=0.1
type=buy
apiKey=59328e10e296a
timestamp=1410431266
sign=0a8d39b515fd8f3f8b848a4c459884c2
# Response
{
"code":0,
"order_id":"1000001"
}
Return value explanation:
code: Error Code
order_id: Order ID
Open orders
URL:https://openapi.digifinex.com/v2/open_orders
Request Method: GET
Request Parameters:
Param Name
Type
Mandatory
Description
symbol
string
0
Sprcified trading pair, e.g. usdt_btc. None for all trading pair.
type
string
0
Type:buy/sell/buy_market/sell_market,none for all types
page
int
0
Page Num, page=1 for 1st page. None for 1st page by default.
apiKey
string
1
Your ApiKey
timestamp
int
1
The second timestamp(UTC+8) when the request was sent,e.g. timestamp=1410431266
code: Error Code
date: Second timestamp whern server returned the response
total: total number of open orders
page: present page number
num_per_page: item quantity per page
orders: order detail in time descending order
order_id: order ID
created_date: second timestamp at order placement
symbol: specified trading pair
price: order price
amount: order amount
executed_amount: executed amount
cash_amount: cash amount = price * amount
avg_price: average executed price, 0.0 for unfilled
type: buy, sell
status: order status:
0: unfilled
1: partially filled
Order history
Open order not included. Only supports historical orders of last 3 days
code: Error Code
date: Second timestamp whern server returned the response
total: Total number for specified date
page: present page
num_per_page: number per page
orders: order details
order_id: order ID
created_date: timestamp at order placement
finished_date: timestamp at order fulfillment or cancel
symbol: specified trading pair
price: price
amount: amount
executed_amount: executed amount
cash_amount: cash amount = price * amount
avg_price: average executed price,0.0 for unfilled
type: buy, sell
status: order status:
2: fulfilled
3: unfilled and cancelled
4: partially filled and cancelled
Order Information
A quick lookup of order status, mutiple order IDs supported
URL:https://openapi.digifinex.com/v2/order_info
Request Method: GET
Request Parameters:
Param Name
Type
Mandatory
Description
order_id
string
1
Order ID to look up,multiple orders are seperated by a comma ',', 20 IDs for maximum
apiKey
string
1
Your ApiKey
timestamp
int
1
The second timestamp(UTC+8) when the request was sent,e.g. timestamp=1410431266
code: Error Code
date: Second timestamp whern server returned the response
success: Order IDs cancelled successfully
fail: [order ID failed to cancel, Error Code]
My Position
URL:https://openapi.digifinex.com/v2/myposition
Request Method: GET
Request Parameters:
Param Name
Type
Mandatory
Description
apiKey
string
1
Your ApiKey
timestamp
int
1
The second timestamp(UTC+8) when the request was sent,e.g. timestamp=1410431266