Coding

Futures Inquiry - 期货查询

Query live and historical futures data across five major Chinese exchanges.

What it does

Retrieve futures quotes from SHFE, DCE, CZCE, CFFEX, and GFEX, optionally filtering by contract code. The included Python script uses a JisuAPI AppKey and returns latest price, change, intraday high/low, volume, open interest, bid/ask data, and update time. Historical queries return OHLC, change, volume, and open interest for a specified contract and date range.

When to use it

  • Checking a main contract’s latest price
  • Comparing today’s high, low, and percentage change
  • Reviewing a contract over a date range
  • Looking up volume, open interest, or bid/ask quotes

The skill document

极速数据期货查询(Jisu Futures)

数据由 极速数据(JisuAPI) 提供 — 提供上海、大连、郑州、中金、广州等交易所期货价格查询。

何时使用本技能

  • 期货价格主力合约某品种涨跌(如螺纹钢、豆粕、PTA、工业硅、IF 股指)
  • 五大交易所行情:上期所、大商所、郑商所、中金所、广期所
  • 历史走势:指定合约在某段时间的开高低收、成交量、持仓量

技术前提: 脚本 skills/futures/futures.py,环境变量 JISU_API_KEY

接口与数据范围:

  • 上海期货交易所/futures/shfutures
  • 大连商品交易所/futures/dlfutures
  • 郑州商品交易所/futures/zzfutures
  • 中国金融期货交易所/futures/zgjrfutures
  • 广州期货交易所/futures/gzfutures
  • 期货历史查询/futures/history

各交易所实时接口返回:品种代号、名称、最新价、涨跌幅、涨跌量、最高/最低价、开盘价、昨收盘价、成交量、持仓量、买卖价量、更新时间等。

前置配置:获取 API Key

  1. 前往 极速数据官网 注册账号
  2. 进入 期货查询 API 页面,点击「申请数据」
  3. 在会员中心获取 AppKey
  4. 配置 Key:
# Linux / macOS
export JISU_API_KEY="your_appkey_here"

# Windows PowerShell
$env:JISU_API_KEY="your_appkey_here"

脚本路径

脚本文件:skills/futures/futures.py

使用方式

1. 上海期货交易所(/futures/shfutures)

python3 skills/futures/futures.py shfutures

# 指定品种(可选 type)
python3 skills/futures/futures.py shfutures '{"type":"FU2309"}'

2. 大连商品交易所(/futures/dlfutures)

python3 skills/futures/futures.py dlfutures
python3 skills/futures/futures.py dlfutures '{"type":"V0"}'

3. 郑州商品交易所(/futures/zzfutures)

python3 skills/futures/futures.py zzfutures
python3 skills/futures/futures.py zzfutures '{"type":"TA0"}'

4. 中国金融期货交易所(/futures/zgjrfutures)

python3 skills/futures/futures.py zgjrfutures
python3 skills/futures/futures.py zgjrfutures '{"type":"IF2306"}'

5. 广州期货交易所(/futures/gzfutures)

python3 skills/futures/futures.py gzfutures
python3 skills/futures/futures.py gzfutures '{"type":"SI0"}'

6. 期货历史查询(/futures/history)

按交易所、合约代码与日期区间查询历史开高低收、涨跌幅、成交量、持仓量等。

python3 skills/futures/futures.py history '{"market":"shfutures","type":"SC2703","startdate":"2026-06-01","enddate":"2026-06-10"}'

请求 JSON:

{
  "market": "shfutures",
  "type": "SC2703",
  "startdate": "2026-06-01",
  "enddate": "2026-06-10"
}
字段名类型必填说明
marketstringshfutures / dlfutures / zzfutures / zgjrfutures / gzfutures
typestring期货类型代码,如 SC2703TA0IF2306
startdatestring开始日期
enddatestring结束日期

各交易所实时接口可选参数

字段名类型必填说明
typestring期货类型代码

实时接口 result 按品种名称分组,例如 {"燃油": [...], "铜": [...]}

