Skip to content

REST API Reference (English)

Bitker-API edited this page May 8, 2019 · 2 revisions

REST_API_Reference

 

Symbol rulebasic coins + valuation coins, like BTC/USDT, symbol is btc_usdtETH/BTCsymbolis eth_btc, and so on.(API calls the frequency limit rule: 200 times in 1 minute, 83,200 times in 1 day)

 

Market API

When calling the market interface, please add get parameter, key is the apikey, value is the apikey price applied on the page.

For example:

https://api.bitker.com/market/depth?symbol=eth_btc&type=0&apikey=5af48c33-d593-468b-aec3-cd871c222180

 

GET /market/history/kline GET Market Kline Data

Required parameter:

parameter name

true or false

type

description

default value

values range

symbol

true

string

trading asset

 

btc_usdt...

period

true

string

Kline period

 

1min|5min|15min|30min|1hour|2hour|4hour|6hour|12hour|1day|1week

size

false

int

 

 

[1,2000]default 150

 

 

 

Respond to data:

parameter name

true or false

data type

description

values range

status

true

stirng

request processing the result

“ok”, “error”

ts

true

number

timestamp in millisecond

time stamp, millisecond

 

ticker

true

object

Kline data

 

 

Ticker instruction

" ticker": [

{

    "id": Kline ID

    "amount": volume

    "open":  opening price for the first trading

    "close": closing price, when the Kline is the latest

    "low": lowest price

    "high": highest price

  }

]

 

Sample request response:

/* GET /market/history/kline?symbol=btc_usdt&period=15min&size=1&apikey=value */

{

  "status": "ok",

  "ts": 1531556311956,

  "tick": {

    "id":   1531555200000

    "amount": 223.360102

    "open": 6201.102331

    "close": 6315.04000

"low": 6164.050011

"high": 6325.082341

  }

}

 

 

GET /market/depth GET Market Depth Data

Required parameter

parameter name

true or false

type

description

default value

values range

symbol

true

string

trading asset

 

btc_usdt...

type

true

string

Deep type

 

0, 1, 2, 3, 4, 5(choose one from six numbers);when choosing 0,return to all depth

 

 

Respond to parameter

parameter name

true or false

data type

description

values range

status

true

string

Request processing the result

“ok”, “error”

ts

true

number

timestamp in millisecond

time stamp, millisecond

 

tick

true

object

deep data

 

 

Tick instruction

"tick": {

    "id": Information id,

    "ts": message generation time, unit:milliseconds,

    "bids": [price(volume), amount(amount)],buy,according to price descending order,

    "asks": [price(volume), amount(amount)],sell,according to price ascending order  }

 

Sample request response

/* GET /market/depth?symbol=eth_usdt&type=step1&apikey=value */

{

  "status": "ok",

  "ts": 1489472598812,

  "tick": {

    "id": 1489464585407,

    "ts": 1489464585407,

    "bids": [

      [7964, 0.0678]// [price, amount]

    ],

    "asks": [

      [7979, 0.0736]

    ]

  }

}

 

GET /market/trade GET Trade Detail Data

Required parameter::

parameter name

true or false

type

description

default value

values range

symbol

true

string

trading asset

 

btc_usdt...

 

Respond to parameter:

parameter name

true or false

data type

description

values range

status

true

stirng

request processing the result

“ok”, “error”

ts

true

number

timestamp in millisecond

time stamp, millisecond

 

tick

true

object

trading data

 

 

Tick instruction

"tick": {

    "id": information id,

    "data":

      {

        "id": strike price id,

        "transPrice": strike price,

        "transNumber": volume,

        "transDirection": active trading direction,

        "finishTime": latest trading time

      }

  }

Sample request response:

/* GET /market/trade/{symbol}?apikey=value*/

{

  "status": "ok",

  "ts": 1489473346905,

  "tick": {

"id": 600848670,

"data": [

      {

"id": 600848670,

"transPrice": 7962.62,

"transNumber": 0.0122,

"transDirection": "1",    //1 buy  2 sell

"finishTime": 1489464451000

      }

    ]

  }

}

 

Public API

GET /v1/common/getTimestamp query system current time

