Spot trading
Base URL for all endpoints in this module:
https://openapi.bitbaby.com/spot/openFull URL =
{baseurl}{requestPath}, e.g.https://openapi.bitbaby.com/spot/open/sapi/v1/order.When signing,
requestPathmust be/sapi/v1/...only — do not include the gateway prefix/spot/open. See General information → Signed endpoints.
General
Security: NONE
Endpoints below require no API key or signature.
Test connectivity
GET /sapi/v1/ping
Checks REST API connectivity.
200
{}Server time
GET /sapi/v1/time
Returns server time. Call once before placing orders to align your local clock.
200
{
"timezone": "GMT+08:00",
"serverTime": 1595563624731
}Symbols
GET /sapi/v1/symbols
Lists tradable symbols with precision and minimum-size metadata.
200
{
"symbols": [
{
"symbol": "btcusdt",
"baseAsset": "BTC",
"quoteAsset": "USDT",
"pricePrecision": 2,
"quantityPrecision": 8,
"limitPriceMin": "0.01",
"limitVolumeMin": "0.0001",
"marketBuyMin": "10",
"marketSellMin": "0.0001"
}
]
}Response
| Field | Type | Example | Description |
|---|---|---|---|
| symbol | string | btcusdt | Symbol (lowercase) |
| baseAsset | string | BTC | Base asset |
| quoteAsset | string | USDT | Quote asset |
| pricePrecision | integer | 2 | Price decimals |
| quantityPrecision | integer | 8 | Quantity decimals |
| limitPriceMin | string | 0.01 | Min price tick for limit orders |
| limitVolumeMin | string | 0.0001 | Min size for limit orders |
| marketBuyMin | string | 10 | Min notional for market buy (quote) |
| marketSellMin | string | 0.0001 | Min size for market sell |
Market data
Security: NONE
Market endpoints below require no API key or signature.
Order book depth
GET /sapi/v1/depth
Query parameters
| Name | Type | Description |
|---|---|---|
| symbol* | string | Symbol, e.g. BTCUSDT |
| limit | integer | Default 100; max 100 |
200
{
"time": 1595563624731,
"bids": [
["3.90000000", "431.00000000"],
["4.00000000", "431.00000000"]
],
"asks": [
["4.00000200", "12.00000000"],
["5.10000000", "28.00000000"]
]
}Each level is [price, quantity], sorted best price first.
24h ticker
GET /sapi/v1/ticker
24-hour rolling statistics.
Query parameters
| Name | Type | Description |
|---|---|---|
| symbol* | string | Symbol, e.g. BTCUSDT |
200
{
"high": "9279.0301",
"vol": "1302",
"last": "9200",
"low": "9279.0301",
"rose": "0",
"time": 1595563624731
}Response
| Field | Type | Description |
|---|---|---|
| time | long | Timestamp (ms) |
| high | string | High |
| low | string | Low |
| last | string | Last price |
| vol | string | 24h volume |
| rose | string | 24h change |
Recent trades
GET /sapi/v1/trades
Query parameters
| Name | Type | Description |
|---|---|---|
| symbol* | string | Symbol, e.g. BTCUSDT |
| limit | integer | Default 200 |
200
[
{
"price": "3.00000100",
"qty": "11.00000000",
"time": 1499865549590,
"side": "BUY"
}
]Response
| Field | Type | Description |
|---|---|---|
| price | string | Trade price |
| qty | string | Quantity |
| time | long | Trade time (ms) |
| side | string | Aggressor side, BUY/SELL |
K-lines / candles
GET /sapi/v1/klines
Query parameters
| Name | Type | Description |
|---|---|---|
| symbol* | string | Symbol, e.g. BTCUSDT |
| interval* | string | One of 1min, 5min, 15min, 30min, 60min, 1day, 1week, 1month |
| limit | integer | Default 100; max 300 |
200
[
{
"idx": 1594640340,
"open": "6228.77",
"close": "6228.77",
"high": "6228.77",
"low": "6228.77",
"vol": "111"
}
]Response
| Field | Type | Description |
|---|---|---|
| idx | long | Open time (seconds) |
| open | string | Open |
| close | string | Close |
| high | string | High |
| low | string | Low |
| vol | string | Volume |
Trading
Security: TRADE
Trading endpoints require API key + signature. Every endpoint below requires the same headers; we don't repeat them in each section.
| Header | Type | Description |
|---|---|---|
| X-CH-APIKEY* | string | API key |
| X-CH-TS* | string | Timestamp (ms) |
| X-CH-SIGN* | string | HMAC-SHA256 hex |
| Content-Type* | string | application/json |
Place order
POST /sapi/v1/order
Rate limit: 100 req / 2s
Request body
| Name | Type | Description |
|---|---|---|
| symbol* | string | Symbol, e.g. BTCUSDT |
| volume* | number | Order quantity |
| side* | string | BUY / SELL |
| type* | string | LIMIT / MARKET |
| price | number | Required for LIMIT orders |
| newClientOrderId | string | Client order id (you must keep it unique) |
| recvWindow | integer | Recv window (ms) |
200
{
"symbol": "LXTUSDT",
"orderId": "150695552109032492",
"clientOrderId": "157371322565051",
"transactTime": "1573713225668",
"price": "0.005452",
"origQty": "110",
"executedQty": "0",
"status": "NEW",
"type": "LIMIT",
"side": "SELL"
}Response
| Field | Type | Description |
|---|---|---|
| orderId | string | System order id |
| clientOrderId | string | Client order id |
| symbol | string | Symbol |
| transactTime | string | Create time (ms) |
| price | string | Price |
| origQty | string | Order quantity |
| executedQty | string | Filled quantity |
| type | string | LIMIT / MARKET |
| side | string | BUY / SELL |
| status | string | NEW / PARTIALLY_FILLED / FILLED / CANCELED / REJECTED |
Test new order
POST /sapi/v1/order/test
Same parameters as POST /sapi/v1/order but the order is not sent to the matching engine. Use it to validate signatures and parameters.
200
{}Cancel order
POST /sapi/v1/cancel
Rate limit: 100 req / 2s
Request body
| Name | Type | Description |
|---|---|---|
| symbol* | string | Symbol, e.g. BTCUSDT |
| orderId* | string | Order id |
| newClientOrderId | string | Client order id |
200
{
"symbol": "BHTUSDT",
"clientOrderId": "0",
"orderId": "499890200602846976",
"status": "CANCELED"
}Batch place
POST /sapi/v1/batchOrders
Rate limit: 50 req / 2s; max 10 orders per batch
Request body
| Name | Type | Description |
|---|---|---|
| symbol* | string | Symbol, e.g. BTCUSDT |
| orders* | array | Array of orders, max 10 |
orders[] fields
| Field | Type | Description |
|---|---|---|
| price | number | Price (required for LIMIT) |
| volume | number | Quantity |
| side | string | BUY / SELL |
| batchType | string | LIMIT / MARKET |
| newClientOrderId | string | Per-order client id (optional) |
200
{
"ids": [
"165964665990709251",
"165964665990709252",
"165964665990709253"
]
}Batch cancel
POST /sapi/v1/batchCancel
Rate limit: 50 req / 2s; max 10 orders per call
Request body
| Name | Type | Description |
|---|---|---|
| symbol* | string | Symbol, e.g. BTCUSDT |
| orderIds* | array | Order ids, e.g. [123, 456] |
200
{
"success": ["165964665990709251", "165964665990709252"],
"failed": ["165964665990709250"]
}Items in
failedtypically didn't exist or had reached a terminal state (FILLED/CANCELED).
Query order
GET /sapi/v1/order
Rate limit: 20 req / 2s
Query parameters
| Name | Type | Description |
|---|---|---|
| symbol* | string | Symbol, e.g. BTCUSDT |
| orderId* | string | Order id |
| newClientOrderId | string | Client order id |
200
{
"orderId": "499890200602846976",
"clientOrderId": "157432755564968",
"symbol": "BHTUSDT",
"price": "0.01",
"origQty": "50",
"executedQty": "0",
"avgPrice": "0",
"status": "NEW",
"type": "LIMIT",
"side": "BUY",
"transactTime": "1574327555669"
}Open orders
GET /sapi/v1/openOrders
Lists open orders for the given symbol.
Rate limit: 20 req / 2s
Query parameters
| Name | Type | Description |
|---|---|---|
| symbol* | string | Symbol, e.g. BTCUSDT |
| limit | integer | Default 100 |
200
[
{
"orderId": "499902955766523648",
"symbol": "BHTUSDT",
"price": "0.01",
"origQty": "50",
"executedQty": "0",
"avgPrice": "0",
"status": "NEW",
"type": "LIMIT",
"side": "BUY",
"time": "1574329076202"
}
]User trades
GET /sapi/v1/myTrades
Rate limit: 20 req / 2s
Query parameters
| Name | Type | Description |
|---|---|---|
| symbol* | string | Symbol, e.g. BTCUSDT |
| limit | integer | Default 100; max 100 |
| fromId | integer | Start from this trade id |
200
[
{
"symbol": "ETHBTC",
"id": 100211,
"bidId": 150695552109032492,
"askId": 150695552109032493,
"price": "4.00000100",
"qty": "12.00000000",
"time": 1499865549590,
"isBuyer": true,
"isMaker": false,
"feeCoin": "ETH",
"fee": "0.001"
}
]Response
| Field | Type | Description |
|---|---|---|
| symbol | string | Symbol |
| id | long | Trade id |
| bidId | long | Bid order id |
| askId | long | Ask order id |
| price | string | Trade price |
| qty | string | Quantity |
| time | long | Trade time (ms) |
| isBuyer | boolean | true if you were the buyer |
| isMaker | boolean | true if you were the maker |
| feeCoin | string | Fee asset |
| fee | string | Fee amount |
Account
Security: USER_DATA
Account endpoints require API key + signature. Headers as in Trading.
Account information
GET /sapi/v1/account
Rate limit: 20 req / 2s
200
{
"balances": [
{ "asset": "BTC", "free": "0", "locked": "0" },
{ "asset": "ETH", "free": "0", "locked": "0" }
]
}Response
| Field | Type | Description |
|---|---|---|
| balances | array | Asset balances |
| asset | string | Asset name |
| free | string | Available balance |
| locked | string | Locked balance (open orders) |
Deposit history
GET /sapi/v1/deposit/history
TIP
The backend accepts both query string and JSON body (@RequestBody(required = false)). Prefer the query string so signing matches the rest of the GET endpoints.
Query parameters
| Name | Type | Description |
|---|---|---|
| symbol | string | Asset, e.g. USDT |
| status | integer | Status filter |
| startTime | long | Start time (ms); defaults to last 90 days |
| endTime | long | End time (ms); defaults to now |
| txid | string | On-chain txid filter |
| limit | integer | Page size; max 1000 |
200
[
{
"symbol": "USDT",
"amount": "100.00",
"address": "0x...",
"txid": "0x...",
"status": 1,
"createTime": 1574329076202
}
]Withdraw history
GET /sapi/v1/withdraw/history
Parameters identical to /sapi/v1/deposit/history. The response uses withdraw-side fields with the same shape.