> ## Documentation Index
> Fetch the complete documentation index at: https://docs.yehangshe.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 股票历史最优买卖报价

> 按时间回放一只股票的全市场最优买卖报价，可用来研究价差和挂量变化。

按时间回放一只股票的全市场最优买卖报价，可用来研究价差和挂量变化。

Pro 和 Pro+ 共用此端点。当前 Key 可用的端点见 `GET /v1/discover`。

## 请求

`GET /v1/stocks/nbbo-history/{ticker}`

MCP 命令为 `stocks.nbbo_history`。需要 `derived:read` 或 `data-api:read` scope。

`date` 为美东交易日。`start_time` 含起点、`end_time` 不含终点，支持 HH:MM:SS 或 HH:MM:SS.sss，日终可写 24:00:00。单次最多 5 秒。合并行情有 15 分钟延迟，区间终点须至少早于当前时间 15 分钟。

```bash theme={null}
curl -H "Authorization: Bearer $DATA_API_KEY" \
  'https://api.yehangshe.com/v1/stocks/nbbo-history/SPY?date=2026-11-24&start_time=09:30:00&end_time=09:30:05'
```

## 读懂结果

`quotes` 每条含 `quoted_at`、`bid_usd`、`ask_usd`、`bid_size`、`ask_size`。价格单位为美元。相同毫秒内可以发生多次更新，每次更新各占一条。响应里的时间戳为 UTC。

`total_quotes` 为本次查询总条数，`returned_quotes` 为本页条数。`limit` 默认 400，上限 1000。每页还受响应大小限制。把 `_meta.next_cursor` 传给相同查询的 `cursor`，直到返回 `null`。

一次实际响应中的一条记录如下。

```json theme={null}
{
  "quoted_at": "2026-11-24T14:30:00.000Z",
  "bid_usd": 715.11,
  "ask_usd": 715.18,
  "bid_size": 320,
  "ask_size": 1000
}
```

## 计量

每 5 条报价 1 unit，按本页实际条数向上取整。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.