1.All Trading Pairs API

Back to all the trading pairs supported by the system

URL: https://api.ukex.com/api/index/pairs

For example

    
        	# Request
		GET: https://api.ukex.com/api/index/pairs
		# Response
    		["btc_gbp","eth_gbp","bch_gbp","ltc_gbp","btc_eur","eth_eur","ltc_eur","bch_eur",
			"btc_buc","eth_buc","ltc_buc","bch_buc","btc_usd","eth_usd","ltc_usd","bch_usd",
			"eth_btc","ltc_btc","bch_btc","ltc_eth","dero_btc","pivx_btc","sys_btc","ae_buc",
			"ae_btc","ae_eth","btm_btc"]
        

Response description

			eth_btc: Trading of ETH to BTC
			etc_btc: ETC to BTC
			zec_btc: Z Cash to BTC
			ltc_eth: LTC to ETH
	    

2. Trading Market Order Parameters API

Back to the parameters of all trading market supported by the system, including trading fee, Min. order amount, price accuracy, etc

URL: https://api.ukex.com/api/index/marketinfo

For example

    
        	# Request
		GET: https://api.ukex.com/api/index/marketinfo
		# Response
    		{
				"result": "true",
				"pairs": {
					"ltc_usd": {
						"decimal_places": "2",
						"min_amount": "",
						"fee_buy": "0.1",
						"fee_sell": "0.1"
					},
					"btc_usd": {
						"decimal_places": "2",
						"min_amount": "",
						"fee_buy": "0.1",
						"fee_sell": "0.1"
					},
					"eth_usd": {
						"decimal_places": "2",
						"min_amount": "",
						"fee_buy": "0.1",
						"fee_sell": "0.1"
					}
				}
			}
        

Response description

			decimal_places: decimal calculation places
			min_amount: minimum trading amount
			fee_buy: buyer’s fee(eg 0.2 i.e., 2/1000)
			fee_sell: seller’s fee
	    

3. Trading Market Detail API

Back to the details and coin information of the all the trading market supported by the system, including coin name, coin value, supply amount, latest price, change trends, price curve, etc.

URL: https://api.ukex.com/api/index/marketlist

For example

    
        	# Request
		GET: https://api.ukex.com/api/index/marketlist
		# Response
			{
				"result": "true",
				"data": [{
					"no": 1,
					"symbol": "btc",
					"name": "BitCoin",
					"name_en": "BitCoin",
					"name_cn": "比特币",
					"pair": "btc_gbp",
					"rate": 5181.97,
					"vol_a": 439.93,
					"vol_b": 2215993.84,
					"curr_a": "btc",
					"curr_b": "gbp",
					"curr_suffix": "gbp",
					"rate_percent": 3.61,
					"trend": "up"
				}, {
					"no": 2,
					"symbol": "eth",
					"name": "ethereum",
					"name_en": "ethereum",
					"name_cn": "以太坊",
					"pair": "eth_gbp",
					"rate": 220.18,
					"vol_a": 475.6,
					"vol_b": 104718.06,
					"curr_a": "eth",
					"curr_b": "gbp",
					"curr_suffix": "gbp",
					"rate_percent": 0.18,
					"trend": "up"
				}]
			}
        

Response description

			symbol : Coin symbol
			name: Coin name
			name_en: English name
			name_cn: Chinese name
			pair: Trading pair
			rate: Current price
			vol_a: Trading volume of exchanged coin
			vol_b: Trading volume of exchanging coin
			curr_a: Exchanged coin
			curr_b: Exchanging coin
			curr_suffix: Coin suffix
			rate_percent: Up and down percentage
			trend: 24h trend up down
	    

4. All Trading Market Information API

Returns the latest, highest, lowest trading quotas and trading volume of all transactions supported by the system.

URL: https://api.ukex.com/api/index/tickers

For example

        	# Request
		GET: https://api.ukex.com/api/index/tickers
		# Response
			{
				"btc_gbp": {
					"result": "true",
					"last": 5187.78,
					"lowestAsk": "5231.18000000",
					"highestBid": "5146.37000000",
					"percentChange": 3.73,
					"baseVolume": 440.08,
					"quoteVolume": 2215993.84,
					"high24hr": 5348.25,
					"low24hr": 5021.97
				},
				"eth_gbp": {
					"result": "true",
					"last": 221.2,
					"lowestAsk": "223.05000000",
					"highestBid": "219.30000000",
					"percentChange": 0.65,
					"baseVolume": 473.91,
					"quoteVolume": 104718.06,
					"high24hr": 234.05,
					"low24hr": 213.63
				}
			}
        

