Download OpenAPI specification:Download
All the endpoints will require an API Key. Please refer to this page regarding API key creation..
Once an API key is created, it is recommended to set IP restrictions on the key for security reasons.
Never share your API key/secret key to ANYONE.
If the API keys were accidentally shared, please delete them immediately and create a new key.
To manage your API keys, please go to the API Key Management page.
We support different options for API Key calling requests to Bitcastle:
Read Only: Request for login authentication and be able to use all the
Spot Trading: Request to create or cancel an exchange order
Withdraw: Request to create a withdraw order
After creating the API key, the default restriction is Enable. If we see any suspicious attempts that may not be safe for our system, it would be Disabled and no longer be used.
The default rate for an API Key is:
50 calls per 10 seconds for user account.
100 calls per 10 seconds for enterprise account.
We are support both MQTT and Websocket protocol for real time data. Data format must using MQTT package structure.
Base url:
public/exchange/update_ticker_24h
{
"data": [
{
"coin": "ada",
"currency": "usdt",
"volume": "3536679.8",
"total": "1321685.59747",
"high": "0.38",
"low": "0.3658",
"price": "0.3684",
"price_change": "-0.0096",
"price_percentage": "-2.539682539682539683"
}
],
"last_update": "1684469752863"
}
public/exchange/update_market_trade/{coin}/{currency}
public/exchange/update_market_trade/btc/usdt
{
"data": {
"id": "68367233",
"origin_order_id": "711794895602066054",
"match_order_id": "711794895606258816",
"coin": "btc",
"currency": "usdt",
"price": "26824.8",
"net_volume": "0.00326556",
"gross_volume": "0.00326556",
"create_time": "1684469927659",
},
"last_update": "1684469927705"
}
public/exchange/update_orderbook/{coin}/{currency}/{precision}
public/exchange/update_orderbook/btc/usdt/0.01
{
"data": {
"coin": "btc",
"currency": "usdt",
"precision": "0.01",
"type": "ws",
"orderbook": {
"asks": [
{
"price": "26851.57",
"volume": "0.00356067"
},
{
"price": "26851.49",
"volume": "0.00423304"
},
{
"price": "26851.47",
"volume": "0.01969202"
}
],
"bids": [
{
"price": "26797.22",
"volume": "0.00285109"
},
{
"price": "26797.19",
"volume": "0.00570166"
},
{
"price": "26797.18",
"volume": "0.00096345"
}
]
}
},
"last_update": 1684469761904
}
types[] | Array of any Default: [3] Example: types[]=1&types[]=2 Balance Types ([CASHBACK,BO,EXCHANGE,REWARD,1,2,3,4]) |
{- "data": [
- {
- "actual_balance": "0.000000000000000000",
- "available_balance": "0.000000000000000000",
- "created_at": "1649748104000",
- "currency": "eve",
- "id": "10120139",
- "type": "EXCHANGE",
- "updated_at": "1649748104000",
- "user_id": "42397",
- "version": 0
}, - {
- "actual_balance": "0.000000000000000000",
- "available_balance": "0.000000000000000000",
- "created_at": "1514764800000",
- "currency": "dot",
- "id": "10148131",
- "type": "EXCHANGE",
- "updated_at": "1514764800000",
- "user_id": "42397",
- "version": 0
}
], - "timestamp": 1683627338413
}
Market related statistics for all markets for the last 24 hours.
coin | string Example: coin=btc |
currency | string Example: currency=usdt |
{- "data": [
- {
- "coin": "ltc",
- "currency": "btc",
- "volume": "2279.0975",
- "total": "7.7372463612",
- "high": "0.003459",
- "low": "0.00336",
- "price": "0.003438",
- "price_change": "0.000023",
- "price_percentage": "0.673499267935578331"
}, - {
- "coin": "mc",
- "currency": "castle",
- "volume": "0",
- "total": "0",
- "high": "2.8954",
- "low": "2.8954",
- "price": "2.8954",
- "price_change": "0",
- "price_percentage": "0"
}
], - "last_update": 1683627338413
}
Order book depth of any given trading pair, split into two different arrays for bid and ask orders.
coin required | string Example: coin=btc |
currency required | string Example: currency=usdt |
precision required | string Example: precision=0.01 |
take | number Example: take=100 number of elements in each array, default = 100 |
sort | string Enum: "ASC" "DESC" order by: price, default = DESC |
{- "data": {
- "coin": "btc",
- "currency": "usdt",
- "precision": "0.01",
- "orderbook": {
- "asks": [
- {
- "price": "26858.58",
- "volume": "0.00427671"
}, - {
- "price": "26858.51",
- "volume": "0.00071742"
}
], - "bids": [
- {
- "price": "26804.68",
- "volume": "0.00065931"
}, - {
- "price": "26804.67",
- "volume": "0.04786604"
}
], - "current_price": "26831.57"
}
}, - "last_update": 1684470804010
}
Used to return data on historical completed trades for a given market pair.
coin required | string Example: BTC |
currency required | string Example: USDT |
{- "buy": [
- {
- "trade_id": 69236949,
- "target_volume": "1291.315173554",
- "price": "26899.900000000000000000",
- "base_volume": "0.048004460000000000",
- "type": "buy",
- "trade_timestamp": 1684898821781
}, - {
- "trade_id": 69236847,
- "target_volume": "6924.643975611",
- "price": "26938.900000000000000000",
- "base_volume": "0.257049990000000000",
- "type": "buy",
- "trade_timestamp": 1684898793543
}
], - "sell": [
- {
- "trade_id": 69237105,
- "target_volume": "1139.5688069113",
- "price": "26903.990000000000000000",
- "base_volume": "0.042356870000000000",
- "type": "sell",
- "trade_timestamp": 1684898867024
}, - {
- "trade_id": 69237056,
- "target_volume": "1216.730987031",
- "price": "26930.350000000000000000",
- "base_volume": "0.045180660000000000",
- "type": "sell",
- "trade_timestamp": 1684898852924
}
]
}
Historical trade data for any given trading pair.
coin required | string Example: coin=btc |
currency required | string Example: currency=usdt |
take | number Example: take=50 Default is 50 |
{- "data": [
- {
- "id": "68369770",
- "price": "26848.400000000000000000",
- "gross_volume": "0.000755450000000000",
- "create_time": "1684471142347",
- "coin": "btc",
- "currency": "usdt",
- "order_type": 1
}, - {
- "id": "68369742",
- "price": "26848.400000000000000000",
- "gross_volume": "0.001033290000000000",
- "create_time": "1684471126255",
- "coin": "btc",
- "currency": "usdt",
- "order_type": 1
}
]
}
The request will respond candle stick data buy trading pair
coin required | string Example: coin=btc |
currency required | string Example: currency=usdt |
range required | string Example: range=24h Write List: 24h,7d,30d |
{- "data": [
- {
- "price": "27490",
- "time": "1684470600000"
}, - {
- "price": "27490",
- "time": "1684470900000"
}, - {
- "price": "27490",
- "time": "1684471200000"
}
], - "last_update": "1684471309175"
}
The List Open Orders API allows you to retrieve a list of open or pending orders.
order_class | number Enum: 1 2 3 4 Example: order_class=2 MARKET = 1, LIMIT = 2, STOP_MARKET = 3, STOP_LIMIT = 4 |
order_type | number Enum: 1 2 Example: order_type=2 BUY = 1, SELL = 2 |
currency | string Example: currency=usdt |
coin | string Example: coin=btc |
from_create_date | string Example: from_create_date=1672053435907 |
to_create_date | string Example: to_create_date=1672053435907 |
take | number Default: 10 Example: take=10 Default is 10. For pagination |
from | string order_id of order |
to | string order_id of order |
{- "data": [
- {
- "status": 1,
- "order_class": 2,
- "stop_direction": 0,
- "filled_volume": "0",
- "error_count": 0,
- "order_id": "87365289",
- "user_id": "61254",
- "order_type": 1,
- "price": "31000.00",
- "volume": "0.05",
- "stop_price": "0",
- "create_time": "1686624064264",
- "update_time": "1686624064264",
- "coin": "btc",
- "currency": "usdt",
- "filled_price": "0"
}
], - "status_code": 200,
- "msg": "Success",
- "timestamp": "123124123123"
}
The List Order History API provides a convenient way to retrieve a user's order history
order_class | number Enum: 1 2 3 4 Example: order_class=2 MARKET = 1, LIMIT = 2, STOP_MARKET = 3, STOP_LIMIT = 4 |
order_type | number Enum: 1 2 Example: order_type=2 BUY = 1, SELL = 2 |
currency | string Example: currency=usdt |
coin | string Example: coin=btc |
from_create_date | string Example: from_create_date=1672053435907 |
to_create_date | string Example: to_create_date=1672053435907 |
order_status | number Enum: 1 2 3 4 6 Example: order_status=2 PENDING = 1, FILLED = 2, CANCELED = 3, EXPIRED = 4, CANCELING = 6 |
take | number Default: 10 Example: take=10 Default is 10. For pagination |
from | string id of order |
to | string id of order |
{- "data": [
- {
- "status": 2,
- "order_class": 2,
- "stop_direction": 0,
- "filled_volume": "0.05",
- "error_count": 0,
- "order_id": "87365289",
- "user_id": "61254",
- "order_type": 1,
- "price": "31000.00",
- "volume": "0.05",
- "stop_price": "0",
- "create_time": "1688026064722",
- "update_time": "1688026064722",
- "coin": "btc",
- "currency": "usdt",
- "filled_price": "31000.00"
}
], - "status_code": 200,
- "msg": "Success",
- "timestamp": "123124123123"
}
The List Trade History API provides a convenient way to retrieve the trade history.
order_class | number Enum: 1 2 3 4 Example: order_class=2 MARKET = 1, LIMIT = 2, STOP_MARKET = 3, STOP_LIMIT = 4 |
order_type | number Enum: 1 2 Example: order_type=2 BUY = 1, SELL = 2 |
currency | string Example: currency=usdt |
coin | string Example: coin=btc |
from_create_date | string Example: from_create_date=1672053435907 |
to_create_date | string Example: to_create_date=1672053435907 |
take | number Default: 10 Example: take=10 Default is 10. For pagination |
from | string id of trade-history |
to | string id of trade-history |
{- "data": [
- {
- "id": "235263512",
- "order_id": "1235263512",
- "order_type": 1,
- "price": "31000.00",
- "net_volume": "0.05",
- "gross_volume": "0.05",
- "create_time": "1688026066346",
- "coin": "btc",
- "currency": "usdt"
}
], - "status_code": 200,
- "msg": "Success",
- "timestamp": "123124123123"
}
Open new Order
order_type required | number |
order_class required | number |
coin required | string |
currency required | string |
price required | string |
stop_price required | string |
volume required | string |
{- "order_type": 1,
- "order_class": 1,
- "coin": "btc",
- "currency": "usdt",
- "price": "0.1",
- "stop_price": "0.1",
- "volume": "0.1"
}
{- "order_type": 0,
- "order_class": 0,
- "coin": "btc",
- "currency": "usdt",
- "price": "0.1234211",
- "stop_price": "0.1234211",
- "volume": "0.1234211"
}
Get user's order by order_id.
order_id required | number Example: order_id=687611739734551300 Id of the order |
{- "data": [
- {
- "status": 1,
- "order_class": 0,
- "stop_direction": 0,
- "filled_volume": "0.00001",
- "error_count": 0,
- "order_id": "87365289",
- "user_id": "61254",
- "order_type": 0,
- "price": "0.0000342",
- "volume": "0.0000342",
- "stop_price": "0.0000342",
- "create_time": "0.0000342",
- "update_time": "0.0000342",
- "coin": "btc",
- "currency": "usdt",
- "filled_price": "0.0000342"
}
], - "status_code": 200,
- "msg": "Success",
- "timestamp": "123124123123"
}
The Cancel Open Order API allows you to cancel an open or pending orders by list of IDs
ids | Array of strings non-empty |
{- "ids": [
- "112321",
- "123212",
- "312321"
]
}
{- "data": { },
- "status_code": 200,
- "msg": "Success",
- "timestamp": "123124123123"
}