---
updatedAt: 2026-10-29T07:00:11.000Z
agentTools:
  projectIndex: https://docs.coinglass.com/v4.0-zh/llms.txt
---

# 现货交易对挂单深度历史（±范围）

获取某个交易所、某个现货交易对的订单簿深度历史：在指定价格范围（±range%）内，买盘和卖盘各有多少挂单（美元金额和币的数量）。适合观察现货市场的支撑、压力和流动性变化。

<DesignTheme />

以下 API 等级均可调用本接口：<PlanBadge plan="Hobbyist" /> <PlanBadge plan="Startup" /> <PlanBadge plan="Standard" /> <PlanBadge plan="Professional" /> <PlanBadge plan="Enterprise" />

不同等级能用的最短周期不同，详见本页下方的[「API 等级与可用周期」](#api-等级与可用周期)。

<Tag variant="freq" text="每 5 秒" />

<ApiParamsSlot />

## 响应数据

`data` 为数组，每个元素是一个时间点的盘口统计：在 `range` 指定的价格范围内，买盘和卖盘各有多少挂单。`time` 为周期的开始时间（毫秒），数据取的是该时刻的盘口快照，不是周期内的累计或平均值。

> 📘 bids 是买盘，asks 是卖盘
>
> 字段名中含 `bids` 的是买盘（买单）挂单，含 `asks` 的是卖盘（卖单）挂单。示例注释中的「多单」「空单」指的也是买盘、卖盘挂单；它们是现货订单簿上的买卖挂单，不是多空持仓。

> 📘 `range` 的单位是 %
>
> `range=1` 表示价格上下 1% 以内，不是 100%。换不同的 `range` 可以比较近端和远端的挂单厚度。

`200` · application/json · 响应示例见右侧面板。

| 字段                     | 类型              | 必返 | 说明                                    |
| :--------------------- | :-------------- | :- | :------------------------------------ |
| `code`                 | string          | 是  | 业务状态码，`"0"` 表示成功                      |
| `msg`                  | string          | 否  | 结果说明                                  |
| `data`                 | array of object | 是  | 盘口深度数组，按时间从早到晚排列                      |
| `data[].bids_usd`      | number          | 是  | 买盘在 `range` 范围内的挂单总金额，美元              |
| `data[].bids_quantity` | number          | 是  | 买盘在 `range` 范围内的挂单总数量，币的数量，例如 BTC 的个数 |
| `data[].asks_usd`      | number          | 是  | 卖盘在 `range` 范围内的挂单总金额，美元              |
| `data[].asks_quantity` | number          | 是  | 卖盘在 `range` 范围内的挂单总数量，币的数量，例如 BTC 的个数 |
| `data[].time`          | integer（int64）  | 是  | 周期开始时间，毫秒时间戳（UTC）                     |

## API 等级与可用周期

**所有 API 等级都可以调用本接口**，区别在于能使用的数据周期：等级越低，能用的最短周期越长。各等级价格见 [API 等级](https://www.coinglass.com/zh/pricing)。

| API 等级 | 能否调用 | 可用的周期（`interval` 参数）                                    |
| :----- | :--- | :------------------------------------------------------ |
| 业余     | ✅ 可以 | 4 小时及以上：`4h`、`6h`、`8h`、`12h`、`1d`、`1w`                  |
| 初创     | ✅ 可以 | 30 分钟及以上：`30m`、`1h`、`2h`、`4h`、`6h`、`8h`、`12h`、`1d`、`1w` |
| 标准     | ✅ 可以 | 全部周期，最短 1 分钟（`1m`）                                      |
| 专业     | ✅ 可以 | 全部周期，最短 1 分钟（`1m`）                                      |
| 企业     | ✅ 可以 | 全部周期，最短 1 分钟（`1m`）                                      |

## 用 AI 调用本接口

选一个任务，点「在 ChatGPT 中打开」或「在 Claude 中打开」，AI 会先读取本页说明，再直接给出结果；也可以点「复制」，把完整提示词粘贴到你常用的 AI 工具里。

<AskAi
  prompts={[
    { label: "用 Python 获取数据", desc: "让 AI 写一个 Python 函数，获取 Binance BTCUSDT 现货最近 7 天 ±1% 范围内的买卖盘深度。", text: "请阅读 https://docs.coinglass.com/v4.0-zh/reference/spot-orderbook-history.md ，用 Python 写一个函数：获取 Binance 交易所 BTCUSDT 现货最近 7 天的挂单深度历史（interval=1h，range=1），API Key 从环境变量 COINGLASS_API_KEY 读取，返回 pandas DataFrame，time 转为 UTC 时间，并新增一列买卖盘金额比 bids_usd / asks_usd。" },
    { label: "对比现货和合约深度", desc: "让 AI 写代码，把同一交易对的现货和合约挂单深度画在一张图里。", text: "请阅读 https://docs.coinglass.com/v4.0-zh/reference/spot-orderbook-history.md 和 https://docs.coinglass.com/v4.0-zh/reference/futures-orderbook-history.md ，用 Python 分别获取 Binance BTCUSDT 现货和合约最近 7 天的挂单深度（interval=1h，range=1），按 time 对齐后，用 matplotlib 画出两者的 bids_usd 和 asks_usd 折线，并计算每个时间点现货买盘金额占现货加合约买盘合计的比例。API Key 从环境变量 COINGLASS_API_KEY 读取。" },
    { label: "看懂这个接口", desc: "让 AI 用白话解释参数和返回字段。", text: "请阅读 https://docs.coinglass.com/v4.0-zh/reference/spot-orderbook-history.md ，用通俗的话告诉我：这个接口返回什么数据、bids 和 asks 分别是什么、range 参数怎么填，以及现货买卖盘挂单失衡通常说明什么。" },
  ]}
/>

本接口通过 REST API 提供数据，可使用上方提示词让 AI 编写调用代码。MCP 可调用的工具见 [CoinGlass MCP](https://docs.coinglass.com/v4.0-zh/reference/mcp-service)。

## 应用场景

<ChoiceCards columns={2}>

| 场景 | 说明 |
| :-- | :-- |
| 观察现货支撑与压力 | 买盘挂单明显多于卖盘时，下方承接较强；卖盘更厚时，上方抛压较大。 |
| 跟踪现货流动性 | 对比不同时间的挂单总金额，判断现货市场深度是在变厚还是变薄，深度变薄时价格更容易大幅波动。 |
| 对比现货与合约 | 与[合约交易对挂单深度历史](https://docs.coinglass.com/v4.0-zh/reference/futures-orderbook-history)按 `time` 对齐，观察现货和合约盘口哪边的买盘或卖盘更强。 |
| 构建量化因子 | 用 `bids_usd / asks_usd` 等买卖盘失衡指标作为择时或风控因子，配合不同 `range` 做回测。 |

</ChoiceCards>

## 相关接口

| 接口                                                                                         | 区别                             |
| :----------------------------------------------------------------------------------------- | :----------------------------- |
| [现货币种聚合挂单深度历史（±范围）](https://docs.coinglass.com/v4.0-zh/reference/spot-aggregated-history)  | 多个现货交易所合计的币种挂单深度               |
| [现货订单簿历史（热力图）](https://docs.coinglass.com/v4.0-zh/reference/spot-orderbook-heatmap)        | 逐个价格档位的现货挂单明细，可画热力图            |
| [现货大额订单簿](https://docs.coinglass.com/v4.0-zh/reference/spot-large-limit-order)             | 当前现货订单簿中的大额限价挂单                |
| [合约交易对挂单深度历史（±范围）](https://docs.coinglass.com/v4.0-zh/reference/futures-orderbook-history) | 同类数据的合约版本                      |
| [现货支持的交易所和交易对](https://docs.coinglass.com/v4.0-zh/reference/spot-suported-exchange-pairs)  | 查询 `exchange` 和 `symbol` 的可用写法 |

## 常见问题

<Accordion title="bids 和 asks 是多单和空单吗？" icon="fa-circle-question">
  不是多空持仓。`bids` 是买盘挂单，`asks` 是卖盘挂单，统计的是现货订单簿上 `range` 范围内的买卖挂单。本页示例注释里的「多单」「空单」，指的就是买盘和卖盘的挂单。
</Accordion>

<Accordion title="range 填 1 是 1% 还是 100%？" icon="fa-circle-question">
  是 1%，表示价格上下 1% 以内的挂单，默认就是 `1`。可以改成 `2`、`5` 等查看更大范围。
</Accordion>

<Accordion title="传了 limit=2，为什么返回了 3 条？" icon="fa-circle-question">
  同时传了 `start_time` 和 `end_time` 时，返回条数以时间范围为准，可能多于 `limit`。`interval=1h`、时间范围 3 小时、`limit=2` 时返回了 3 条。只想要固定条数时，可以只传 `limit`，或在拿到结果后自行截取。
</Accordion>

<Accordion title="`4h`、`1d` 周期的数值是周期内的累计吗？" icon="fa-circle-question">
  不是。每条数据是该周期开始时刻的盘口快照，不是周期内的求和或平均。例如 `interval=1d` 返回的是每天 00:00（UTC）时的挂单情况。
</Accordion>

## 深入了解：现货订单簿深度

### 什么是现货订单簿深度？

订单簿深度指在某个价格范围内挂着多少买单和卖单。深度越大，大额买卖对价格的冲击越小；深度越薄，价格越容易被推动。

### 现货深度和合约深度有什么不同？

现货挂单买卖的是币本身，合约挂单可以加杠杆，两者的深度可能相差很大。2026-10-20 01:00（UTC）Binance BTCUSDT 价格上下 1% 以内的买盘挂单，现货约 2673 万美元，[合约](https://docs.coinglass.com/v4.0-zh/reference/futures-orderbook-history)约 2.12 亿美元，接近 8 倍。

### 为什么要看 ±1%、±2%、±5% 不同范围？

±1% 反映离当前价格最近、最容易被成交的挂单；±5% 包含更远的挂单，更能看出大资金的布局。对比不同范围，可以判断挂单是集中在近处还是远处。

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "CoinGlass API",
    "version": "4.0.0"
  },
  "servers": [
    {
      "url": "https://open-api-v4.coinglass.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "CG-API-KEY"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/api/spot/orderbook/ask-bids-history": {
      "get": {
        "summary": "Orderbook Bid&Ask(±range)",
        "description": "The API retrieves historical data of the order book for spot trading. (https://www.coinglass.com/pro/depth-delta)",
        "operationId": "spot-orderbook-history",
        "parameters": [
          {
            "name": "exchange",
            "in": "query",
            "required": true,
            "description": "现货交易所名称，必填，例如 `Binance`、`OKX`。可查询的交易所见「[现货支持的交易所和交易对](https://docs.coinglass.com/v4.0-zh/reference/spot-suported-exchange-pairs)」接口。",
            "schema": {
              "type": "string",
              "default": "Binance"
            },
            "example": "Binance"
          },
          {
            "name": "symbol",
            "in": "query",
            "required": true,
            "description": "现货交易对代码，必填，例如 `BTCUSDT`。不同交易所的写法不同，例如 OKX 为 `BTC-USDT`、Coinbase 为 `BTC-USD`，可查询的交易对见「[现货支持的交易所和交易对](https://docs.coinglass.com/v4.0-zh/reference/spot-suported-exchange-pairs)」接口。",
            "schema": {
              "type": "string",
              "default": "BTCUSDT"
            },
            "example": "BTCUSDT"
          },
          {
            "name": "interval",
            "in": "query",
            "required": true,
            "description": "数据周期，必填，例如 `1d`。可选 `1m`、`3m`、`5m`、`15m`、`30m`、`1h`、`2h`、`4h`、`6h`、`8h`、`12h`、`1d`、`1w`。能用的最短周期取决于 API 等级：业余为 `4h`，初创为 `30m`，标准及以上为 `1m`。",
            "schema": {
              "type": "string",
              "default": "1d"
            },
            "example": "1d"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "返回的数据条数，默认 `1000`，可传 1～1000。同时传 `start_time` 和 `end_time` 时，返回条数由时间范围决定，不一定等于 `limit`。",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1000,
              "maximum": 1000
            }
          },
          {
            "name": "start_time",
            "in": "query",
            "required": false,
            "description": "开始时间，毫秒时间戳（UTC），例如 `1790812800000`（2026-10-01 00:00 UTC）。返回数据的 `time` 满足 `start_time ≤ time < end_time`：包含开始时间，不包含结束时间。",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "end_time",
            "in": "query",
            "required": false,
            "description": "结束时间，毫秒时间戳（UTC），例如 `1792022400000`（2026-10-15 00:00 UTC）。返回数据的 `time` 满足 `start_time ≤ time < end_time`：包含开始时间，不包含结束时间。不传起止时间时，以当前时间为终点，按 `interval × limit` 向前推算；结束时间晚于当前时间时按当前时间处理。",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "description": "统计挂单的价格范围（±百分比），选填，默认 `1`，即价格上下 1% 以内的挂单；传 `2` 表示上下 2% 以内。能查到数据的取值以该市场实际生成的档位为准，并不是任意小数都有数据；Binance `BTCUSDT` 传 `1`、`2`、`5` 都有数据。",
            "schema": {
              "type": "string",
              "default": "1"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": {
                      "code": "0",
                      "data": [
                        {
                          "bids_usd": 26731822.4853,
                          "bids_quantity": 328.44318,
                          "asks_usd": 21544772.8719,
                          "asks_quantity": 262.94234,
                          "time": 1792458000000
                        },
                        {
                          "bids_usd": 25629031.795,
                          "bids_quantity": 314.7272,
                          "asks_usd": 19611956.9045,
                          "asks_quantity": 239.07349,
                          "time": 1792461600000
                        }
                      ]
                    }
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "description": "业务状态码，\"0\" 表示成功",
                      "example": "0"
                    },
                    "msg": {
                      "type": "string",
                      "description": "结果说明",
                      "example": "success"
                    },
                    "data": {
                      "type": "array",
                      "description": "盘口深度数组，按时间从早到晚排列",
                      "items": {
                        "type": "object",
                        "properties": {
                          "bids_usd": {
                            "type": "number",
                            "description": "买盘在 range 范围内的挂单总金额，美元"
                          },
                          "bids_quantity": {
                            "type": "number",
                            "description": "买盘在 range 范围内的挂单总数量，币的数量，例如 BTC 的个数"
                          },
                          "asks_usd": {
                            "type": "number",
                            "description": "卖盘在 range 范围内的挂单总金额，美元"
                          },
                          "asks_quantity": {
                            "type": "number",
                            "description": "卖盘在 range 范围内的挂单总数量，币的数量，例如 BTC 的个数"
                          },
                          "time": {
                            "type": "integer",
                            "description": "周期开始时间，毫秒时间戳（UTC）",
                            "format": "int64"
                          }
                        },
                        "required": [
                          "bids_usd",
                          "bids_quantity",
                          "asks_usd",
                          "asks_quantity",
                          "time"
                        ]
                      }
                    }
                  },
                  "required": [
                    "code",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```