Response description

			baseVolume: Trading volume
			high24hr:Highest price in 24h
			highestBid:Buyer’s highest price
			last:Latest deal price
			low24hr:Lowest price in 24h
			lowestAsk:Seller’s lowest price
			percentChange:Up and down percentage
			quoteVolume: Up and down percentage
	    

5. 5.Single Trading Market Information API

Back to the latest, highest, lowest trading market information and trading volume

URL: https://api.ukex.com/api/index/ticker/[CURR_A]_[CURR_B]

Please replace [CURR_A] and [CURR] _B to the coin you intend to view.

For example

        	# Request
		GET: https://api.ukex.com/api/index/ticker/btc_buc
		# Response
			{
				"result": "true",
				"last": 4580.0416,
				"lowestAsk": "4602.98160000",
				"highestBid": "4556.73100000",
				"percentChange": 4.55,
				"baseVolume": 125.8385,
				"quoteVolume": 566288.6824,
				"high24hr": 4684.9169,
				"low24hr": 4396.5712
			}
        

Response description

			baseVolume: Trading volume
			high24hr:Highest price in 24h
			highestBid:Buyer’s highest price
			last:Latest deal price
			low24hr:Lowest price in 24h
			lowestAsk:Seller’s lowest price
			percentChange:Up and down percentage
			quoteVolume: Trading volume of exchanging coin
	    

6. Market Depth API

Back to current market depth (entrust list), where asks represents order entrusted to be sold and bids represents order entrusted to buy

URL: https://api.ukex.com/api/index/orderBook/[CURR_A]_[CURR_B]

Please replace [CURR_A] and [CURR] _B to the coin you intend to view.

For example

        	# Request
		GET: https://api.ukex.com/api/index/orderBook/btc_buc
		# Response
			{
				"result": "true",
				"asks": [
					[4619.0898, 0.5309],
					[4619.0293, 0.2133],
					[4618.9791, 0.2588],
					[4618.967, 0.6978],
					[4618.8481, 0.0667]
				],
				"bids": [
					[4544.5304, 0.5222],
					[4544.403, 0.2686],
					[4544.3563, 0.1184],
					[4544.2338, 0.0369],
					[4544.2162, 0.4002]
				]
			}
        

Response description

			asks :Seller’s depth
			bids :Buyer’s depth
	    

7. 7.Historical Deal Records API

Back to the latest 80 historical deal records

URL: https://api.ukex.com/api/index/orderBook/[CURR_A]_[CURR_B]

Please replace [CURR_A] and [CURR] _B to the coin you intend to view.

For example

        	# Request
		GET: https://api.ukex.com/api/index/tradeHistory/btc_buc
		# Response
			{
				"result": "true",
				"data": [{
					"tradeID": "14898485",
					"date": "2018-08-22 15:17:08",
					"type": "buy",
					"rate": 4582.0304,
					"amount": 0.4783,
					"total": 2191.58514032
				}],
				"elapsed": "0.0126ms"
			}
        

Response description

			amount: Deal coin amount
			date:Order date
			rate: Coin unit price
			total: Order total amount
			tradeID: tradeID
			type: Buy or sell, buy sell
	    

8.Automatic Trading API

Through the following API, user can use the program control to automatically perform account capital inquiry, place orders, and cancel listing.

Note: Please set the HTTP request header parameter Content-Type in your program as application/x-www-form-urlencoded.

The user first needs to obtain the Key and Secret used by the API interface authentication through this link, and then use Secret as the password in the program, and sign the data that needs POST to the server to get SIGN by SHA512 encryption, and return Key and Sign in the Header of the HTTPS request. Please refer to the following interface description and example program for setting.


1.Obtain account balanceAPI

API URL: https://api.ukex.com/api/private/balances

Parameter data submission method:POST

Parameters: None


For example

        	# Request
		POST: https://api.ukex.com/api/private/balances
		# Response
			{
				"result": "true",
				"available": {
					"BTC": "1000",
					"ETH": "968.8",
					"ETC": "0",
					},
				"locked": {
					"ETH": "1"
					}
			}
        

Response description

			available: Available coin balance
			locked: Frozen coin amount
	    

2.Obtain deposit addressAPI

API URL: https://api.ukex.com/api/private/depositAddress

Parameter data submission method:POST

Parameters

Parameter name Parameter type Required Description
currency String Yes Coin, such as(BTC, LTC)

For example

        	# Request
		POST: https://api.ukex.com/api/private/depositAddress
		# Response
			{
				"result": "true",
				"addr": "LPXtk1kWHioP62SzfqwKbYE3Z7Wt2ujYEc",
				"message": "Sucess",
				"code": 0
			}
        

Response description

			available: Available coin balance
			locked: Frozen coin amount
	    

3. Get Deposits / withdrawals history API

