agentsclimarketplace

Index detail

Skill FTShare-Lab/FTShare-skills/ftshare-market-data/sub-skills/index-detail

Get single index detail (单只指数详情). Use when user asks about 某只指数详情、指数行情、上证指数、沪深300、指数名称/点位/涨跌幅/成交.From its SKILL.md

Install
npx -y skills add FTShare-Lab/FTShare-skills --skill index-detail

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

4.4 KB, ~1.5k tokens by cl100k_base, as published. Nobody here has run it

单只指数详情 - 查询单只指数详情

1. 接口描述

项目说明
接口名称查询单只指数详情
外部接口GET /api/v1/market/data/daec/index?symbol=:index
请求方式GET
适用场景获取 A 股指定指数的详情(名称、行情点位、成交、涨跌幅等);支持通过 masks 按需返回部分字段

2. 请求参数

说明:index 为路径参数(必填),masks 为可选项。

参数名类型是否必填描述取值示例备注
indexstring是指数标的键(路径参数,带市场后缀)000001.XSHG、399001.XSHE、920036.BJ沪 .XSHG、深 .XSHE、北交所 .BJ
masksstring否字段掩码,逗号分隔的字段名,仅返回这些字段name,symkey,latest,change_rate不传则返回全部字段;字段名须匹配正则 ^[a-zA-Z_][a-zA-Z0-9_]*$(首字符为字母或下划线,后续可为字母、数字、下划线),非法字段名会报错

3. 响应说明

返回单只指数对象,与代码 Index 一致。不传 masks 时返回全部字段,传 masks 时仅返回指定字段;各字段均可能为 null 或不存在。点位与价格类保留 4 位小数。

{
    "name": "上证指数",
    "symkey": "000001.XSHG",
    "latest": 3252.30,
    "prev_close": 3245.67,
    "change": 6.63,
    "change_rate": 0.0020,
    "volume": 280000000,
    "turnover": 350000000000.0,
    "amplitude": 0.0052
}

根字段(部分常用)

字段名类型是否可为空说明单位
namestring是指数名称—
symkeystring是标的键—
symbol_idstring是标的 ID—
ex_idstring是市场 ID—
latestfloat是最新点位点
closefloat是收盘点位点
openfloat是开盘点位点
highfloat是最高点位点
lowfloat是最低点位点
prev_closefloat是昨收点位点
changefloat是涨跌点位点
change_ratefloat是涨跌幅%
volumelong是成交量—
turnoverfloat是成交额元
amplitudefloat是振幅%
change_rate_5dfloat是5 日涨跌幅%
change_rate_10dfloat是10 日涨跌幅%
change_rate_20dfloat是20 日涨跌幅%
change_rate_60dfloat是60 日涨跌幅%
change_rate_120dfloat是120 日涨跌幅%
change_rate_6mfloat是6 月涨跌幅%
change_rate_1yfloat是1 年涨跌幅%
change_rate_2yfloat是2 年涨跌幅%
change_rate_3yfloat是3 年涨跌幅%
change_rate_ytdfloat是今年至今涨跌幅%

4. 用法

通过主目录 run.py 调用(必填 --index,可选 --masks):

python <RUN_PY> index-detail --index 000001.XSHG
python <RUN_PY> index-detail --index 399001.XSHE --masks name,symkey,latest,change_rate,volume,turnover

或在子 skill 目录下执行:python scripts/handler.py --index 000001.XSHG(可选 --masks)。<RUN_PY> 为主 SKILL.md 同级的 run.py 绝对路径。脚本输出 JSON,请求头已内置 X-Client-Name: ft-claw。

5. 请求示例

GET /api/v1/market/data/daec/index?symbol=000001.XSHG

完整请求示例(curl)

curl -X GET "<BASE_URL>/api/v1/market/data/daec/index?symbol=000001.XSHG" \
  -H 'X-Client-Name: ft-claw' \
  -H 'Content-Type: application/json'

6. 数据更新时间与注意事项

  • 数据更新时间以接口/行情源为准。
  • 涨跌幅 change_rate 等比率字段在接口中可能为小数形式,展示时按需乘以 100 转为百分比。
  • 成交量、成交额等大数字展示时可按需换算单位(如万、亿)。
  • 完整字段以代码 Index 为准;未传 masks 时返回全部可用字段。
  • 若用户输入的是指数名称/简称而非代码,建议先调用 index-description-all 或 index-list-paginated 映射出唯一 symkey,再调用本接口。

What ships with it: 2 files

7.7 KB alongside SKILL.md, 2 of them executable

scripts/

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.