All interfaces call the domain name:api.coinw.sh
API Introduction

Welcome to CoinW developer documentations. Coinw API current support three group of actions: market ticker, trading and withdrawal

Trading and withdrawal actions related API would require signature verification

API Instruction
Currently, API only accepts HTTP POST requests, API functions are selected via the action parameter in the POST requests.
API authentication method description
1. Obtain api key and secret key for API authentication
Apply API will obtain api key and secret key, the api key is the private key for accessing API, while secret key is used to sign parameters in request. Caution: Please do not disclose these two parameters under any circumstances, it is crucial to your account security.
2. Generate strings to be signed
every parameter user submitted has to be signed except for the sign parameter itself string to be signed require to be ordered by parameter name (the first letter of the parameter names arranged alphabetically, in case the first letters are the same, then refer to he second letter) Example: sign on the following parameters: string [] parameters={"api_key=c821db84-6fbd-11e4-a9e3-c86000d26d7c","symbol=btc_cny"type=0"price=680"amount=1.0"}; Generate string to be signed: amount=1.0&api_key=c821db84-6fbd-11e4-a9e3-c86000d26d7c&price=680&symbol=btc_cny&type=0
3. MD5 signature
During MD5 signature, it requires secret key to be in the signature. Add secretKey in the sign string to generate the final signed string For example: amount=1.0&api_key=c821db84-6fbd-11e4-a9e3-c86000d26d7c&price=680&symbol=btc_cny&type=0&secret_key=secretKey Please note: “&secret_key=secretKey” is the required parameter as API signature Utilising 32bit MD5 algorithm to calculate a hash value for the string as the "sign" value, please convert the MD5 hashing value to all upper case letters.
Basic API
To obtain Coinw Trading Market basic information including trading pair "symbol" that can be used in other API calls. Therefore, it is advised to call this API first to obtain necessary information before calling other API
APIDesciption
POST /appApi.html?action=currencysCheck all token information

BTC /appApi.html?action=currencys

Example
										# Request
POST /appApi.html?action=currencys
# Response
{
"code": 200,
"msg": Obtain token and trading pair symbol,
"time": 1486203073756,
"data": {
	"BTC": {
            "shortName": "BTC",
            "lastUpdateTime": 1564987681191,
            "name": "BTC",
            "id": 1,
            "withDraw": "1",
            "recharge": "0",
            "maxQty": 100,
            "minQty": 0.02,
            "txFee": 0
        }
}
									
									
Return value specification
										code : Return code
msg  : Return Message
time : timestamp(ms)
data : Carry data {"BTC": {
            "shortName": name,
            "lastUpdateTime": Last update time,
            "name": full name,
            "id": ID,
            "withDraw": permission to withdraw
            "recharge": permission to deposit
            "maxQty": maximum withdrawal amount,
            "minQty": minimum withdrawal amount,
            "txFee": Fees
        }
}
									
									
POST /appApi.html?action=symbolsindex all trading pair information

BTC /appApi.html?action=symbols

Example
											# Request
	POST /appApi.html?action=symbols
	# Response
	{
	"code": 200,
	"msg": Obtain token and trading pair symbol,
	"time": 1486203073756,
	"data": [{
				"symbol": 29,
				"base-currency": "CNYT",
				"quote-currency": "USDT",
				"lastUpdateTime": 1564987947865,
				"latestDealPrice": "100.0",
				"lowestPrice": "0.0",
				"highestPrice": "0.0",
				"24Total": "0.0",
				"fStatus": "1"
			}]
										
										
Return value specification
											code : Return code
	msg  : Return Message
	time : timestamp(ms)
	data : Carry data [{
				"symbol": symbol,
				"base-currency": base coin,
				"quote-currency": quote coin,
				"lastUpdateTime": Last update time,
				"latestDealPrice": latest price,
				"lowestPrice": lowest buy price,
				"highestPrice": highest sell price,
				"24Total": base coin trading volume / 24 hours,
				"fStatus": permission to trade
			}]
										
										
POST /appApi.html?action=getSymbolCheck token corresponding to Symbol and corresponding trading pairs.

BTC /appApi.html?action=getSymbol

Example
											# Request
POST /appApi.html?action=getSymbol
# Response
{
  "code": 200,
  "msg": Obtain token and trading pair symbol,
  "time": 1486203073756,
  "data": {
	"币种symbol": "3-BC  4-LTC  6-HC  7-STX"
	"交易对symbol": "2:BC/CNYT  3:LTC/CNYT  5:HC/CNYT  6:STX/CNYT  7:0X/CNYT  8:CDT/CNYT ..."
												}
}
                                        
										
Return value specification
											code : Return code
msg  : Return Message
time : timestamp(ms)
data : Carry data "交易对symbol":Pair,format: "symbol:market BC/CNYT market symbol is "2"
                                        
										
Market API
Get the latest market information of Coinw
APIDesciption
POST /appApi.html?action=depthGet market depth

BTC /appApi.html?action=depth&symbol=1

Example
											# Request
POST BTC /appApi.html?action=depth&symbol=1
# Response
{
  "code": 200,
  "msg": "Get market depth",
  "time": 1486203073756,
  "data": {
    "bids": [
            {
                "id": 1,
                "price": "0.0051",
                "amount": "12000.000"
            },
            {
                "id": 2,
                "price": "0.0035",
                "amount": "156581.460"
            },
            {
                "id": 3,
                "price": "0.003",
                "amount": "5000.000"
            } ...
			],
	"asks": [
            {
                "id": 1,
                "price": "0.0058",
                "amount": "6752.000"
            },
            {
                "id": 2,
                "price": "0.0059",
                "amount": "252484.713"
            },
            {
                "id": 3,
                "price": "0.0061",
                "amount": "290360.742"
            } ...
			]
  }
}
                                    
										
Return value specification
											
    time : The timestamp of returning data
    asks : Seller Depth
    bids : Buyer Depth
                                    
										
Request Parameter
ParameterDesciption
symbolToken (see below)
sizeDepth: Maximum 10 (Default 10)
POST /appApi.html?action=klineReturn value specification

BTC /appApi.html?action=kline&symbol=1&step=60

Example
											
# Request
POST /appApi.html?action=kline&symbol=1&step=60
# Response
{
  "code": 200,
  "msg": Return value specification,
  "time": 1486203073756,
  "data": "[[1478746261695,4939.32,4939.97,4938.74,4939.58,446.9005]]"
}
                                    
										
Return value specification
											
[
	1478746261695,		timestamp
	4939.32,		Open
	4939.97,		High
	4938.74,		Low
	4939.58,		Close
	446.9005		Volume 24h
]
                                    
										
Request Parameter
ParameterDesciption
symbolTrading pair is detailed below.
step 60(1m),60*3(3m),60*5(5m),60*15(15m),60*30(3m),60*60(1h),60*60*2(2h),60*60*4(4h),60*60*6(6h),
  60*60*12(12h),60*60*24(1d),60*60*24*3(3d),60*60*24*7(1w)
startdate ( Optional )K line data starting timestamp, such as 1533723498
enddate ( Optional )K line data ending timestamp, such as 1533723498
type ( Optional )Whether to get the latest data only, 1: Yes; 0: no.
POST /appApi.html?action=marketGet enabled market information

BTC /appApi.html?action=market&symbol=1

Example
											
# Request
POST /appApi.html?action=market&symbol=1
# Response
{
  "code": 200,
  "msg": Get enabled market information,
  "time": 1486203073756,
  "buy": 0.276,
  "sell": 0.2948,
  "data": {
        "last": 0.2763,
        "high": 0.2948,
        "low": 0.275,
        "vol": 1.9877
    }
}
                                    
										
Return value specification
											
buy: BUY 1 Price
sell: SELL 1 Price

high: High 24h
low: Lowest Price
vol: Volume 24h
last: Latest Price
                                    		
										
Request Parameter
ParameterDesciption
symbolToken (see below)
POST /appApi.html?action=tradesGet the latest trade data

BTC /appApi.html?action=trades?&symbol=1

Example
											
# Request
POST /appApi.html?action=trades&symbol=1
# Response
{
  "code": 200,
  "msg": Get the latest trade records,
  "time": 1486203073756,
  "data": [
    {
      "amount": 1.7931,
      "price": 4906.49,
      "id": 1,
      "time": "15:59:24",
      "en_type": "ask",
      "type": "卖出"
    }
}
                                    
										
Return value specification
											amount: Trading volume
price: Trading price
id: Data ID
time: Transaction time
en_type: Operation type ask/bid
type: Operation type ask/bid
                                    
										
Request Parameter
ParameterDesciption
symbolToken (see below)
Trade API
Place order on Coinw
APIDesciption
POST /appApi.html?action=tradePlace order

BTC /appApi.html?action=trade&symbol=1&type=0&amount=1&price=5000

Example
											# Request
POST /appApi.html?action=trade&symbol=1&type=buy&amount=1&price=5000
# Response
{
  "code": 200,
  "msg": "Place order successfully",
  "time": 1486203073756,
  "data": 123
}
                                    
										
Return value specification
											code : Return code
msg  : Return Message
time : timestamp(ms)
data : Carrying data (order number)
                                    
										
Request Parameter
ParameterDesciption
amountOrder price
api_keyThe api_key associated to your account
priceCancel
symbolToken (see below)
typeOrder amount
signsigned parameter string, method for signature please refer to authorisation instruction
POST /appApi.html?action=trade_batchBulk order

BTC /appApi.html?action=trade_batch&combination=1,0,1,5000:1,0,1,5000:1,0,1,5000

Example
											# Request
POST /appApi.html?action=trade_batch&combination=1,0,1,5000:1,0,1,5000:1,0,1,5000
# Response
{
  "code": 200,
  "msg": "Place order successfully",
  "time": 1486203073756,
  "data": [123,321,111]
}
                                    
										
Return value specification
											code : Return code
msg  : Return Message
time : timestamp(ms)
data : The returned data is the id of the successful order. If multiple successes, it is returned by array.
Only part of the bulk orders may be successfully purchased due to money issues. Please carefully review the data after ordering to avoid repeated orders. The bulk supports up to 100
                                    
										
Request Parameter
ParameterDesciption
api_keyThe api_key associated to your account
signsigned parameter string, method for signature please refer to authorisation instruction
combinationBulk order combination data symbol: currency ID type: transaction type 0 buy 1 sell amount: quantity price: unit price symbol, type, amount, price: symbol, type, amount, price It is divided into a group with ":", separated by ","
POST /appApi.html?action=cancel_entrustCancel

BTC /appApi.html?action=cancel_entrust?id=1

Example
											# Request
POST /appApi.html?action=cancel_entrust?id=1
# Response
{
  "code": 200,
  "msg": Cancel successfully,
  "time": 1486203073756,
  "data": null
}
                                    
										
Return value specification
											code : Return code
msg  : Return Message
time : timestamp(ms)
data : Carry data
                                    
										
Request Parameter
ParameterDesciption
api_keyThe api_key associated to your account
idOrder id
signsigned parameter string, method for signature please refer to authorisation instruction
POST /appApi.html?action=cancel_entrust_batchBulk cancel

BTC /appApi.html?action=cancel_entrust_batch&ids=1,3,5

Example
											# Request
POST /appApi.html?action=cancel_entrust_batch&ids=1,3,5
# Response
{
  "code": 200,
  "msg": "Place order successfully",
  "time": 1486203073756,
  "data": [123,321,111]
}
                                    
										
Return value specification
											code : Return code
msg  : Return Message
time : timestamp(ms)
data : The returned data is the id of the unsuccessfully canceled order. If multiple exists, it is returned by [123,321,111]. All succeed, return empty, code is 200
                                    
										
Request Parameter
ParameterDesciption
api_keyThe api_key associated to your account
signsigned parameter string, method for signature please refer to authorisation instruction
idsIDs are seperated by ","
POST /appApi.html?action=cancel_entrust_allAll cancel

BTC /appApi.html?action=cancel_entrust_all

Example
											# Request
POST /appApi.html?action=cancel_entrust_all
# Response
{
  "code": 200,
  "msg": "Place order successfully",
  "time": 1486203073756
}
                                    
										
Return value specification
											code : Return code
msg  : Return Message
time : timestamp(ms)
                                    
										
Request Parameter
ParameterDesciption
api_keyThe api_key associated to your account
signsigned parameter string, method for signature please refer to authorisation instruction
POST /appApi.html?action=entrustOrder History

BTC /appApi.html?action=entrust&symbol=1

Example
											# Request
POST /appApi.html?action=entrust&symbol=1
# Response
{
  "code": 200,
  "msg": View open orders,
  "time": 1486203073756,
  "data": [
        {
            "prize": 0.18,
            "count": 70,
            "success_count": 0,
            "amount": 12.6,
            "success_amount": 0,
            "type": 0,
            "type_s": "买入",
            "status": 1,
            "status_s": "未成交",
            "createTime": 1564987474000,
            "id": 270532666
        }
    ]
}
                                    
										
Return value specification
											code : Return code
msg  : Return Message
time : timestamp(ms)
data : Carry data

prize: price
count: amount
success_count: Total Completed Amount
amount: total
success_amount: Total Completed Volume
type: Order amount
type_s: type description
status: Status: 1-incompleted、2.-Partial completed、3.-Completed、4.-Canceled
status_s: status description
createTime: create time
id: Order ID
                                    
										
Request Parameter
ParameterDesciption
api_keyThe api_key associated to your account
symbolToken (see below)
signsigned parameter string, method for signature please refer to authorisation instruction
POST /appApi.html?action=lastentrustGet the latest 100 executed orders

BTC /appApi.html?action=lastentrust&symbol=1

Example
											# Request
POST /appApi.html?action=lastentrust&symbol=1
# Response
{
  "code": 200,
  "msg": "Get multiple orders info, return 100 records in one time",
  "time": 1486203073756,
  "data": [
        {
            "prize": 10,
            "count": 1,
            "success_count": 1,
            "amount": 10,
            "success_amount": 0.2872,
            "type": 0,
            "type_s": "买入",
            "status": 3,
            "status_s": "完全成交",
            "update_time": 1486203073756
        }
    ]
}
                                    
										
Return value specification
											code : Return code
msg  : Return Message
time : timestamp(ms)
data : Carry data

prize: price
count: amount
success_count: Total Completed Amount
amount: total
success_amount: Total Completed Volume
type: Order amount
type_s: type description
status: Status: 1-incompleted、2.-Partial completed、3.-Completed、4.-Canceled
status_s: status description
update_time: timestamp(ms)
                                    
										
Request Parameter
ParameterDesciption
api_keyThe api_key associated to your account
symbolToken (see below)
signsigned parameter string, method for signature please refer to authorisation instruction
POST /appApi.html?action=orderOrder History

BTC /appApi.html?action=order&id=1

Example
											# Request
POST /appApi.html?action=order&id=1
# Response
{
  "code": 200,
  "msg": Get order details by order id,
  "time": 1486203073756,
  "data": [
        {
            "prize": 0.18,
            "count": 70,
            "success_count": "0.000",
            "amount": 12.6,
            "success_amount": 0,
            "type": 0,
            "type_s": "买入",
            "status": 1,
            "status_s": "未成交",
            "id": 270532666
        }
    ]
}
                                    
										
Return value specification
											code : Return code
msg  : Return Message
time : timestamp(ms)
data : Carry data

prize: price
count: amount
success_count: Total Completed Amount
amount: total
success_amount: Total Completed Volume
type: Order amount
type_s: type description
status: Status: 1-incompleted、2.-Partial completed、3.-Completed、4.-Canceled
status_s: status description
id: Order ID
                                    
										
Request Parameter
ParameterDesciption
api_keyThe api_key associated to your account
idOrder id :1
signsigned parameter string, method for signature please refer to authorisation instruction
POST /appApi.html?action=userinfoGet User's assets

BTC /appApi.html?action=userinfo

Example
											# Request
POST /appApi.html?action=userinfo
# Response
{
  "code": 200,
  "msg": successful,
  "time": 1486203073756,
  "data": {
    "frozen": {
      "BTC": 0,
      "ETC": 0,
      "LTC": 0,
      "CNY": 0 ...
    },
    "free": {
      "BTC": 0,
      "ETC": 0,
      "LTC": 0,
      "CNY": 0 ...
    }
  }
}
                                    
										
Return value specification
											code 	: Return code
msg  	: Return Message
data 	: Carry data
free	: Available
frozen	: Frozen

                                    
										
Request Parameter
ParameterDesciption
api_keyThe api_key associated to your account
signsigned parameter string, method for signature please refer to authorisation instruction
 WithdrawAPI
For token's withdrawal
APIDesciption
POST /appApi.html?action=cancel_withdrawCancel withdraw

BTC /appApi.html?action=cancel_withdraw&id=1

Example
											# Request
POST /appApi.html?action=cancel_withdraw?id=1
# Response
{
  "code": 200,
  "msg": Cancel withdraw successfully,
  "time": 1486203073756,
  "data": null
}
                                        
										
Return value specification
											code : Return code
msg  : Return Message
time : timestamp(ms)
data : Carry data
                                        
										
Request Parameter
ParameterDesciption
api_keyThe api_key associated to your account
withdraw_idWithdraw request id
signsigned parameter string, method for signature please refer to authorisation instruction
POST /appApi.html?action=withdrawRequest to withdraw

BTC /appApi.html?action=withdraw&symbol=1&amount=1&withdrawaddress=123456

Example
											# Request
POST /appApi.html?action=withdraw?symbol=1&amount=1&withdrawaddress=123456
# Response
{
  "code": 200,
  "msg": Withdraw successfully, please wait for proccessing.,
  "time": 1486203073756,
  "data": null
}
                                        
										
Return value specification
											code : Return code
msg  : Return Message
time : timestamp(ms)
data : Carry data
                                        
										
Request Parameter
ParameterDesciption
amountAmount
api_keyThe api_key associated to your account
memoCertain token may require
symbolToken (see below)
withdrawaddressVerified withdrawal address
signsigned parameter string, method for signature please refer to authorisation instruction
POST /appApi.html?action=withdraw_recordGet digital asset withdrawal history

BTC /appApi.html?action=withdraw_record?symbol=1

Example
											# Request
POST /appApi.html?action=withdraw_record?symbol=1
# Response
{
  "code": 200,
  "msg": Get digital asset withdrawal history,
  "time": 1486203073756,
  "data": [
		{
            "amount": 12.6,
            "fees": 0,
            "withdraw_virtual_address": xxx,
            "createTime": 1486203073756,
            "status": 3
            "status_s": "提现成功"
		}
   ]
}
                                        
										
Return value specification
											code : Return code
msg  : Return Message
time : timestamp(ms)
data : Carry data

amount: Amount
fees:	Transaction Fee
withdraw_virtual_address: Withdrawal Address
createTime: create time
status:	Status: 1-incompleted、2.-Partial completed、3.-Completed、4.-Canceled
status_s: status description
                                        
										
Request Parameter
ParameterDescription
api_keyThe api_key associated to your account
symbolToken: (see below)
signsigned parameter string, method for signature please refer to authorisation instruction
Error code
All API method invocations will return data to users in JSON format when fail to request or encounter unknown error.
Error codeDescription
200Success
500Failed
10001Network error
10002API non-existed
10003Parameter error
10004Permission denied
10005No premission to withdraw
10006api_key error
10007signature error