API URL: https://api.ukex.com/api/private/depositsWithdrawals

Parameter data submission method:POST

Parameters

Parameter name Parameter type Required Description
start String No Start UNIX time (for example 1469092370)
end String No End UNIX time (for example 1469713981)

For example

        	# Request
		POST: https://api.ukex.com/api/private/depositsWithdrawals
		# Response
			{
				"result": "true",
				"deposits": [
						{
						"id": "c204730",
						"currency": "ETH",
						"address": "1111 1111 1111 1111 1111 1",
						"amount": "222.61",
						"txid": "210496",
						"timestamp": "1474962729",
						"status": "DONE"
						}
					],
				"withdraws": [
						{
						"currency": "ETC",
						"address": "addr2",
						"amount": "600000000",
						"txid": "2104963",
						"timestamp": "1469092378",
						"status": "DONE"
						}
					],
				"message": "Success"
			}
        

Response description

			deposits: Deposit
			withdraws:Withdrawal
			currency: Coin
			address: Deposit/withdrawal address
			amount:Amount
			timestamp: Initiating time stamp
			status: Record status DONE:; CANCEL:; REQUEST:
	    
	    

4.Place order trading buyingAPI

API URL: https://api.ukex.com/api/private/buy

Parameter data submission method:POST

Parameters:

Parameter name Parameter type Required Description
currencyPair String Yes Trading coin pairs (for exampleltc_btc,ltc_btc)
rate String Yes Price (for example 1000)
amount String Yes Trading volume (for example 10)

For example

        	# Request
		POST: https://api.ukex.com/api/private/buy
		# Response
			{
				"result":"true",
				"orderNumber":"123456",
				"code":"0",
				"message":"Success"
			}
        

Response description

			orderNumber: 
			code: Invalid number
			message:Response message
			result
	    

5.Place order trading sellingAPI

API URL: https://api.ukex.com/api/private/sell

Parameter data submission method:POST

Parameters:

Parameter name Parameter type Required Description
currencyPair String Yes 5.Place order trading sellingAPI
rate String Yes Price (for example 1000)
amount String Yes Trading volume (for example 10)

For example

        	# Request
		POST: https://api.ukex.com/api/private/sell
		# Response
			{
				"result":"true",
				"orderNumber":"123456",
				"code":"0",
				"message":"Success"
			}
        

Response description

			orderNumber: order number:
			code: code:
			message:message
			result:result
	    

6.Cancel order API

API URL: https://api.ukex.com/api/private/cancelOrder

Parameter data submission method:POST

Parameters:

Parameter name Parameter type Required Description
orderNumber String Yes Order No
currencyPair String Yes Trading coin pairs (for example ltc_btc)

For example

        	# Request
		POST: https://api.ukex.com/api/private/cancelOrder
		# Response
			{"result":"true","message":"Success"}
        

Response description

			result: Succeed or not trueSucceed  false Failed
			message: Prompt message
	    

7.Cancel several ordersAPI

API URL: https://api.ukex.com/api/private/cancelOrders

Parameter data submission method:POST

Parameters: Note: The json string of orders_json shall be encapsulated once with urlencode to prevent json strings from being parsed properly.

Parameter name Parameter type Required Description
orders_json String Yes Order number and json data of pair: for example:[ { “orderNumber”:”7942422” “currencyPair”:”ltc_btc” }, { “orderNumber”:”7942423” “currencyPair”:”ltc_btc” } ]

For example

        	# Request
		POST: https://api.ukex.com/api/private/cancelOrders
		# Response
			{"result":"true","message":"Success"}
        

Response description

			result: Succeed or not  true Succeed  false Failed
			message: Prompt message
	    

8.Cancel all orders API

API URL: https://api.ukex.com/api/private/cancelAllOrders

Parameter data submission method:POST

Parameters:

Parameter name Parameter type Required Description
type int Yes Order type (0: sell, 1: buy. -1: no limit)
currencyPair String Yes Trading coin pairs (for example:ltc_btc)

For example

        	# Request
		POST: https://api.ukex.com/api/private/cancelAllOrders
		# Response
			{"result":"true","message":"Success"}
        

Response description

			result: Succeed or not  true Succeed  false Failed
			message: Prompt message
	    

9.Obtain order status API

API URL: https://api.ukex.com/api/private/getOrder

Parameter data submission method:POST

Parameters:

Parameter name Parameter type Required Description
orderNumber int Yes Order No
currencyPair String Yes Trading coin pairs (for example:ltc_btc)

For example

        	# Request
		POST: https://api.ukex.com/api/private/getOrder
		# Response
			{
				"result":"true",
				"order":{
					"orderNumber":"15088",
					"status":"cancelled",
					"currencyPair":"eth_btc",
					"type":"sell",
					"amount":"0.39901357",
					"initialRate":811,
					"initialAmount":"1"
					},
				"message":"Success"
			}
        

