Skip to content
Back to skills

Futures Kline

ASecurity

查询期货合约历史 K 线(期货合约日/周/月/季 K 线,futures_kline)。用户问期货合约 K 线、期货日K/周K/月K、合约开高低收、期货成交量持仓量、vwap、持仓量时使用。

  • 65 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added November 9, 2026
ai-agentspythonbashapi

Works with

  • api

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned November 27, 2026

npx -y skills add FTShare-Lab/FTShare-skill --skill futures-kline --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Futures Kline?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Futures Kline
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ftshare-lab-futures-kline/badge)](https://www.skillsdirectory.com/skills/ftshare-lab-futures-kline)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: futures-kline
description: 查询期货合约历史 K 线(期货合约日/周/月/季 K 线,futures_kline)。用户问期货合约 K 线、期货日K/周K/月K、合约开高低收、期货成交量持仓量、vwap、持仓量时使用。
---

# 期货合约历史K线

接口:`GET /api/v1/market/data/futures/kline`。在线文档:[《期货合约历史K线》](https://market.ft.tech/gateway/doc/pages/j3w50zz7.md)

## 1. 接口描述

| 项目 | 说明 |
|------|------|
| 接口名称 | 期货合约历史K线(futures_kline) |
| 外部接口 | `GET /api/v1/market/data/futures/kline` |
| 请求方式 | GET(query 参数) |
| 适用场景 | 查询单个期货合约的历史日、周、月、季 K 线,含开高低收、成交量、成交额、vwap、持仓量 |

## 2. 请求参数

| 参数名 | 类型 | 是否必填 | 描述 | 取值示例 | 备注 |
|--------|------|----------|------|----------|------|
| symbol | string | 是 | 不带交易所后缀的期货合约代码 | A2605 | 请求不区分大小写;CZCE 真实合约必须使用四位年份代码(如 `AP2612`),三位代码不符合接口代码规范 |
| interval | string | 否 | K 线周期 | daily | `daily`、`weekly`、`monthly`、`quarterly`,兼容 `1d`/`1w`/`1mo`/`1q`;默认 `daily` |
| start | int | 否 | 起始时间戳(毫秒) | 1756431000000 | 按北京时间解释,闭区间;可省略时间范围 |
| end | int | 否 | 结束时间戳(毫秒) | 1756791000000 | 闭区间;不能单独传入,须与 `start` 同时使用,跨度不超过 12 个自然月 |
| limit | int | 否 | 返回条数 | 5 | 默认 500,保留查询范围内最新记录 |

## 3. 响应说明

外层固定为 `code` / `message` / `data`。`data` 为对象:`items`(K 线记录列表,按时间升序)和 `total`(查询范围内符合条件的记录数)。

items 数组:

| 字段名 | 类型 | 说明 |
|--------|------|------|
| symbol | string | 不带交易所后缀的官网合约代码;返回大小写沿用对应交易所官网格式,例如 CZCE/CFFEX 通常为大写,其他交易所通常为小写 |
| datetime | int | K 线时间戳(毫秒) |
| trade_date | int | 交易日 YYYYMMDD |
| open / high / low / close | number | 开盘价 / 最高价 / 最低价 / 收盘价 |
| volume | int | 成交量 |
| amount | number | 成交额 |
| vwap | number | 成交量加权均价 |
| open_interest | number | 持仓量 |
| dominant_contract | string / null | 主力合约;当前合约历史 K 线返回 `null` |
| forward_factor | number / null | 前复权因子;当前接口返回 `null` |
| backward_factor | number / null | 后复权因子;当前接口返回 `null` |

## 4. 调用方式

```bash
python <RUN_PY> futures-kline --symbol A2605 --interval daily --limit 5
python <RUN_PY> futures-kline --symbol A2605 --interval weekly --limit 5
python <RUN_PY> futures-kline --symbol A2605 --start 1756431000000 --end 1756791000000
```

`<RUN_PY>` 为主 SKILL.md 同级 `run.py` 的绝对路径。输出 JSON;HTTP 错误输出到 stderr 并以非零状态退出。

## 5. 注意事项

- 合约代码使用不带交易所后缀的裸代码,请求不区分大小写;CZCE 真实合约必须使用四位年份代码(如 `AP2612`),三位代码不符合接口代码规范。
- 周、月、季 K 线由历史日 K 线按北京时间聚合生成。
- `end` 不能单独传入,必须与 `start` 同时使用(handler 会本地校验并拒绝);同时传入时跨度不得超过 12 个自然月。
- 返回结果按 K 线时间升序排列;`limit` 保留查询范围内最新的记录。

Files in this skill

  • SKILL.md3.3 KB
  • scripts/handler.py4 KB
  • scripts/test_handler.py2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.