Due to a large number of requests, information about $50 PROMO can be found here.
API Documentation
NAV Navbar

Public Rest API for Darb (2019-04-01)

General API Information

  • The base endpoint is: https://api.darbfinance.com
  • All time and timestamp related fields are in milliseconds.
  • HTTP 4XX return codes are used for for malformed requests.
  • HTTP 429 return code is used when breaking a request rate limit.
  • HTTP 5XX return codes are used for internal errors.

  • Specific error codes and messages defined in another document.

  • For GET endpoints, parameters must be sent as a query string.

  • For POST, PUT, and DELETE endpoints, the parameters may be sent as a query string or in the request body with content type application/x-www-form-urlencoded. You may mix parameters between both the query string and request body if you wish to do so.

  • Parameters may be sent in any order.

  • If a parameter sent in both the query string and request body, the query string parameter will be used.

Endpoint security type

Security Type Description
NONE Endpoint can be accessed freely.
TRADE Endpoint requires sending a valid API-Key and signature.
USER_DATA Endpoint requires sending a valid API-Key and signature.
MARKET_DATA Endpoint requires sending a valid API-Key.
  • TRADE and USER_DATA endpoints are SIGNED endpoints.

SIGNED (TRADE and USER_DATA) Endpoint security

  • SIGNED endpoints require an additional parameter, signature, to be sent in the query string or request body.
  • Endpoints use HMAC SHA256 signatures. The HMAC SHA256 signature is a keyed HMAC SHA256 operation. Use your secretKey as the key and totalParams as the value for the HMAC operation.
  • totalParams is defined as the query string concatenated with the request body.
if (timestamp < (serverTime + 1000) && (serverTime - timestamp) <= recvWindow) {
// process request
} else {
// reject request
}
        

SIGNED Endpoint Examples for POST /api/v1/order

Here is a step-by-step example of how to send a vaild signed payload from the Linux command line using echo, openssl, and curl.

Key Value
apiKey vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A
secretKey NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j
Parameter Value
symbol LTC_BTC
side BUY
type LIMIT
quantity 1
price 0.1
recvWindow 5000
timestamp 1499827319559

Example 1: As a query string

echo -n "symbol=LTC_BTC&side=BUY&type=LIMIT&quantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j"
# (stdin)= c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71
curl -H "X-MBX-APIKEY: vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" -X POST 'https://dev.cf.int:2002/api/v1/order?symbol=LTC_BTC&side=BUY&type=LIMIT&quantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559&signature=c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71'
        
  • queryString: symbol=LTC_BTC&side=BUY&type=LIMIT&quantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559
  • HMAC SHA256 signature:

Example 2: As a request body

echo -n "symbol=LTC_BTC&side=BUY&type=LIMIT&quantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j"
# (stdin)= c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71
curl -H "X-MBX-APIKEY: vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" -X POST 'https://dev.cf.int:2002/api/v1/order' -d 'symbol=LTC_BTC&side=BUY&type=LIMITquantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559&signature=c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71'
        
  • requestBody: symbol=LTC_BTC&side=BUY&type=LIMIT&quantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559
  • HMAC SHA256 signature:

Example 3: Mixed query string and request body

echo -n "symbol=LTC_BTC&side=BUY&type=LIMITquantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j"
# (stdin)= 0fd168b8ddb4876a0358a8d14d0c9f3da0e9b20c5d52b2a00fcf7d1c602f9a77
curl -H "X-MBX-APIKEY: vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" -X POST 'https://dev.cf.int:2002/api/v1/order?symbol=LTC_BTC&side=BUY&type=LIMIT' -d 'quantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559&signature=0fd168b8ddb4876a0358a8d14d0c9f3da0e9b20c5d52b2a00fcf7d1c602f9a77'
        
  • queryString: symbol=LTC_BTC&side=BUY&type=LIMIT
  • requestBody: quantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559
  • HMAC SHA256 signature:

Public API Endpoints

Terminology

  • base asset refers to the asset that is the quantity of a symbol.
  • quote asset refers to the asset that is the price of a symbol.

ENUM definitions

Order status:

  • NEW
  • PARTIALLY_FILLED
  • FILLED
  • CANCELED

Order types:

  • LIMIT
  • MARKET
  • STOP_LOSS_LIMIT
  • TAKE_PROFIT_LIMIT
  • LIMIT_MAKER

Order side:

  • BUY
  • SELL

Kline/Candlestick chart intervals:

m -> minutes; h -> hours; d -> days; w -> weeks; M -> months

  • 1m
  • 1h
  • 1d

General endpoints

Test connectivity

GET /api/v1/status
        

Request:

echo curl -s -X GET "http://dev.cf.int:2002/api/v1/status"
        

Response

{}

Test connectivity to the Rest API.

Parameters: NONE

Check server time

GET /api/v1/time
        

Request:

echo `curl -s -X GET "http://dev.cf.int:2002/api/v1/time"`
        

Response:

{"serverTime":1539960428349}

Get the current server time.

Parameters: NONE

Exchange information