Response description


			status:  cancelled  done
			currencyPair: Trading pairs
			type:  sell , buy
			rate: 
			amount: 
			initialRate: 
			initialAmount: 
			orderNumber: 
	    

10.Obtain my current list records API

API URL: https://api.ukex.com/api/private/openOrders

Parameter data submission method:POST

Parameters:

Parameter name Parameter type Required Description
currencyPair String No Trading coin pairs (for example:eth_btc)

For example

        	# Request
		POST: https://api.ukex.com/api/private/openOrders
		# Response
			{
				"result": "true", "message": "Success", "code": 0,"elapsed": "6.262ms",
				"orders": [
						{
						"orderNumber": "30032151",
						"type": "buy",
						"amount": "0.0936",
						"total": "2000",
						"initialRate": 21367.521367521,
						"initialAmount": "0.0936",
						"filledAmount": 0,
						"currencyPair": "eth_btc",
						"timestamp": "1407828913",
						"status": "open"
						}
					]
				}
        

Response description

			Total amount of orders and remaining orders not dealt
			currencyPair:
			Completed amount
			initialAmount: 
			initialRate: 
			orderNumber:
			status:
			timestamp: 
			total: 
			type: buy: ;sell: 
	    

11.Obtain my trading records in 24h API

API URL: https://api.ukex.com/api/private/tradeHistory

Parameter data submission method:POST

Parameters:

Parameter name Parameter type Required Description
currencyPair String Yes Trading coin pairs (for example:eth_btc)
orderNumber int No order Number

For example

        	# Request
		POST: https://api.ukex.com/api/private/openOrders
		# Response
			{
				"result": "true",
				"message": "Success",
				"trades": [
						{
						"id": "7942422",
						"orderid": "38100491",
						"pair": "ltc_btc",
						"type": "buy",
						"rate": "0.01719",
						"amount": "0.0588",
						"time": "06-12 02:49:11",
						"time_unix": "1402512551"
						}
					]
			}
        

Response description

			id: Deal ID
			orderid: Order ID
			pair: Trading pairs
			type: Buying or selling
			rate: Buy or sell price
			amount: Order buying or selling coin volume
			time: Order time
			time_unix: Order unix time stamp
	    

12.Withdrawal API

API URL: https://api.ukex.com/api/private/withdraw

Parameter data submission method:POST

Parameters:

Parameter name Parameter type Required Description
currency string Yes Withdrawal coin(如:btc)
amount string Yes Withdrawal amount
address string Yes Withdrawal amount

For example

        	# Request
		POST: https://api.ukex.com/api/private/withdraw
		# Response
			 {"result": "true",  "message": "Success"}
        

Response description

			result: Succeed or not  true Request succeed  false Request failed
			message: Prompt message
	    

13.Obtain deposit address API

API URL: https://api.ukex.com/api/private/depositAddress

Parameter data submission method:POST

Parameters:

Parameter name Parameter type Required Description
currency string Yes Withdrawal coin(for example:btc)

For example

        	# Request
		POST: https://api.ukex.com/api/private/depositAddress
		# Response
			{
				"result": "true",
				"addr": "LPXtk1kWHioP62SzfqwKbYE3Z7Wt2ujYEc",
				"message": "Sucess",
				"code": 0
			}
        

Response description

			addr: Withdrawal coin(for example:btc)
	    

9.API Request Description

Request address https://api.ukex.com

Obtain address:https://www.ukex.com/user/apiKey

Use Secret as the password in the program, and sign the data that needs POST to the server to get SIGN by SHA512 encryption, and return Key and Sign in the Header of the HTTPS request.

PHP Request For example

			$post_data = http_build_query($req, ‘’, ‘&’);	// Is the array of parameters requested
			$sign = hash_hmac(‘sha512’, $post_data, $secret);
			$headers = array(
			‘KEY: ‘.$key,
			‘SIGN: ‘.$sign
			);
			static $ch = null;
			if (is_null($ch)) {
			$ch = curl_init();
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
			curl_setopt($ch, CURLOPT_USERAGENT, ‘Mozilla/4.0 (compatible; bvmall PHP bot; ‘.php_uname(‘a’).’; PHP/‘.phpversion().’)’);
			}
        
			curl_setopt($ch, CURLOPT_URL, https://api.ukex.com/api/'.$path);	// $path is the interface of the various methods above, such as get the transaction pair here $path = 'index/pairs';
			curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
			curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
			curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
			curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
			$res = curl_exec($ch);

			Response description: Respond data type default json result is status, and true represents success, while false represents failure