Skip to content
index-list-paginated logo

指数分页列表 - 分页、排序、筛选

index-list-paginated

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

SKILL.md

Full skill instructions

指数分页列表 - 分页、排序、筛选

1. 接口描述

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

2. 请求参数

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

参数名类型是否必填描述取值示例备注
order_bystring否排序方式,格式为「字段 方向」,多字段用逗号分隔change_rate desc、name asc方向:asc/​a 升序,desc/​d 降序;字段为 Index 字段名(如 change_rate、name、latest)
obstring否与 order_by 同义同 order_by与 order_by 二选一,同时传以 order_by 为准
filterstring否过滤条件表达式change_rate != null对 Index 字段做条件过滤;可为 _B64: 开头 Base64 编码;语法见下方 filter 取值说明
masksstring否字段掩码,逗号分隔的字段名,仅返回这些字段name,symkey,latest,change_rate不传则返回全部字段;字段名须匹配正则 ^[a-zA-Z_][a-zA-Z0-9_]*$,非法字段名会报错
page_sizeint否每页条数20不传则不分页
page_noint否页码,从 1 开始1不传且传了 page_size 时默认为 1

filter 取值说明(表达式语法,对应代码 crates/​dom/​src/​core/​filter.rs):

  • 基本形式:字段 操作符 值。字段为 Index 的字段名(与 order_by、masks 一致,如 change_rate、name、latest、symkey)。
  • 比较操作符:=、!=、>、>=、<、<=。
  • 其它操作符:~ 子串包含(左为字段、右为字符串);: 包含(具体以实现为准)。
  • 逻辑组合:AND、OR、NOT,可用括号 () 分组。例:(change_rate >= 0 AND change_rate <= 0.05) OR name ~ "上证"。
  • 值:null、true、false、数字、双引号字符串(内部双引号用 \" 转义)。
  • Base64:整段表达式做 Base64 编码后以 _B64: 开头传入。

示例:change_rate != null、latest > 3000、name ~ "上证"。

3. 响应说明

返回分页后的指数列表及总数,与代码 ListIndicesReply 一致。列表中每项为单只指数对象(结构同单只指数详情);不传 masks 时每只指数返回全部字段,传 masks 时仅返回指定字段。

{
    "total_size": 500,
    "indices": [
        { "name": "上证指数", "symkey": "000001.XSHG", "latest": 3252.30, "change_rate": 0.0020 },
        { "name": "深证成指", "symkey": "399001.XSHE", "latest": 10580.50, "change_rate": -0.0015 }
    ]
}

根字段

字段名类型是否可为空说明
total_sizeint否满足筛选条件的指数总数(分页前)
indicesarray否当前页的指数列表;单条结构见下表

单条结构(indices 元素,对应 Index)

以下为部分常用字段;完整字段见代码 Index,点位类保留 4 位小数。

字段名类型是否可为空说明单位
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 调用(参数均可选):

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

或在子 skill 目录下执行:python scripts/​handler.py 加上上述参数。脚本输出 JSON,请求头已内置 X-Client-Name: ft-claw。

5. 请求示例

GET https://market.ft.tech/​app/​api/​v2/​indices?order_by=change_rate%20desc&page_size=20&page_no=1

完整请求示例(curl)

curl -X GET 'https://market.ft.tech/​app/​api/​v2/​indices?order_by=change_rate%20desc&page_size=20&page_no=1' \
  -H 'X-Client-Name: ft-claw' \
  -H 'Content-Type: application/​json'

6. 注意事项

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

More Other skills

Delegate independent tasks to specialized agents working concurrently with isolated context.

295.4K 206.3K
View

Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.

179.7K 100.1K
View

Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.

179.7K 89.5K
View

A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).

179.7K 76.1K
View

Fundamental design principles for writing maintainable, testable Python code.

40.2K 21.9K
View

Modern responsive layouts using container queries, fluid typography, CSS Grid, and mobile-first strategies.

40.2K 20K
View

Generate Playwright tests from scenarios using interactive browser exploration and validation.

39.7K 18.2K
View

Modern React state management with Redux Toolkit, Zustand, Jotai, and React Query for every state category.

40.2K 14.7K
View

GDPR-compliant data handling with consent management, data subject rights, and privacy controls.

40.2K 14.3K
View

Python error handling patterns including input validation, exception hierarchies, and partial failure handling. Use when implementing validation logic, designing exception strategies, handling batch processing failures, or building robust APIs.

40.2K 13.5K
View

Detailed multi-file refactor planning with safety checks and rollback guidance.

39.7K 13K
View