API document

Instructions

  1. API Server path  https://api.ex.cash/
  2. request process description
    • Post Method & Get Method
      • Post method Required parameters
        • api_key
        • sign
    • Sign generation rules
      • post api afferent parameter, sorting by parameter names,the ordering rules are ABCD alphabetical order,if you meet the same initial letter,look at the second letters.
      • splicing the sorted parameters in the form of key values eg:key1=value1&key2=value3&...&secret_key=secret key
      • 32 bit MD5 encryption for key1
      • convert the MD5 string to uppercase
    • Get method parameters
      • GET mode does not need to generate sign encrypted strings, Parameter transmission according to the actual parameters of the interface
  3. safety certification
    • All private API needs to be authenticated, Application of api, You can get to APP, template of me, choice api setting, apply for private and public keys, if lost, please use a certified cell phone to reset the API
    • Note: do not reveal these two parameters to anyone. This is as important as your password.

API Reference

  1. Get the latest currency quota
  2. Path: https://api.ex.cash/api/ticker

    Request type: GET

    Parameters:

    parameter name parameter type required description
    symbol String No(default: wtc_eth ) trade market

    Results:

    {
    	"market": "wtc_eth",  	// trading market
    	"date": 1508739998,  	// time
    	"ticker": {
    		"buy": "0.04760000",   // first buy price
    		"high": "0.05070000",  // highest price
    		"last": "0.04880000",  // latest price
    		"low": "0.04840000",   // minimum price
    		"sell": "0.04880000",  // first sell price
    		"vol": "4.34400000"    // volume
    	},
    	"code": 200  // state code
    }						
  3. Market depth
  4. Path: https://api.ex.cash/api/depth

    Request type: GET

    Parameters:

    parameter name parameter type required description
    symbol String Yes trade market
    size Integer No(default 200)

    Results:

    {
    	"asks": "[[0.25000000,0.25000000],[0.22000000,13.33790000],[0.08999800,0.03410400],[0.07900000,0.40000000],[0.07780000,0.40000000],[0.07770000,1.00000000],[0.07700000,0.30000000],[0.07620000,0.58000000],    [0.07600000,0.50000000],[0.07580000,1.02000000],[0.07500000,0.03800000],[0.07470000,1.03350000],[0.07460000,0.11140000],[0.05880000,9.57290000],[0.05140000,0.51600000]]",  // Seller depth
    	"bids": "[[0.04500000,1.00000000],[0.04000000,1.00000000],[0.03800000,2.00000000],[0.03500000,1.28000000],[0.03200000,2.60000000],[0.03000000,0.05970000],[0.02800000,0.60000000],[0.02500000,0.80000000],[0.01800000,3.00000000],[0.01000000,0.49989900]]"  // Buyer depth
    }						
  5. Get user assets
  6. Path: https://api.ex.cash/api/userinfo

    Request type: POST

    Parameters:

    parameter name parameter type required description
    api_key String Yes api_key
    sign String Yes sign
    coin String No Check the coin of the balance

    Results:

    {
    	"result": "true",    // return status
    	"asset": {         // account available balance
    		"btc": "0.14600000",
    		"eth": "0.05780000",
    		"ltc": "0.15780000",
    	},
    	"freezed": {         // account freeze balance
    		"btc": "0.04790000",
    		"eth": "0.48770000",
    		"ltc": "0.35480000",
    	},
    	"code": 200  // state code
    }						
  7. Get user's order
  8. Path: https://api.ex.cash/api/orders_info_by_status

    Request type: POST

    Parameters:

    parameter name parameter type required description
    api_key String Yes api_key
    sign String Yes sign
    symbol String no trade market
    status Integer no Order status(default 0)

    Results:

    {
    	"result": "true",     // return status
    	"orders": {
    		"amount": "100",  // volume of transactions
    		"create_date": "1508739998",  // time
    		"deal_amount": "57",  // trade volume
    		"order_id": "1024",  // order id
    		"price": "0.05780000",  // trade price
    		"fee": "0.00058000",  // trade fee
    		"type": "1",     // 1 buy/2 sell
    		"status": "0",  // order status(0:trading,1:over trade,2:cancel)
    	},
    	"code": 200  // state code
    }						
  9. Get user’s completed order
  10. Path: https://api.ex.cash/api/user_trade

    Request type: POST

    Parameters:

    parameter name parameter type required description
    api_key String Yes api_key
    sign String Yes sign
    symbol String no trade market
    tradeType Integer No(default 2) order type(1:buy/2:sell)
    times String No After time order (default 0)

    Results:

    {
    	"result": "true",  // return code
    	"orders": {
    		"id": "1475",  // order id
    		"userid": "14204",  // buyer id
    		"peerid": "12470",  // seller id
    		"num": "10",  // trade number
    		"market": "1024",  // trade market
    		"price": "0.05780000",  // trade price
    		"type": "1",   // 1:buy/2:sell
    		"addtime": "1508739998",  // time
    	},
    	"code": 200  // state code
    }
  11. trading
  12. Path: https://api.ex.cash/api/trade

    Request type: POST

    Parameters:

    parameter name parameter type required description
    api_key String Yes api_key
    sign String Yes sign
    symbol String Yes trade market
    price Double Yes trade price
    amount Double Yes trade number
    tradeType Integer Yes order type(1:buy/2:sell)
    fee Double NO fee

    Results:

    {
    	"result": "true",   // return code
    	"id": "1475",  // order id
    	"code": 200  // state code
    }
  13. batch trade
  14. Path: https://api.ex.cash/api/batch_trade

    Request type: POST

    Parameters:

    parameter name parameter type required description
    api_key String Yes api_key
    sign String Yes sign
    orders_data Integer Yes [{'price':3,'amount':5,'type':1,'symbol':'trx_eth'}, {'price':3,'amount':3,'type':1,'symbol':'trx_eth'}]
    fee Double NO fee

    Results:

    {
    	"result": "true",   // return code
    	"order_info":"{order_id:1564},{order_id:1565},{order_id:-1,code:1019}",// orders info
    	"code":200  // state code
    }

    Remarks:

    As long as any one of the single orders is successful, return to ture.The order information returned is consistent with the order order uploaded by orders_data.

    If order fails: order_id is -1, code is error code.

  15. cancel order
  16. Path: https://api.ex.cash/api/cancel_order

    Request type: POST

    Parameters:

    parameter name parameter type required description
    api_key String Yes api_key
    sign String Yes sign
    order_id String Yes order id(Multiple order ID is separated by ",")

    Results:

    {
    	"success": "1564,1454",  // successful order id
    	"error": "1248,1472",    // failed order id
    }
  17. Get user's order based on ID
  18. Path: https://api.ex.cash/api/order_info

    Request type: POST

    Parameters:

    parameter name parameter type required description
    api_key String Yes api_key
    sign String Yes sign
    order_id String Yes order id

    Results:

    {
    	"result": "true",  // return code
    	"orders": {
    		"amount": "100",  // trade number
    		"create_date": "1508739998",  // order time
    		"deal_amount": "57",  // trade volume
    		"order_id": "1024",  // order id
    		"price": "0.05780000",  // trade price
    		"fee": "0.00058000",   // trade fee
    		"type": "1",  // 1:buy/2:sell
    		"status": "0",  // order status(0:trading,1:over trade,2:cancel)
    	},
    	"code": 200   // state code
    }
  19. Batch get of a user's order
  20. Path: https://api.ex.cash/api/orders_info

    Request type: POST

    Parameters:

    parameter name parameter type required description
    api_key String Yes api_key
    sign String Yes sign
    order_id String Yes order id

    Results:

    {
    	"result": "true",  // return code
    	"orders": [{
    		"amount": "100",  // trade number
    		"create_date": "1508739998",// time
    		"deal_amount": "57", // trade volume
    		"order_id": "1024",  // order id
    		"price": "0.05780000",  // trade price
    		"fee": "0.00058000",  // fee
    		"type": "1",  // 1、buy/2、sell
    		"status": "0",  // order status(0:trading,1:over trade,2:cancel)
    	},
    	{
    		"amount": "105",
    		"create_date": "150874889",
    		"deal_amount": "0",
    		"order_id": "1044",
    		"price": "0.05980000",
    		"fee": "0.00059000",
    		"type": "1",
    		"status": "0",
    	}],
    	"code": 200   // state code
    }
    
    
  21. Get market trade pair
  22. Path: https://api.ex.cash/api/get_market

    Request Type: GET

    Parameters:

    parameter name parameter type required description
    symbol String No market trade pair (if parameter is null, return all market trade pair)

    Results:

    {
        "result": "true",	// return code
        "markets": [
            {
                "symbol": "wp_eth",			// market trade pair
                "max_price": "0.00000000",	// highest price
                "min_price": "0.00000000",	// minimum price
                "volume": "0.00000000",		// trade volume
                "num_round": "2",			// number accuracy
                "round": "6",				// price accuracy
                "trade_min": "1",			// miminum trade amount for single
                "trade_max": "10000",		// max trade amount for single
                "buy_min": "0.000001",		// miminum trade price for buy
                "buy_max": "10000",			// max trade price for buy
                "sell_min": "0.000001",		// miminum trade price for sell
                "sell_max": "10000",		// max trade price for sell
                "last_price": 1,			// last trade price
                "last_num": 100,			// last trade volume
                "last_time": "1527580640",	// last timestamp
                "buy_price": 0,				// 1st buy price
                "buy_num": 0,				// 1st buy quantity
                "sell_price": 0,			// 1st sell price
                "sell_num": 0				// 1st sell quantity
                "change": 0				    // rise and fall
            }
        ],
        "code": 200 // state code
    }
    

Code status

code describe
200 Success
10000 Not post submission
10001 API format error
10002 APIKey does not exist
10003 Sign signature error
1001 trading market is empty
1002 trading market does not exist
1003 trading price error
1004 trading number error
1005 trading type error
1006 buying fees exceed the scope
1007 selling fee is beyond the scope
1008 current market prohibition of trading
1009 system error
1010 trading prices exceed the maximum limit
1011 trading prices exceed the minimum limit
1012 trading prices exceed the limit of today's increase
1013 trading prices exceed the limit of today's decline
1014 balance is not enough
1015 the total amount of the list exceeds the system limit
1016 tradable volume error
1017 total transaction error
1018 data error
1019 transaction failure
1020 not found order’s id
1021 order does not exist
1022 parameters error
1023 order cannot be revoked
1024 revocation failure
1025 mass list failure
1026 number format error
1027 wallet address format error
1028 transaction password format error
1029 currency format error
1030 need real name photo authentication
1031 network service fee error