required parameter :(noneSignature authentication required

Response data: system timestamp

Sample request response:

/* GET /v1/common/getTimestamp?apikey=value&signature=value*/

{

  "status": "ok",

  "data": 1494900087029

}

 

Usersassets API

GET /v1/account/accounts query all accounts of the current user

required parameter :(noneSignature authentication required

 

Respond to data

parameter name

true or false

data type

description

values range

id

true

long

account-id

 

coinName

true

string

coinName

 

acccoutType

true

string

account type

1 OTC account

2 spot account

3contract account

balance

true

decimal

Account balance

 

freeze

true

decimal

frozen amount

 

useMoney

true

decimal

available amount

 

loanMoney

true

decimal

loan amount

 

state

true

string

account status

1: normal

0: vault

 

Sample request response:

/* GET /v1/account/accounts?apikey=value&signature=value */

{

  "status": "ok",

  "data": {

      "id": 100009,

"coinName": "USDT",

      "acccoutType": "1",

"balance": 20000,

"freeze": 0,

"useMoney": 20000,

"loanMoney": 0,

"status": "1",

   }

}

 

Trading API

POST /v1/orders/place place an order in this website

required parameter :(no need for signature authentication required

parameter name

true or false

data type

description

default value

values range

amount

true

string

The price limit list indicates the quantity of an order, the price bought when the market price is paid, and the sale order when the market price is sold.

 

 

 

 

 

how many coins

 

 

price

false

string

Order price is issued, the market price list does not pass this parameter

 

 

Precision supports six decimal places

symbol

true

string

trading asset

 

btc_usdt...

consignType

true

int

order type

 

1 price limit entrust

2 market price entrust

consignDirection

true

int

trading direction

 

1 buy  2 sell

 

Respond to data

parameter name

true or false

data type

description

values range

status

true

string

return status

 

data

true

string

order ID

 

 

Sample request response:

/* POST /v1/orders/place {

   "amount": "10.1",

   "price": "100.1",

    "symbol": "eth_usdt",

    "consignType": "1",

"consignDirection": "1",

"apikey": value,

"signature": value

} */

 

{

  "status": "ok",

  "data": "59378"

}

 

POST /v1/order/orders/{order-id}/submitcancel request for cancellation of an order

required parameter :(no need for signature authentication required

 

parameter name

true or false

data type

description

default value

values range

order_id

true

string

order ID,fill in the path

 

 

 

Respond to data

parameter name

true or false

data type

description

values range

status

true

string

return status

 

data

true

string

order ID

 

 

Sample request response:

/* POST/v1/order/orders/{order_id}/submitcancel?apikey=value&signature=value*/

{

  "status": "ok",//Note that returning OK indicates a successful withdrawal request. If the order is successfully revoked, please call the order query interface to query the status of the order  "data": "59378"

}

 

 

GET /v1/order/orders/{order-id} query for details of an order

required parameter :(signature authentication required

parameter name

true or false

data type

description

default value

values range

order_id

true

string

Order IDfill in the path

 

 

 

Respond to data

parameter name

true or false

data type

description

values range

accountId

true

long

account ID

 

consignNumber

true

string

order quantity

 

canceledAt

false

long

order revocation time

 

createTime

true

long

order creation time

 

transDoneNumber

true

string

number of tradings

 

transTurnover

true

string

total trading amount

 

feeNumber

true

string

Trading fee (buy for coin, sell for money

 

 

finishTime

false

long

final trading time

 

id

true

long

order ID

 

consignPrice

true

string

order price

 

state

true

string

order status

0 in entrust

1 trading partly

2 trading

3 revocation

symbol

true

string

trading asset

btc_usdt...

consignType

true

int

order type

1price limit entrust

2 market price entrust

transDirection

true

int

Trading direction

1buy  2 sell

 

Sample request response:

/* GET /v1/order/orders/{order_id}?apikey=value&signature=value */

{

  "status": "ok",

  "data": {

"id": 59378,

    "symbol": "btc_usdt",

    "accountId": 100009,

    "consignNumber": "10.1000000000",

    "consignPrice": "100.1000000000",

    "createTime": 1494901162595,

"consignType": "1",

"transDirection": "1",

    "transDoneNumber": "10.1000000000",

    "transturnover": "1011.0100000000",

    "feeNumber": "0.0202000000",

    "finishTime": 1494901400468,

    "state": "1,

    "canceledAt": 0,//Order revocation time

  }

}

 

GET /v1/order/orders query current entrust, historical entrust

required parameter :(signature authentication required

parameter name

true or false

data type

description

default value

values range

symbol

true

string

trading asset

 

btc_usdt ...

consignType

true

int

order type

 

1price limit entrust

2 market price entrust

transDirection

true

int

trading direction

 

1buy  2 sell

start_date

false

string

query start date, date format

yyyy-mm-dd

 

 

end_date

false

string

query end date, date format

yyyy-mm-dd

 

 

states

true

string

a combination of order status for the query, separated by a comma

 

0 in entrust

1 trading partly

2 trading

3 revocation

from

false

string

query start ID

 

 

direct

false

string

query direction

 

Prev forwardnext backward

size

false

string

query record size

 

 

 

Respond to data

parameter name

true or false

data type

description

values range

id

true

long

order ID

 

symbol

true

string

trading asset

btc_usdt...

accountId

true

long

account ID

 

consignNumber

true

string

order quantity

 

consignPrice

true

string

order price

 

createTime

true

long

order creation time

 

consignType

true

int

order type

1price limit entrust

2 market price entrust

transDirection

true

int

trading direction

1buy  2 sell

transDoneNumber

true

string

number of tradings

 

transTurnover

true

string

total trading amount

 

feeNumber

true

string

trading fee (buy for coin, sell for money)

 

finishTime

false

long

final trading time

 

state

true

string

order status

0 in entrust

1 trading partly

2 trading

3 revocation

canceledAt

false

long

order revocation time

 

 

Sample request response:

/* GET /v1/order/orders?symbol=eth_usdt&consignType=1&transDirection=1&states=1&apikey=value&signature=value*/

{

  "status": "ok",

  "data":

    {

"id": 59378,

    "symbol": "eth_usdt",

    "accountId": 100009,

    "consignNumber": "10.1000000000",

    "consignPrice": "100.1000000000",

    "createTime": 1494901162595,

"consignType": "1",

"transDirection": "1",

    "transDoneNumber": "10.1000000000",

    "transturnover": "1011.0100000000",

    "feeNumber": "0.0202000000",

    "finishTime": 1494901400468,

    "state": "1,

    "canceledAt": 0,//Order revocation time    }

}

 

GET /v1/order/matchresults query current trading, historical trading

required parameter :(signature authentication required

parameter name

true or false

data type

description

default value

values range

symbol

true

string

trading asset

 

btc_usdt...

consignType

true

int

order type

 

1price limit entrust

2 market price entrust

transDirection

true

int

trading direction

 

1 buy  2sell

start_date

false

string

query start date, date format

yyyy-mm-dd

 

 

end_date

false

string

query end date, date format

yyyy-mm-dd

 

 

from

false

string

query start ID

 

 

direct

false

string

query direction

 

prev forwardnext backward

size

false

string

query record size

 

 

 

Respond to date

parameter name

true or false

data type

description

Values range

id

true

long

order trading record ID

 

orderId

true

long

order ID

 

matchId

true

long

match ID

 

symbol

true

string

trading asset

btc_usdt, bch_btc, rcn_eth ...

consignType

true

int

order type

1price limit entrust 

2 market price entrust

transDirection

true

int

trading direction

1buy  2sell

transPrice

true

string

strike price

 

transNumber

true

string

volume

 

rivalFee

true

string

trading fee

 

finishTime

true

long

trading time

 

 

Sample request response:

/* GET /v1/orders/matchresults?symbol=btc_usdt&consignType=1&transDirection=1&apikey=value&signature=value*/

{

  "status": "ok",

  "data":

    {

"id": 29553,

      "orderId": 59378,

      "matchId": 0,

      "symbol": btc_usdt,

      "consignType": "1",

"transDirection": "1",

      "transPrice": "100.1000000000",

      "transNumber": "9.1155000000",

      "rivalFee": "0.0182310000",

      "finishTime": 1494901400435

    }

}