> For the complete documentation index, see [llms.txt](https://docs.koinbay.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.koinbay.com/api/spot-rest-api.md).

# Spot REST API

Base URL: <https://openapi.koinbay.com>  ·  16 endpoints.

## Ping / Test connectivity

```
GET  /sapi/v1/ping    Public
```

#### Response 200

```
{}
```

## Server time

```
GET  /sapi/v1/time    Public
```

#### Response 200

```
{
  "serverTime": 1780475299032,
  "timezone": "GMT+08:00"
}
```

## Symbols

```
GET  /sapi/v1/symbols    Public
```

#### Response 200

```
{
  "symbols": [
    {
      "quantityPrecision": 1,
      "limitVolumeMin": "0.1000000000000000",
      "symbol": "usdcpolusdt",
      "pricePrecision": 1,
      "quoteAssetName": "USDT",
      "SymbolName": "USDC/USDT",
      "baseAssetName": "USDC",
      "limitAmountMin": "0.0000000000000000",
      "baseAsset": "USDCPOL",
      "limitPriceMin": "0.1000000000000000",
      "quoteAsset": "USDT"
    }
  ]
}
```

## Depth (order book)

```
GET  /sapi/v1/depth    Public
```

## Query parameters

| Name   | Req | Type    | Description                                                  |
| ------ | --- | ------- | ------------------------------------------------------------ |
| symbol | yes | string  | e.g. BTCUSDT                                                 |
| limit  | yes | integer | default 100; max 100 (required in spot, optional in futures) |

#### Response 200

```
{
  "asks": [ [67047.05, 1.45201], [67047.43, 0.01322] ],
  "bids": [ [67046.36, 1.08196], [67045.98, 0.00822] ],
  "time": 1780475299499
}
```

## 24hr ticker

```
GET  /sapi/v1/ticker    Public
```

#### Query parameters

| Name   | Req | Type   | Description  |
| ------ | --- | ------ | ------------ |
| symbol | yes | string | e.g. BTCUSDT |

#### Response 200

```
{
  "high": "70080.01",
  "vol": "3519.5946749",
  "last": "67046.69",
  "low": "65456.06",
  "buy": 67046.36,
  "sell": 67047.05,
  "rose": "-0.0426514481",
  "time": 1780475299000,
  "open": "70033.73"
}
```

## Recent trades

```
GET  /sapi/v1/trades    Public
```

#### Query parameters

| Name   |     | Type   | Description           |
| ------ | --- | ------ | --------------------- |
| symbol | yes | string | e.g. BTCUSDT          |
| limit  | yes | string | default 100; max 1000 |

#### Response 200

```
{
  "list": [
    { "symbol": "BTCUSDT", "side": "BUY",  "price": "67046.69", "qty": "0.10512", "id": 226317353, "time": 1780475299410 },
    { "symbol": "BTCUSDT", "side": "SELL", "price": "67046.71", "qty": "0.11102", "id": 226317352, "time": 1780475298305 }
  ]
}
```

## Klines / candlesticks

```
GET  /sapi/v1/klines    Public
```

**Notes:**

* interval='1h' returns \[] for spot; use '60min'. Accepted set: 1min,5min,15min,30min,60min,1day,1week,1month.

#### Query parameters

| Name     | Req | Type    | Description                                   |
| -------- | --- | ------- | --------------------------------------------- |
| symbol   | yes | string  | e.g. BTCUSDT                                  |
| interval | yes | string  | 1min,5min,15min,30min,60min,1day,1week,1month |
| limit    | no  | integer | default 100; max 300                          |

#### Response 200

```
[
  { "high": "67040.18", "vol": "1.26701", "low": "67015.99", "id": 1780475220, "idx": 1780475220000, "close": "67040", "open": "67029.96" }
]
```

## Create order

```
POST  /sapi/v1/order    Signed
```

#### Request body (application/json)

<table data-search="false"><thead><tr><th>Field</th><th>Req</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>symbol</td><td>yes</td><td>string</td><td>case-insensitive</td></tr><tr><td>volume</td><td>yes</td><td>number</td><td><br></td></tr><tr><td>side</td><td>yes</td><td>string</td><td>BUY / SELL</td></tr><tr><td>type</td><td>yes</td><td>string</td><td>LIMIT / MARKET</td></tr><tr><td>price</td><td>no</td><td>number</td><td>required for LIMIT</td></tr><tr><td>newClientOrderId</td><td>no</td><td>string</td><td>echo-only client id</td></tr></tbody></table>

#### Response 200

```
{
  "symbol": "BTCUSDT",
  "side": "BUY",
  "executedQty": 0,
  "orderId": 3299363193621880482,
  "price": 60315.33,
  "origQty": 1e-05,
  "clientOrderId": null,
  "transactTime": 1780475334961,
  "orderIdString": "3299363193621880482",
  "type": "LIMIT",
  "status": 0
}
```

## Query order

```
GET  /sapi/v1/order    Signed
```

**Notes:**

* With no/invalid orderId it returns the {code,msg,data:null} envelope instead.

#### Query parameters

| Name    | Req | Type   | Description       |
| ------- | --- | ------ | ----------------- |
| orderId | yes | string | <p><br></p>       |
| symbol  | yes | string | lowercase per doc |

#### Response 200

```
{
  "symbol": "btcusdt",
  "orderType": 1,
  "side": "BUY",
  "executedQty": 0.0,
  "executedMoney": 0.0,
  "orderId": 3299363193621880482,
  "origQty": 1e-05,
  "avgPrice": 0.0,
  "clientOrderId": null,
  "orderIdString": "3299363193621880482",
  "type": "LIMIT",
  "stopPrice": 0,
  "price": 60315.33,
  "transactTime": 1780475335000,
  "isWorking": true,
  "status": "CANCELED"
}
```

## Test new order

```
POST  /sapi/v1/order/test    Signed
```

#### Request body (application/json)

| Field  | Req | Type   | Description    |
| ------ | --- | ------ | -------------- |
| symbol | yes | string | <p><br></p>    |
| volume | yes | number | <p><br></p>    |
| side   | yes | string | BUY / SELL     |
| type   | yes | string | LIMIT / MARKET |
| price  | no  | number | <p><br></p>    |

#### Response 200

```
{}
```

## Batch orders

```
POST  /sapi/v1/batchOrders    Signed
```

#### Request body (application/json)

| Field  | Req | Type   | Description     |
| ------ | --- | ------ | --------------- |
| symbol | yes | string | <p><br></p>     |
| orders | yes | array  | max 10 elements |

#### Response 200

```
{
  "idsString": ["3299631732157119774", "3299631732157119775"],
  "ids": [3299631732157119774, 3299631732157119775]
}
```

## Cancel order

```
POST  /sapi/v1/cancel    Signed
```

**Notes:**

* Returns {symbol, orderId(scalar), clientOrderId, orderIdString, status}. status='PENDING\_CANCEL' (cancel is ASYNC, not immediate).

#### Request body (application/json)

| Field   | Req | Type   | Description       |
| ------- | --- | ------ | ----------------- |
| orderId | yes | string | <p><br></p>       |
| symbol  | yes | string | lowercase per doc |

#### Response 200

```
{
  "symbol": "btcusdt",
  "orderId": 3299363193621880482,
  "clientOrderId": null,
  "orderIdString": "3299363193621880482",
  "status": "PENDING_CANCEL"
}
```

## Batch cancel

```
POST  /sapi/v1/batchCancel    Signed
```

#### Request body (application/json)

| Field    | Req | Type   | Description                  |
| -------- | --- | ------ | ---------------------------- |
| symbol   | yes | string | <p><br></p>                  |
| orderIds | yes | array  | numeric ids, e.g. \[123,456] |

#### Response 200

```
{
  "success": [3299631732157119774, 3299631732157119775],
  "failed": []
}
```

## Open orders

```
GET  /sapi/v1/openOrders    Signed
```

Query parameters

| Name   | Req | Type    | Description       |
| ------ | --- | ------- | ----------------- |
| symbol | yes | string  | lowercase per doc |
| limit  | yes | integer | max 1000          |

#### Response 200

```
{
  "list": []
}
```

## My trades

```
GET  /sapi/v1/myTrades    Signed
```

#### Query parameters

| Name   | Req | Type   | Description           |
| ------ | --- | ------ | --------------------- |
| symbol | yes | string | <p><br></p>           |
| limit  | yes | string | default 100; max 1000 |

#### Response 200

```
{
  "list": [
    {
      "symbol": "ETHUSDT", "side": "BUY", "fee": "0.00000000428",
      "isMaker": false, "isBuyer": true,
      "bidId": 1954603951049381893, "bidUserId": 10083, "feeCoin": "ETH",
      "price": "2334", "qty": "0.00000428",
      "askId": 1856176838352995447, "id": 159, "time": 1701623660989,
      "isSelf": false, "askUserId": 10671
    }
  ]
}
```

## Account

```
GET  /sapi/v1/account    Signed
```

#### Response 200

```
{
  "balances": [
    { "uid": 10023, "asset": "BTC",  "free": "0.50000000", "locked": "0.00000000" },
    { "uid": 10023, "asset": "USDT", "free": "1000.00",   "locked": "50.00" }
  ]
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.koinbay.com/api/spot-rest-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
