API Interface (API version 2)

Interface URI Prefix: /api/v2
Return Result Format: JSON

Public/Private API

There are two kinds of API interfaces for developers:

VerificationNo VerificationRequire Verification
Application FrequencyNo Limitation600 requests / 5 mins
PreparationsNo Preparation RequiredUse your API Token page to get access/secretkey

How to signature(Verification)

Before applying for Private API signature, you should prepare your access/secret_key. These materails could be found in the API Token page after registration.

All Private API users need the following 3 parameters when doing identity verification:

access_key can be found in API Token page.
tonce is the time stamp using positive integer, it repesents the number of millisecond from Unix epoch The time error between tonce and Yunbi's server could be limited to plus-minus 30 seconds. And, every value of tonce can only be used once.
signatureis generated after secret_key on API Token page.

Verification Steps

The generation process of signature is simple. First, the application should be transfer into a character string. Then use this character string to do HMAC-SHA256 calculation:

hash = HMAC-SHA256(payload, secret_key).to_hex

payload is representing the applied character string, it could be fomulate by using HTTP method. The application address and parameter is listed below.

Assume the secret key is yyy, then using HMAC-SHA256 algorithm to calculate the payload mentioned above, the result is(use hex to illustrate).

Now, we could make application by using this signature(use curl for example):

Return result

If API call failed, the return will use HTTP status code. Also, the return include detail error information showing JSON data. For example:

{"error": {"code": CODE, "message": MESSAGE}}

All the errors have the same format according to the above sentence, the only differences are code and message. Code is the custom error defined by Yunbi, it illustrates the category of the error. Message is detail error information.

For complete API application, Yunbi will return 200 for JSON data.

Data Type

Market Market include all the market information, for example: BTC/CNY.

Member include the information of a user:

Account includes all the assets user has:

Order includes the information of every single order.

Trade Trade includes every transaction made by order.

OrderBook includes the orders on the market.

Dos and don'ts

Cancel order

Cancel order and cancel all the orders are asynchronous operations, API return complete only means cancel application has been submitted, it doesn't mean your order has been canceled. If you have orders which haven't been processed or the cancel queue is busy, your cancel application will delay. API returns the canceled order, the return order may not be conceled. Your code should not rely on API retrun result. It should get the latest status by using "order inquiry interface".

Libraries/Tools List