期货合约信息
POST
https://jinniu.ziyoutang.com/api/fut_basic查询期货普通、主力及连续合约资料;exchange 必填。需要开通“期货历史”权限,期限与期货历史分钟线一致;不包含实时权限。
| 参数 | 必填 | 说明 |
|---|---|---|
| api_key | 是 | 账户 API Key,也可通过 X-Api-Key 请求头传入。 |
| exchange | 是 | 交易所代码:CFFEX、DCE、CZCE、SHFE、INE、GFEX。 |
| fut_type | 否 | 合约类型:1 普通合约,2 主力与连续合约;不填取全部。 |
| fut_code | 否 | 产品代码,如 CU、AG、IF,不带交易所后缀。 |
| list_date | 否 | 上市起始日期,YYYYMMDD 或 YYYY-MM-DD。 |
| limit | 否 | 1 至 5000,默认 5000;全站设置与本接口限制取较小值。 |
| offset | 否 | 偏移行数,默认0,最大10000000。保持筛选条件不变,按 next_offset 继续;possibly_more=true 仅表示本页已满,可继续查询,直到返回不足 limit 条。 |
| fields | 否 | 逗号分隔的返回字段;不填返回默认字段。可选:ts_code,symbol,exchange,name,fut_code,multiplier,trade_unit,per_unit,quote_unit,quote_unit_desc,d_mode_desc,list_date,delist_date,d_month,last_ddate。 |
日期、代码和筛选条件不满足要求时返回 HTTP 400,并附英文原因。除合约信息外,需提供合约/产品代码、交易日期或日期范围;持仓排名至少填 trade_date 或 symbol。空值保留 null。
调用示例
curl -X POST 'https://jinniu.ziyoutang.com/api/fut_basic' \
-H 'Content-Type: application/json' \
-H 'X-Api-Key: YOUR_API_KEY' \
-d '{"exchange": "SHFE", "fut_code": "CU", "limit": 2}'
返回字段
| 字段 | 说明 |
|---|---|
| ts_code | 合约或主力连续代码;无单位。 |
| symbol | 不带交易所后缀的合约或产品代码;无单位。 |
| exchange | 交易所代码;无单位。 |
| name | 合约名称;无单位。 |
| fut_code | 产品代码;无单位。 |
| multiplier | 合约乘数,主要适用于股指、国债期货;按合约定义。 |
| trade_unit | 交易计量单位名称。 |
| per_unit | 每手交易单位数量。 |
| quote_unit | 价格报价单位。 |
| quote_unit_desc | 最小报价变动说明。 |
| d_mode_desc | 交割方式说明。 |
| list_date | 上市日期,YYYYMMDD。 |
| delist_date | 最后交易日期,YYYYMMDD。 |
| d_month | 交割月份,YYYYMM。 |
| last_ddate | 最后交割日期,YYYYMMDD。 |
| data.meta.returned_count | 实际返回数量,单位:条。 |
| data.meta.limit / max_rows / offset / next_offset | 本次分页大小、当前有效上限、偏移、下一页偏移;单位:条。末页 next_offset 为 null。 |
| data.meta.possibly_more | 本页是否已满;不代表一定存在下一条。 |
返回结构示例
{"data": {"fields": ["ts_code", "symbol", "exchange", "name", "fut_code", "multiplier", "trade_unit", "per_unit", "quote_unit", "quote_unit_desc", "d_mode_desc", "list_date", "delist_date", "d_month", "last_ddate"], "items": [], "meta": {"limit": 2, "next_offset": null, "offset": 0, "possibly_more": false, "returned_count": 0}}, "message": "", "success": true}
SDK:client.fut_basic(...);MCP 工具:fut_basic。调用频率、并发及错误处理统一见调用规则。