安心・安全なビットコイン(bitcoin)取引所Btcbox
ホーム > ヘルプ > API
REST API

Getting Started

The first step is to get the API public key and private key

Request the transaction API, need to obtain the public key and private key, click the application。

Note: the key related to your account security, please do not leak to anyone ,Click Apply

The second step, signature

1、Collect the necessary parameters for signature as follows ( take Balance as a sample: check the request parameters, excluding the signature itself)

Request parameters: Take Balance as an example

key signature coin nonce
Public API Key Signature Currency Self-incrementing

2、Combine above parameters to a string like:key=xxxxxx&coin=btc&nonce=1508482053

3、 To make the signature, use HMacSHA256 function to encrypt the above string. The encryption key is your private API key digested by MD5 algorithm

4、Submit the signature and other parameters to API.

NOTE: 1.Please make sure the result of MD5 digest should be all lowercase (otherwise you need to transfer it manually).

2. The order of parameters when generating signature must be the same as that when submitting.

API Reference

Ticker

URI: /api/v1/ticker

Request Method: GET

Parameters Description

Parameter Description
coin btc , ltc , doge , bch. Default: btc

Sample Response

  {
    "high":39700,
    "low":36300,
    "buy":1.879,
    "sell":0,
    "last":38800,
    "vol":283.954
  }

Response Description

Parameter Description
high The highest price in the past 24 hours.
low The lowest price in the past 24 hours.
buy The current highest bid price.
sell The current lowest ask price.
last The price of the latest deal.
vol The total deal amount in the past 24 hours.

Account Balance

URI: /api/v1/balance/

Request Method: POST

Parameters Description

Parameter Description
coin btc , ltc , doge , bch. Default: btc
key API key
signature signature
nonce nonce

Sample Response

{
	"uid":8,
	"nameauth":0,
	"moflag":0,
	"btc_balance":4234234,
	"btc_lock":0,
	"ltc_balance":32429.6,
	"ltc_lock":2.4,
	"doge_balance":0,
	"doge_lock":0,
	"jpy_balance":2344581.519,
	"jpy_lock":868862.481
}

Response Description

Parameter Description
jpy_balance Total JPY.
btc_balance Total BTC.
jpy_lock Lock JPY.
btc_lock Lock BTC.
nameauth Real-name authentication status, 0 -> no, 1 -> wait, 2 -> success.
moflag Cellphone status, 0 -> no ,1 -> yes.

Wallet

URI: /api/v1/wallet/

Request Method: POST

Parameters Description

Parameter Description
coin btc , ltc , doge , bch. Default: btc
key API key
signature signature
nonce nonce

Sample Response

{
	"result":true,
	"address":"1xxxxxxxxxxxxxxxxxxxxxxxx"
}

Response Description

Parameter Description
result true(success), false(fail).
address Bitcoin address.

Trade_list

URI: /api/v1/trade_list/

Request Method: POST

Parameters Description

Parameter Description
coin btc , ltc , doge , bch. Default: btc
key API key
signature signature
nonce nonce
since unix timestamp(utc timezone) default == 0
type [open or all]

Sample Response


[
	{
		"id":"11",
		"datetime":"2014-10-21 10:47:20",
		"type":"sell",
		"price":42000,
		"amount_original":1.2,
		"amount_outstanding":1.2
	},
	{
		"id":"10",
		"datetime":"2014-10-20 13:29:39",
		"type":"sell",
		"price":42000,
		"amount_original":1.2,
		"amount_outstanding":1.2
	},
	.....
]
				

Response Description

Parameter Description
id ID.
datetime date and time.
type "buy" or "sell".
price price.
amount_original total number.
amount_outstanding The number of remaining.

Trade_view

URI: /api/v1/trade_view/

Request Method: POST

Parameters Description

Parameter Description
coin btc , ltc , doge , bch. Default: btc
key API key
signature signature
nonce nonce
id ID

Sample Response

{
	"id":11,
	"datetime":"2014-10-21 10:47:20",
	"type":"sell",
	"price":42000,
	"amount_original":1.2,
	"amount_outstanding":1.2,
	"status":"cancelled",
}

Response Description

Parameter Description
id ID.
datetime format:YYYY-mm-dd HH:ii:ss.
type "buy" or "sell".
price price.
amount_original total number.
amount_outstanding The number of remaining.
status Order status:no, part, cancelled, all.

Trade_cancel

URI: /api/v1/trade_cancel/

Request Method: POST

Parameters Description

Parameter Description
coin btc , ltc , doge , bch. Default: btc
key API key
signature signature
nonce nonce
id ID

Sample Response

{
	"result":true,
	"id":"11"
}

Response Description

Parameter Description
result true(success), false(fail).
id ID.

Trade_add

URI: /api/v1/trade_add/

Request Method: POST

Parameters Description

Parameter Description
coin btc , ltc , doge , bch. Default: btc
key API key
signature signature
nonce nonce
amount Total number
price price
type buy or sell

Sample Response

{
	"result":true,
	"id":"11"
}

Response Description

Parameter Description
id ID.
result true(success), false(fail).

Sample Code

PHP PYTHON

Error Code

success

{ "result":true, "code":"101" }

Response Description

Error Code Solution
100 Required parameters can not be empty.
101 Illegal parameter.
102 coin does not exist.
103 Key does not exist.
104 Signature does not match.
105 Insufficient permissions.
106 Request expired(nonce error).
107 The price must be an integer.
200 Lack of balance.
201 Too small for the number of trading.
202 Price must be in 0 - 1000000.
203 Order does not exist.
301 No Verified.
401 System error.
402 Requests too frequently.
403 Non-open API.
404 IP restriction does not request the resource.