> ## 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.

# 期权合约历史 K 线

> 查看一张期权在某天或某一分钟的实际成交区间、成交量和笔数，适合画合约价格图或回看一笔交易的入场价

查看一张期权在某天或某一分钟的实际成交区间、成交量和笔数，适合画合约价格图或回看一笔交易的入场价。

适用于 Pro 与 Pro+。实际可用端点见当前 Key 的 `GET /v1/discover`。

## 请求

`GET /v1/options/contract-bars/{contract}`

MCP command 为 `options.contract_bars`，需要 `derived:read` 或 `data-api:read` scope。

contract 为精确 OCC，保留 SPX 或 SPXW 根代码。from、to 为美东日历日期，含首尾，单次最多 31 天，历史深度三年。interval 支持 1m（默认）和 1d。

```bash theme={null}
curl -H "Authorization: Bearer $DATA_API_KEY" \
  'https://api.yehangshe.com/v1/options/contract-bars/SPXW261125P07200000?from=2026-11-24&to=2026-11-24&interval=1m'
```

## 读懂结果

bars 按时间从早到晚排列。date 是美东交易日期。bar\_at 为 UTC 时间，分钟线取 09:30–16:00 美东网格的分钟起点，日线取日终报告时间。open\_usd、high\_usd、low\_usd、close\_usd 的单位为美元，volume\_contracts 按张，trade\_count 为笔数。没有成交的全零占位分钟会缺席。

`total_bars` 为当前查询总行数，`returned_bars` 为本页行数。limit 默认 400、上限 1000，单页大小限制可能让实际返回行数更少。将 `_meta.next_cursor` 原样传给相同查询的 cursor，直到为空。

## 计量

每 20 根 K 线 1 unit，按页向上取整；例如返回 21 根扣 2 units。 预检按 limit（缺省 400）与窗口理论行数中的较小值估算所需余额，余额接近用完时可以调小 limit。


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