GET /api/v1/exchangeInfo
        

Current exchange trading rules and symbol information

Weight: 1

Parameters: NONE

Response:

{"currencies":{"LSK":{"code":"LSK","name":"Lisk","precision":8,"limits":{"deposit":0.00001,"withdrawal":0.00001,"offer":0.001,"confirmations":5},"type":["CRYPTO"],"withdrawal":{"currencyFee":"LSK","value":0.01}},"XMR":{"code":"XMR","name":"Monero","precision":8,"limits":{"deposit":0.00001,"withdrawal":0.00001,"offer":0.001,"confirmations":5},"type":["CRYPTO"],"withdrawal":{"currencyFee":"XMR","value":0.01}},"USD":{"code":"USD","name":"American dolars","precision":2,"limits":{"deposit":0.00001,"withdrawal":0.00001,"offer":1,"confirmations":5},"type":["FIAT"],"withdrawal":{"currencyFee":"USD","value":0.01}}},"pairs":{"BTC_XRP":{"code":"BTC_XRP","sortOrder":1000,"type":["CRYPTO"]},"BTC_EUR":{"code":"BTC_EUR","sortOrder":21,"type":["CRYPTO","FIAT"]},}}

Market Data endpoints

Order book

GET /api/v1/depth
        

Response:

{"lastUpdateId":1027024,"bids":[["4.00000000",//PRICE"431.00000000"//QTY]],"asks":[["4.00000200","12.00000000"]]}

Parameters:

Name Type Mandatory Description
symbol STRING YES
limit INT NO Default 100; max 1000. Valid limits:[5, 10, 20, 50, 100, 500, 1000]

Caution: setting limit=0 can return a lot of data.

Recent trades list

GET /api/v1/trades
        

Response:

[{"price":"4.00000100","qty":"12.00000000","time":1499865549590}]

Get recent trades (up to last 500).

Parameters:

Name Type Mandatory Description
symbol STRING YES
limit INT NO Default 500; max 1000.

Kline/Candlestick data

GET /api/v1/klines
        

Response:

[{"open":6430.95,"high":6431.78,"low":6430.87,"close":6431.78,"volume":61.83642915,"time":1541582160000},{"open":6431.78,"high":6435.12331,"low":6430.87,"close":6432.39,"volume":72.21221004,"time":1541582220000},{"open":6432.39,"high":6435.12331,"low":6430.87,"close":6435.12331,"volume":69.01760233,"time":1541582280000}]

Kline/candlestick bars for a symbol. Klines are uniquely identified by their open time.

Parameters:

Name Type Mandatory Description
symbol STRING YES
interval ENUM YES
startTime LONG NO
endTime LONG NO
limit INT NO Default 500; max 1000.

If startTime and endTime are not sent, the most recent klines are returned.

24hr ticker price change statistics

GET /api/v1/ticker/24hr
        

24 hour price change statistics.

Response:

{"symbol":"BTC_EUR","lowPrice":"0.10000000","highPrice":"100.00000000","volume":"8913.30000000","lastPrice":"4.00000200","priceChangePercent":"-1.20"}

Parameters:

Name Type Mandatory Description
symbol STRING NO
  • If the symbol is not sent, tickers for all symbols will be returned in an array.

Symbol order book ticker

GET /api/v1/ticker/bookTicker
        

Response:

{"symbol":"BTC_EUR","bidPrice":"4.00000000","bidQty":"431.00000000","askPrice":"4.00000200","askQty":"9.00000000"}

Best price/qty on the order book for a symbol.

Parameters:

Name Type Mandatory Description
symbol STRING YES

Account endpoints

New order (TRADE)

POST /api/v1/order  (HMAC SHA256)
        

Response ACK:

{"symbol":"BTC_USD","guid":"010be742-e270-11e8-add0-0242ac150002","orderId":28,"clientOrderId":1,"transactTime":1507725176595}

Response RESULT:

{"symbol":"BTC_USD","guid":"010be742-e270-11e8-add0-0242ac150002","orderId":28,"clientOrderId":1,"transactTime":1507725176595,"price":"1.00000000","origQty":"10.00000000","executedQty":"10.00000000","status":"FILLED","type":"MARKET","side":"SELL"}

Response FULL:

{"symbol":"BTC_USD","guid":"010be742-e270-11e8-add0-0242ac150002","orderId":28,"clientOrderId":1,"transactTime":1507725176595,"price":"1.00000000","origQty":"10.00000000","executedQty":"10.00000000","status":"FILLED","type":"MARKET","side":"SELL","fills":[{"price":"4000.00000000","qty":"1.00000000","commission":"4.00000000","commissionAsset":"USD"},{"price":"3995.00000000","qty":"1.00000000","commission":"3.99500000","commissionAsset":"USD"}]}

Send in a new order.

Parameters:

Name Type Mandatory Description
symbol STRING YES
side ENUM YES
type ENUM YES
quantity DECIMAL YES
price DECIMAL NO
stopPrice DECIMAL NO Used with STOP_LOSS_LIMIT and TAKE_PROFIT_LIMIT orders.
newOrderRespType ENUM NO Set the response JSON. ACK, RESULT, or FULL; MARKET and LIMIT order types default to FULL, all other orders default to ACK.
recvWindow LONG NO
timestamp LONG YES

Additional mandatory parameters based on type:

Type Additional mandatory parameters
LIMIT quantity, price
MARKET quantity
STOP_LOSS_LIMIT quantity, price, stopPrice
TAKE_PROFIT_LIMIT quantity, price, stopPrice
LIMIT_MAKER quantity, price

Other info:

  • LIMIT_MAKER order that will be rejected if they would immediately match and trade as a taker.

Trigger order price rules against market price for both MARKET and LIMIT versions:

Test new order (TRADE)

POST /api/v1/order/test (HMAC SHA256)
        

Response:

{}

Test new order creation and signature/recvWindow long. Creates and validates a new order but does not send it into the matching engine.

Parameters:

Same as POST /api/v1/order

Query order (USER_DATA)

GET /api/v1/order (HMAC SHA256)
        

Response:

{"symbol":"LTC_BTC","orderId":1,"clientOrderId":1,"price":"0.1","origQty":"1.0","executedQty":"0.0","status":"NEW","type":"LIMIT","side":"BUY","stopPrice":"0.0","time":1499827319559,"updateTime":1499827319559}

Check an order's status.

Parameters:

Name Type Mandatory Description
symbol STRING YES
orderId LONG NO
clientOrderId LONG NO
guid STRING NO
recvWindow LONG NO
timestamp LONG YES

Notes:

  • Either orderId or clientOrderId or guid must be sent.

Cancel order (TRADE)

DELETE /api/v1/order  (HMAC SHA256)
        

Response:

{"symbol":"LTC_BTC","guid":"3df625ec-e332-11e8-81be-0242ac150002","orderId":1}

Cancel an active order.

Parameters:

Name Type Mandatory Description
symbol STRING YES
orderId LONG NO
guid STRING NO
recvWindow LONG NO
timestamp LONG YES
  • Either orderId or guid must be sent.

Current open orders (USER_DATA)

GET /api/v1/openOrders  (HMAC SHA256)
        

Response:

[{"symbol":"LTC_BTC","orderId":1,"guid":"ccaa8dcc-7268-11e8-af98-000c29f3e48b","price":"0.1","origQty":"1.0","executedQty":"0.0","status":"NEW","type":"LIMIT","side":"BUY","stopPrice":"0.0","time":1499827319559,"updateTime":1499827319559}]

Get all open orders on a symbol. Careful when accessing this with no symbol.

Parameters:

Name Type Mandatory Description
symbol STRING NO
recvWindow LONG NO
timestamp LONG YES
  • If the symbol is not sent, orders for all symbols will be returned in an array.
  • When all symbols are returned, the number of requests counted against the rate limiter is equal to the number of symbols currently trading on the exchange.

All orders (USER_DATA)

GET /api/v1/allOrders (HMAC SHA256)
        

Response:

[{"symbol":"LTC_BTC","orderId":1,"guid":"ccaa8dcc-7268-11e8-af98-000c29f3e48b","price":"0.1","origQty":"1.0","executedQty":"0.0","status":"NEW","type":"LIMIT","side":"BUY","stopPrice":"0.0","time":1499827319559,"updateTime":1499827319559}]

Get all account orders; active, canceled, or filled.

Parameters:

Name Type Mandatory Description
symbol STRING YES
orderId LONG NO
startTime LONG NO
endTime LONG NO
limit INT NO Default 500; max 1000.
recvWindow LONG NO
timestamp LONG YES

Notes: * If orderId is set, it will get orders >= that orderId. Otherwise most recent orders are returned.

Account information (USER_DATA)

GET /api/v1/account  (HMAC SHA256)
        

Response:

{"makerCommission":15,"takerCommission":15,"buyerCommission":0,"sellerCommission":0,"balances":[{"asset":"BTC","free":"4723846.89208129","locked":"0.00000000","pending":"0.0","changedAt":"1540384966328"},{"asset":"LTC","free":"4763368.68006011","locked":"0.00000000","pending":"0.0","changedAt":"1540374808445"}]}

Get current account information.

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

Account trade list (USER_DATA)

GET /api/v1/myTrades  (HMAC SHA256)
        

Response:

[{"symbol":"BTC_EUR","id":28457,"orderId":100234,"price":"4.00000100","qty":"12.00000000","commission":"10.10000000","commissionAsset":"EUR","time":1499865549590,"isBuyer":true,"isMaker":false,"isBestMatch":true}]

Get trades for a specific account and symbol.

Parameters:

Name Type Mandatory Description
symbol STRING YES
startTime LONG NO
endTime LONG NO
fromId LONG NO TradeId to fetch from. Default gets most recent trades.
limit INT NO Default 500; max 1000.
recvWindow LONG NO
timestamp LONG YES

Notes: * If fromId is set, it will get orders >= that fromId. Otherwise most recent orders are returned.