> ## 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+，实际开放范围以当前 API Key 的 `GET /v1/discover` 返回为准。

## 可以用来做什么

回答“已经找到这张合约，接下来哪些日期能查到报价或成交数据”。结果是日期清单，每种 `data_type` 单独查询。

* 在历史行情日期选择器中标出有数据的日期。
* 下载历史行情前确定有数据的日期范围，减少查询空日期。
* 核对研究所需日期的数据覆盖情况，为缺失日期制定处理方式。

同一合约的报价日期和成交日期可能不同。例如某天有报价但没有成交，两个列表就可能只在 `quote` 查询中包含该日。取得日期后，再通过历史行情端点读取所需价格序列。[期权历史行情](https://docs.yehangshe.com/api/domains/options.md)

## 请求

`GET /v1/options/available-dates/{contract}`

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

| 参数 | 位置 | 要求 |
| - | - | - |
| contract | path | 精确 OCC 合约代码，例如 SPXW261120C06700000 |
| data\_type | query | quote 或 trade，默认 quote |
| limit | query | 可选，每页最多条数 |
| cursor | query | 可选，上一页的 next\_cursor |

支持查询已到期合约。精确使用合约的根代码、到期日、方向和行权价，SPXW 合约应保留 SPXW 根代码。可以先从指定日期的合约目录中选择合约。[合约目录](https://docs.yehangshe.com/api/options-contracts-on-date.md)

合约代码中的行权价必须大于零。八位行权价段全零时返回 `400 VALIDATION_ERROR`，消耗 0 unit。

```bash theme={null}
curl --get 'https://api.yehangshe.com/v1/options/available-dates/SPXW261120C06700000' \
  --data-urlencode 'data_type=quote' \
  --data-urlencode 'limit=400' \
  -H 'Authorization: Bearer sk_live_xxxxxxxx'
```

## 响应

顶层 `contract_symbol / expiration / strike_usd / right` 描述查询的合约，`data_type` 回显数据类别。`total_dates` 是完整列表数量，`returned_dates` 是本页数量。`dates` 按日期升序，每行包含一个 YYYY-MM-DD 美东日历日期。

以下以两条结果演示字段结构。

```json theme={null}
{
  "data": {
    "contract_symbol": "SPXW261120C06700000",
    "expiration": "2026-11-20",
    "strike_usd": 6700,
    "right": "C",
    "data_type": "quote",
    "as_of": null,
    "total_dates": 2,
    "returned_dates": 2,
    "dates": [
      {
        "date": "2026-06-17"
      },
      {
        "date": "2026-06-18"
      }
    ]
  },
  "_meta": {
    "data_freshness_seconds": null,
    "next_cursor": null,
    "truncated": false
  }
}
```

## 分页与计量

`limit` 范围 1–1000，默认 400，响应大小预算可能使实际页长更小。保留查询条件，将 `_meta.next_cursor` 原样传入下一次请求的 `cursor`，直到 next\_cursor 为 null。`_meta.truncated=true` 表示还有下一页。cursor 与查询条件、目录内容绑定，目录变化后旧 cursor 返回 400，此时从首页重新查询。

每个成功的 HTTP 200 页消耗 **1 unit**，202 和错误响应计 0 unit。首次请求可能返回 202，按 Retry-After 或 `_meta.retry_after_seconds` 有界重试到 200。`data_type=quote` 与 `data_type=trade` 分别表示有报价记录和有成交记录的目录，两者结果可能不同。

目录的 `as_of` 与 `_meta.data_freshness_seconds` 为 null。它们没有发布时刻，返回日期表示数据可用范围。错误参数返回 400，暂时没有可用结果时可能返回 503 `READ_MODEL_UNAVAILABLE`，请按重试提示有限重试。通用规则见 [错误处理](https://docs.yehangshe.com/errors.md) 和 [配额与限流](https://docs.yehangshe.com/api/quota-and-rate-limits.md)。


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