agentsclimarketplace

Etf list paginated

Skill FTShare-Lab/FTShare-skills/ftshare-market-data/sub-skills/etf-list-paginated

ETF 分页列表,支持分页、排序、筛选(market.ft.tech)。用户问 ETF 列表、全市场 ETF、按涨跌幅排序的 ETF、筛选某类 ETF 时使用。From its SKILL.md

Install
npx -y skills add FTShare-Lab/FTShare-skills --skill etf-list-paginated

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

SKILL.md

3.7 KB, ~1.3k tokens by cl100k_base, as published. Nobody here has run it

ETF 分页列表 - 分页、排序、筛选

1. 接口描述

项目说明
接口名称ETF 分页列表
外部接口GET /api/v1/market/data/daec/etfs
请求方式GET
适用场景分页获取 A 股 ETF 列表,支持按字段排序、按条件筛选、按需返回字段(masks);不传分页参数时返回全部(先筛选、排序后再截断)

2. 请求参数

说明:所有参数均为可选项。不传 order_by 且不传 ob 时默认按 change_rate desc 排序;不传分页时返回满足条件的全部 ETF。

参数名类型是否必填描述取值示例备注
order_bystring否排序方式,格式为「字段 方向」,多字段用逗号分隔change_rate desc、name asc方向:asc/a 升序,desc/d 降序;字段为 Etf 字段名
obstring否与 order_by 同义同 order_by与 order_by 二选一,同时传以 order_by 为准
filterstring否过滤条件表达式change_rate != null、name ~ "沪深"见下方 filter 取值说明
masksstring否字段掩码,逗号分隔,仅返回这些字段name,symkey,latest,change_rate不传则返回全部字段
page_sizeint否每页条数20不传则不分页
page_noint否页码,从 1 开始1不传且传了 page_size 时默认为 1
filter_indexboolean否是否需要指数过滤true、false默认 false

filter 取值说明:表达式语法为 字段 操作符 值。比较操作符:=、!=、>、>=、<、<=;~ 子串包含;: 包含。逻辑组合:AND、OR、NOT,可用 () 分组。值可为 null、true、false、数字、双引号字符串。复杂表达式可 Base64 编码后以 _B64: 开头传入。示例:change_rate != null、change_rate >= 0 AND change_rate <= 0.1、name ~ "科技"。

3. 响应说明

返回分页后的 ETF 列表及总数。列表中每项为单只 ETF 对象(结构同单只 ETF 详情);不传 masks 时每只返回全部字段。

{
    "total_size": 800,
    "etfs": [
        { "name": "上证50ETF", "symkey": "510050.XSHG", "latest": 2.85, "change_rate": 0.0018 },
        { "name": "创业板ETF", "symkey": "159915.XSHE", "latest": 1.92, "change_rate": -0.0052 }
    ]
}
字段名类型说明
total_sizeint满足筛选条件的 ETF 总数(分页前)
etfsarray当前页的 ETF 列表;单条字段同「单只 ETF 详情」(name、symkey、latest、change_rate、volume、turnover 等)

4. 用法

通过主目录 run.py 调用(参数均可选):

python <RUN_PY> etf-list-paginated
python <RUN_PY> etf-list-paginated --order_by "change_rate desc" --page_size 20 --page_no 1
python <RUN_PY> etf-list-paginated --order_by "name asc" --masks name,symkey,latest,change_rate --page_size 50
python <RUN_PY> etf-list-paginated --filter "change_rate >= 0.01 AND change_rate <= 0.05"

<RUN_PY> 为主 SKILL.md 同级的 run.py 绝对路径。脚本输出 JSON,请求头已内置 X-Client-Name: ft-claw。

5. 请求示例

GET /api/v1/market/data/daec/etfs?order_by=change_rate%20desc&page_size=20&page=1

6. 注意事项

  • 涨跌幅等比率字段可能为小数形式,展示时按需乘以 100 转为百分比
  • 不传 page_size/page_no 时返回全部满足条件的 ETF,数据量大时注意响应体积

What ships with it: 2 files

9.2 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.