All interfaces call the domain name:api.coinw.ai
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": {
    "date": 1478758913,
    "asks": [
      [
        5003.68,
        0.275
      ]
    ],
    "bids": [
      [
        4903.66,
        0.075
      ]
    ]
  }
}
                                    
										
Return value specification
											
    date : 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,
  "data": {
    "high": 4962.03,
    "vol": 1633159.5247,
    "last": 4899.26,
    "low": 4876,
    "buy": 4898.93,
    "sell": 4899.26
  }
}
                                    
										
Return value specification
											
high: High 24h
vol: Volume 24h
last: Latest Price
low: Lowest Price
buy: BUY 1 Price
sell: SELL 1 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
/user/api.htmlAPI authentication method description
Instruction
											
> 1. Obtain apiKey and secretKey for API authentication
 Apply API will obtain apiKey and secretKey, the apiKey is the private key for accessing API, while secretKey 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 secretKey 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 注意“&secret_key=secretKey” 为签名必传参数。
 利用32位MD5算法 对最终待签名字符串进行签名运算,从而得到签名结果字符串(该字符串赋值于参数 sign),MD5计算结果中字母全部大写。
                                    
										
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
symbolToken (see below)
typeOrder amount
amountOrder price
priceCancel
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
idOrder id
POST /appApi.html?action=tradePlace order

BTC /appApi.html?action=trade&symbol=1&type=buy&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": null
}
                                    
										
Return value specification
											code : Return code
msg  : Return Message
time : timestamp(ms)
data : Carry data
                                    
										
Request Parameter
ParameterDesciption
symbolToken (see below)
typeOrder amount
amountOrder price
priceCancel
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": null
}
                                    
										
Return value specification
											code : Return code
msg  : Return Message
time : timestamp(ms)
data : Carry data
                                    
										
Request Parameter
ParameterDesciption
symbolToken (see below)
POST /appApi.html?action=lastentrustGet the latest 10 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 10 records in one time"",
  "time": 1486203073756,
  "data": null
}
                                    
										
Return value specification
											code : Return code
msg  : Return Message
time : timestamp(ms)
data : Carry data
                                    
										
Request Parameter
ParameterDesciption
symbolToken (see below)
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": null
}
                                    
										
Return value specification
											code : Return code
msg  : Return Message
time : timestamp(ms)
data : Carry data
                                    
										
Request Parameter
ParameterDesciption
idOrder id :1
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 Balance
frozen	: Frozen Assets
asset	: Total Assets
                                    
										
Request Parameter
ParameterDesciption
 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
withdraw_idWithdraw request id
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
symbolToken (see below)
amountAmount
withdrawaddressVerified withdrawal address
memoCertain token may require
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": []
}
                                        
										
Return value specification
											code : Return code
msg  : Return Message
time : timestamp(ms)
data : Carry data
                                        
										
Request Parameter
ParameterDescription
symbolToken: (see below)
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": []
}
                                        
										
Return value specification
											code : Return code
msg  : Return Message
time : timestamp(ms)
data : Carry data
                                        
										
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