Public
Security: None
GET https://openapi.darkex.com/sapi/v1/ping
This endpoint checks connectivity to the host
200: OK Connection normal
{}
Check Server Time
GET https://openapi.darkex.com/sapi/v1/time
This endpoint checks connectivity to the server and retrieves server timestamp
200: OK Successfully retrieved server time
{
"timezone": "GMT+08:00",
"serverTime": 1595563624731
}
Pairs List
GET https://openapi.darkex.com/sapi/v1/symbols
200: OK
{
"symbols": [
{
"quantityPrecision": 3,
"symbol": "sccadai",
"pricePrecision": 6,
"baseAsset": "SCCA",
"quoteAsset": "DAI",
"limitAmountMin":"100",
"limitPriceMin":"123.45",
"limitVolumeMin":"10"
},
{
"quantityPrecision": 8,
"symbol": "btcusdt",
"pricePrecision": 2,
"baseAsset": "BTC",
"quoteAsset": "USDT",
"limitAmountMin":"100",
"limitPriceMin":"123.45",
"limitVolumeMin":"10"
},
{
"quantityPrecision": 3,
"symbol": "bchusdt",
"pricePrecision": 2,
"baseAsset": "BCH",
"quoteAsset": "USDT",
"limitAmountMin":"100",
"limitPriceMin":"123.45",
"limitVolumeMin":"10"
},
{
"quantityPrecision": 2,
"symbol": "etcusdt",
"pricePrecision": 2,
"baseAsset": "ETC",
"quoteAsset": "USDT",
"limitAmountMin":"100",
"limitPriceMin":"123.45",
"limitVolumeMin":"10"
},
{
"quantityPrecision": 2,
"symbol": "ltcbtc",
"pricePrecision": 6,
"baseAsset": "LTC",
"quoteAsset": "BTC",
"limitAmountMin":"100",
"limitPriceMin":"123.45",
"limitVolumeMin":"10"
}
]
}
symbol | string | BTCUSDT | Name of the symbol | currency to name |
baseAsset | string | BTC | Underlying asset for the symbo | base currency |
quoteAsset | string | USDT | Quote asset for the symbol | The base currency |
pricePrecision | integer | 2 | Precision of the price | Price Accuracy |
quantityPrecision | integer | 6 | Precision of the quantity | Quantity accuracy |
limitAmountMin | String | 100 |
Limit order minimum order amount quote |
|
limitPriceMin | String | 100 |
Minimum price of a limit order |
|
limitVolumeMin | String | 100 |
|
|
baseAssetName | String | BTC | Base Currency Display Name | |
quoteAssetName | String | USDT |
Quote Currency Display Name |
|
SymbolName | string | BTC/USDT |
|
Market
Security Type: None
Depth
GET
https://openapi.darkex.com/sapi/v1/depth
market detpth data
Query Parameters
Name | Type | Desciription |
limit | integer | Default 100; Max 100 |
symbol* | String | Symbol Name E.g. BTCUSDT |
200: OK Successfully retrieved market depth data
{
"bids": [
[
"3.90000000", // price
"431.00000000" // vol
],
[
"4.00000000",
"431.00000000"
]
],
"asks": [
[
"4.00000200", // price
"12.00000000" // vol
],
[
"5.10000000",
"28.00000000"
]
]
}
weight(IP/UID): 5
Response:
time | long |
1595563624731 |
Current timestamp(ms) |
bids | list | ; | List of all bids, best bids first. See below for entry details. |
asks | list | ; |
List of all asks, best asks first. See below for entry details.
|
The fields bids and asks are lists of order book price level entries, sorted from best to worst.
' ' | float | 131.1 | price level |
' ' | float | 2.3 | the total quantity of orders for this price level |
24hrs ticker
GET
https://openapi.darkex.com/sapi/v1/ticker
24 hour price change statistics.
Query Parameters
Name | Type | Description |
symbol* | String | Symbol Name. E.g. BTCUSDT |
200:OK Successfully retrieved ticker data
{
"high": "9279.0301",
"vol": "1302",
"last": "9200",
"low": "9279.0301",
"rose": "0",
"time": 1595563624731
}
weight(IP/UID):5
Response:
time | long | 1595563624731 | Open time |
high | float | 9900 | High price |
low | float | 8800.34 | Low Price |
open | float | 8700 | Open price |
last | float | 8900 | Last Price |
vol | float | 4999 | Trade Volume |
rose | float | 0 |
Price increase or Price rise |
Recent Trades List
GET https://openapi.darkex.com/sapi/v1/trades
Query Parameters
Name | Type | Description |
Symbol* | String |
Symbol Name. E.g. BTCUSDT |
limit | String |
Default 100; Max 1000Responses200 |
200:OK
{
"list":[
{
"price":"3.00000100",
"qty":"11.00000000",
"time":1499865549590,
"side":"BUY"
}
]
}
weight(IP/UID):5
Response:
price | float | 0.055 |
The price of the trade |
time | long | 1537797044116 |
Current timestamp (ms) |
qty | float | 5 | The quantity traded |
side | string | BUY/SELL | Taker side |
Kline/candlestick data
GET https://openapi.darkex.com/sapi/v1/klines
Query parameters
Name | Type | Description |
symbol* | Symbol Name. E.g. BTCUSDT | |
interval* | String |
Interval of the Kline. Possible values include: 1min,5min,15min,30min, 60min,1day,1week,1month |
Default 100; Max 300 | String |
Defaul 100; Max 300Responses200 |
startTime | long |
startTime example:1538728740000 |
endTime | long | endTime example:1538728740000 |
200:OK
[
{
"high": "6228.77",
"vol": "111",
"low": "6228.77",
"idx": 1594640340,
"close": "6228.77",
"open": "6228.77"
},
{
"high": "6228.77",
"vol": "222",
"low": "6228.77",
"idx": 1587632160,
"close": "6228.77",
"open": "6228.77"
},
{
"high": "6228.77",
"vol": "333",
"low": "6228.77",
"idx": 1587632100,
"close": "6228.77",
"open": "6228.77"
}
]
weight(IP/UID): 1
Response:
idx | long | 1538728740000 | Open time |
open | float | 36.00000 | open price |
close | float | 33.00000 | close price |
high | float | 36.00000 | high price |
low | float | 30.00000 | low price |
vol | float | 2456.111 | volume |
TRADE
Security Type:TRADE
Endpoints under Trade require an API Key and a signature
NEW ORDER
POST https://openapi.darkex.com/sapi/v1/order
Rate Limit: 100times/2s
Query Parameters
Name | Type | Description |
X-CH-SIGN | String | Sign |
X-CH-APIKEY | Sring | Your API-Key |
X-CH-TS | Integer | timestamp |
Request Body
Name | Type | Description |
symbol* | String | Symbol Name. E.g. BTCUSDT |
symbolName | String |
Currency display name: Either symbol or symbolName must be provided. |
volume* | number |
Order vol. For MARKET BUY orders, vol=amount. |
side* | String | Side of the order, BUY/SELL |
type* | String |
Type of the order, LIMIT/MARKET/FOK/POST_ONLY /IOC |
price* | number |
Order price, REQUIRED for LIMIT orders |
newClientOrderId | string |
Unique order ID generated by users to mark their orders |
recvwindow | integer | Time window |
200:OK Successfully post new order
{
'symbol': 'LXTUSDT',
'orderId': 150695552109032492,
'orderIdString': '150695552109032492',//Character String Type Order ID (Recommended)
'clientOrderId': '157371322565051',
'transactTime': '1573713225668',
'price': '0.005452',
'origQty': '110',
'executedQty': '0',
'status': 'NEW',
'type': 'LIMIT',
'side': 'SELL'
}
weight(IP/UID):5
Response:
orderID | long | 150695552109032492 | ID of the order |
clientorderId | string | 213443 |
A unique ID of the order. |
symbol | string | BTCUSDT | Symbol Name |
symbolName | string | BTC/USDT |
Currency display name: Either symbol or symbolName must be provided. Example: BTC/USDT |
transactTime | integer | 1273774892913 | Time the order is placed |
price | float | 4765.29 |
Time the order is placed |
origQty | float | 1.01 | Quantity ordered |
executedQty | float | 1.01 |
Quantity of orders that has been executed |
type | string | LIMIT | order type LIMIT,MARKET |
side | string | BUY |
Order side:BUY,SELL |
status | string | 0 |
0=new order |
Test New Order
POST https://openapi.darkex.com/sapi/v1/order/test
Test new order creation and signature/recWindow length. Creates and validates a new order but
does not send the order into the matching engine.
Headers
Name | Type | Description |
X-CH-APIKEY | string | Your API-Key |
X-CH-TS | string | timestamp |
X-CH-SIGN | string | sign |
Request Body
Name | Type | Description |
type* | String | Type of the order, LIMIT/MARKET |
price* | number | Order price, REQUIRED for LIMIT orders |
volume* | number |
Order vol. For MARKET BUY orders, vol=amount. |
side* | String | Side of the order, BUY/SELL |
symbol* | String | Symbol Name. E.g. BTCUSDT |
symbolName | String |
Currency display name: Either symbol or symbolName must be provided. Example: BTC/USDT |
recvwindow | integer | Time window |
newClientorderId | string |
Unique order ID generated by users to mark their orders |
200:OK Successfully test new order
{
// Response
}
weight(IP/UID):1
Batch Orders
POST https://openapi.darkex.com/sapi/v1/batchOrders
batch contains at most 10 orders
Headers
Name | type | Description |
X-CH-APIKEY | String | Your API-key |
X-CH-TS | String | timetamp |
X-CH-SIGN | String | Sign |
Request Body
Name | Type | Description |
orders | number | The batch order information can contain a maximum of 10 records. |
symbol* | String | Symbol Name. E.g. BTCUSDT |
symbolName | String |
Currency display name: Either symbol or symbolName must be provided. Example: BTC/USDT |
symbolName | String |
Currency display name: choose either symbol or symbolName to fill in. |
200:OK
{
"idsString": [ //Character String Type Order ID (Recommended)
"165964665990709251",
"165964665990709252",
"165964665990709253"
],
"ids": [
165964665990709251,
165964665990709252,
165964665990709253
]
}
weight(IP/UID):10
Resquest orders field:
price | float | 1000 | Price |
volume | float | 20.1 | Quatity |
side | String | BUY/SELL | Direction |
batchType | String | LIMIT/MARKET | Type |
name | type | Example | Description |
Resquest
idsString | String | ''3213213'' | A collection of order numbers of type String. |
ids | integer | 2100 | Collection of order numbers. |
Query Order
GET https://openapi.darkex.com/sapi/v1/order
Query Parameters
Name | Type | Description |
orderId* | String | Oder ID |
newClientorderId | String | Client Order ID, Unique order ID generated by users to mark their orders. E.g. 354444heihieddada |
symbol* | String | Symbol Name. E.g. BTCUSD1 |
symbolName | String |
Currency display name: Either symbol or symbolName must be provided. Example: BTC/USDT |
Headers
Name | Type | Description |
X-CH-APIKEY | String | Your API-key |
X-CH-TS | String | timestampResponses200 |
X-CH-SIGN | String | Sign |
200:OK
{
'orderId': '499890200602846976',
'clientOrderId': '157432755564968',
'symbol': 'BHTUSDT',
'price': '0.01',
'origQty': '50',
'executedQty': '0',
'avgPrice': '0',
'status': 'NEW',
'type': 'LIMIT',
'side': 'BUY',
'transactTime': '1574327555669'
}
weight(IP/UID):1
Response:
orderId | long | 150695552109032492 | Order ID (System generated) |
clientorderId | string | 213443 | Order ID (ssent by yourself) |
symbol | string | BTCUSDT | Currency Pair Name |
symbolName | string | BTC/USDT |
Currency display name:Eitehr symbol or symbolName must be provided. BTC/USDT |
price | float | 4765.29 | Order price |
origQty | float | 1.01 | Number of orders |
executedQty | float | 1.01 | Number of orders already filled |
type | string | limit | The oorder type LIMIT,MARKET |
side | string | BUY |
Order direction. Possible values can only be: BUY(buy long) and SELL (sell short) |
avgPrice | float | 4754.24 | Average price of orders already filled |
status | string | NEW | Order status.Possible values are NEW (new order, no transaction), PARTIALLY_FILLED (partially filled), CANCELED (cancelled) and REJECTED (order rejected).POST |
transactTime | string | 1574327555669 | Order Creation Time |
Cancel Order
POST https://openapi.darkex.com/sapi/v1/cancel
Headers
Name | Type | Description |
X-CH-APIKEY | String | Your API-key |
X-CH-TS | String | timestamp |
X-CH-SIGN | String | Sign |
Request Body
Name | Type | Description |
newClientOrderId | String | Client order Id, Unique order ID generated by users to mark their orders. E.g. 354444heihieddada |
orderId* | String | Order ID |
symbol* | String | Symbol Name. E.g. BTCUSDT |
symbolName | String | Currency display name: Either symbol or SymbolName must be provided. Example: BTC/USDT |
200:OK
{
'symbol': 'BHTUSDT',
'clientOrderId': '0',
'orderId': '499890200602846976',
'status': 'CANCELED'
}
weight(IP/UID):5
Response:
orderId | long | 15069552109032492 | ID of the order |
clientorderId | string | 213443 |
Unique ID of the order. |
symbol | string | BTCUSDT | Name of the symbol |
status | string | NEW |
The state of the order. Possible values include NEW, PARTIALLY_FILLED, FILLED, CANCELED, and REJECTED.POST |
Batch cancel orders
POST https://openapi.darkex.com/sapi/v1/batchCancel
batch contains at most 10 orders
Headers
Name | Type | Description |
X-CH-APIKEY | String | Your API-key |
X-CH-TS | String | timestamp |
X-CH-SIGN | String | Sign |
Request Body
Name | Type | Description |
orderIds | String | Order ID collection [123,456] Responses200GET |
symbol* | String | Symbol Name. E.g. BTCUSDT |
symbolName | String | The state of the order. Possible values include NEW,PARTIALLY_FILLED, FILLED, CANCELED, and REJECTED.POST |
200:OK
{
"success": [
165964665990709251,
165964665990709252,
165964665990709253
],
"failed": [ //cancel fails because the order does not exist or the order state has expired
165964665990709250
]
}
weight(IP/UID): 10
Current Open Orders
GET https://openapi.darkex.com/sapi/v1/openOrders
Query Parameters
Name | Type | Description |
symbol* | String | Symbol Name. E.g. BTCUSDT |
limit | String | Default 100; Max 1000 |
Headers
Name | Type | Description |
X-CH-APIKEY | String | Your API-key |
X-CH-TS | String | timestamp |
X-CH-SIGN | String | Sign |
200:OK
[
{
'orderId': 499902955766523648,
'orderIdString': '499902955766523648', //Character String Type Order ID (Recommended)
'symbol': 'BHTUSDT',
'price': '0.01',
'origQty': '50',
'executedQty': '0',
'avgPrice': '0',
'status': 'NEW',
'type': 'LIMIT',
'side': 'BUY',
'time': '1574329076202'
},...
]
weight(IP/UID):1
Response:
orderId | long | 150695552109032492 | ID of the order |
orderIdString | string | "150695552109032492" | Character String Type Order ID (Recommended) |
clientorderId | string | 2134443 | Unique ID of the order. |
symbol | string | BTCUSDT |
Name of the symbol |
symbolName | string | BTC/USDT |
Currency display name: Either symbol or symbolName must be provided. Example: BTC/USDT |
price | float | 4765.29 | Price of the order |
origQty | float | 1.01 | Quantity ordered |
executedQty | float | 1.01 | Quanittiy of orders that has been executed |
avgPrice | float | 4754.24 | Average price of filled orders. |
type | string | LIMIT | The order type LIMIT, MARKET |
Side | string | BUY | The order side BUY, SELL |
status | string | NEW | The state of the order. Possible values include NEW, PARTIALLY_FILLED, FILLED, CANCELED, and REJECTED.GET |
time | string | 1574327555669 | Creation Time |
Trades
GET https://openapi.darkex.com/sapi/v1/myTrades
Query Parameters
Name | Type | Description |
symbol* | string | Symbol Name. E.g. BTCUSDT |
symbolName | string |
Currency display name: Either symbol or symbolName must be provided. Example: BTC/USDT |
limit | string | Default 100; Max1000 |
fromId | string | Trade Id to fetch from |
Headers
Name | Type | Description |
X-CH-APIKEY | string | Your API-key |
X-CH-TS | string | timstamp |
X-CH-SIGN | string | sign |
200:OK
[
{
"symbol": "ETHBTC",
"id": 100211,
"bidId": 150695552109032492,
"askId": 150695552109032493,
"price": "4.00000100",
"qty": "12.00000000",
"time": 1499865549590,
"isBuyer": true,
"isMaker": false,
"feeCoin": "ETH",
"fee":"0.001",
"bidUserId":23334,
"askUserId":44112
},...
]
weight(IP/UID): 1
Response:
symbol | string | BTCUSDT | Name of the symbol |
id | integer | 28457 | Trade ID |
bidId | long | 150695552109032492 | Bid Order ID |
askId | long | 150695552109032492 | Ask Order ID |
price | integer | 4.01 | Price of the trade |
qty | float | 12 | Quantiry of the trade |
time | number | 1499865549590 | timestamp of the trade |
isBuyer | bool | true | true= Buyer false= Seller |
isMaker | bool | false |
True=Maker false=Taker |
feeCoin | string | ETH | Trading fee coin |
fee | number | 0.001 | Trading fee |
bidUserId | long | 23334 | Traiding fee |
askUserId | long | 44112 | Seller UID |
isSelf | bool | true | whether is self dealt |
Account
Security Type: USER_DATA
Endpoints under Account require an API-key and a signature.
Account Information
GET https://openapi.darkex.com/sapi/v1/account
Headers
Name | Type | Description |
X-CH-APIKEY | string | Your API-key |
X-CH-TS | string | timstamp |
X-CH-SIGN | string | sign |
200:OK Successfully retrieved account information.
{
'balances':
[
{
'asset': 'BTC',
'free': '0',
'locked': '0'
},
{
'asset': 'ETH',
'free': '0',
'locked': '0'
},...
]
}
weight(IP/UID): 1
Response:
name | type | description |
balances | [] | Show balance details |
balances field:
name | type | example | description |
asset | string | USDT | Name of the asset |
free | float | 1000.3 | Amount available for use |
locked | float | 400 | Amount locked (for open orders) |