返回结果示例(节选)

上海期货交易所(实时)

{
  "燃油": [
    {
      "type": "FU2309",
      "typename": "燃料油2309",
      "price": "2948.00",
      "changepercent": "+6.27%",
      "changequantity": "+174",
      "maxprice": "2975.00",
      "minprice": "2777.00",
      "openingprice": "2782.00",
      "lastclosingprice": "2774.000",
      "tradeamount": "704525",
      "holdamount": "295063",
      "buyamount": "47",
      "buyprice": "2947.000",
      "sellamount": "66",
      "sellprice": "2948.000",
      "updatetime": "2023-04-03 15:46:43"
    }
  ]
}

期货历史查询

{
  "market": "shfutures",
  "type": "SC2703",
  "startdate": "2026-06-01",
  "enddate": "2026-06-10",
  "count": 8,
  "list": [
    {
      "typename": "上海原油2703",
      "date": "2026-06-10",
      "openingprice": 562,
      "maxprice": 565.6,
      "minprice": 550.8,
      "price": 559.2,
      "changeamount": -5.8,
      "changepercent": "-1.027%",
      "tradeamount": 23,
      "holdamount": 0
    }
  ]
}

当无数据时,脚本会输出:

{
  "error": "api_error",
  "code": 201,
  "message": "没有信息"
}

常见错误码

来源于 极速数据期货文档

代号说明
201没有信息

系统错误码:

代号说明
101APPKEY 为空或不存在
102APPKEY 已过期
103APPKEY 无请求此数据权限
104请求超过次数限制
105IP 被禁止
106IP 请求超过限制
107接口维护中
108接口已停用

推荐用法

  1. 实时行情:用户问「PTA、燃油今天什么价?」

    • 调用 zzfuturesshfutures 等对应交易所
    • 从返回的分组结果中按品种名(如 PTA燃油)筛选合约,汇总 pricechangepercentmaxpriceminprice
  2. 单合约查询:已知合约代码时加 type 参数,减少返回体积:
    python3 skills/futures/futures.py zzfutures '{"type":"TA0"}'

  3. 历史走势:用户问「SC2703 最近一周走势」

    • 调用 historymarket 与交易所子命令一致(如上期所 → shfutures
    • list 中的开高低收、涨跌幅归纳区间表现,并注明数据时效与免责
  4. 交易所对照

    用户说法子命令history 的 market
    上期所、上海shfuturesshfutures
    大商所、大连dlfuturesdlfutures
    郑商所、郑州zzfutureszzfutures
    中金所、股指zgjrfutureszgjrfutures
    广期所、广州gzfuturesgzfutures

关于极速数据

极速数据(JisuAPI,jisuapi.com 是国内专业的 API数据服务平台 之一,提供生活常用、交通出行、工具万能、图像识别、娱乐购物、位置服务等百余类 API。

在官网注册后,按 期货查询 API 申请数据,在会员中心获取 AppKey 进行接入。在 ClawHub 上也可搜索 jisuapi 找到更多基于极速数据的 OpenClaw 技能。

Questions people ask

Which futures exchanges are supported?
It supports the Shanghai Futures Exchange, Dalian Commodity Exchange, Zhengzhou Commodity Exchange, China Financial Futures Exchange, and Guangzhou Futures Exchange.
What does a historical query require and return?
Provide the market, contract code, start date, and end date. Results include daily open, high, low, close, change, percentage change, volume, and open interest when data is available.
What setup is required?
Run `skills/futures/futures.py` with Python and set the `JISU_API_KEY` environment variable to an AppKey obtained after applying for the JisuAPI futures data service.

Related skills

Retrieve structured Chinese market data and research material through a searchable CLI.

86 installs2 stars

Convert Chinese finance questions into checked Tushare research workflows, summaries, and data files.

559 installs33 stars

Turn A-share data and filings into a structured fundamental, valuation, governance, and risk assessment.

78 installs1 stars

Builds a personalized career plan with fit assessments, AI-risk ratings, and staged next steps.

74 installs