跳到主要内容

基金通用指标

通用约定
  • Base URLhttps://fuyao.aicubes.cn
  • 必需请求头X-api-key;认证、权限和业务错误通过响应 code 表达。
  • 本页接口返回统一 ApiResponse 信封,包含 codemessagedatarequest_id
  • 对象和数组参数以 URL 编码的 JSON 字符串传递;指标值、动态属性、空值和 idx 关联保持上游语义。
  • 证券与基金均使用含市场后缀的完整 thscode;批量字段使用 thscodes,例如 000001.OF
  • 画线接口的 time_range.starttime_range.end 及响应时间轴使用 Unix 毫秒整数。指标元信息中的正数 timestamp 也是 Unix 毫秒,0 和负数表示位置选择。
  • 响应中的合法 null 数组占位和可空业务字段保持原义。
  • 示例参数已通过真实上游调用验证;返回数据会随上游更新。

基金画线指标

GET /api/fund/indicators/line

MCP Toolget_fund_indicators_line

请求参数

参数类型必需默认值说明
indexesstring指标分组 JSON 数组。每组必须包含完整代码数组 thscodes 和指标数组 index_infoindex_info[] 必须包含字符串 index_id,可按指标定义提供 attribute
time_rangestring时间范围 JSON 对象。time_type 字符串必填;startend 为 Unix 毫秒整数,offset 为整数周期偏移。

请求示例

curl 'https://fuyao.aicubes.cn/api/fund/indicators/line?indexes=%5B%7B%22thscodes%22%3A%5B%22000001.OF%22%5D%2C%22index_info%22%3A%5B%7B%22index_id%22%3A%22rsi_pct%22%7D%5D%7D%5D&time_range=%7B%22time_type%22%3A%22DAY_1%22%2C%22start%22%3A1788192000000%2C%22end%22%3A1788796800000%7D' \
-H 'X-api-key: <your-api-key>'

响应示例

{
"code": 0,
"message": "success",
"request_id": "d7f643cb1f564de7b0922aeab12602e6",
"data": {
"time_range": [
1788192000000,
1788278400000,
1788364800000,
1788451200000,
1788710400000,
1788796800000
],
"indexes": [
{
"index_id": "rsi_pct",
"value_type": null,
"timestamp": null,
"time_type": null,
"attribute": null
}
],
"data": [
{
"thscode": "000001.OF",
"values": [
{
"idx": 0,
"values": [
43.29,
39.94,
27.61,
23.6,
43.48,
40.7
]
}
]
}
]
}
}

返回字段

data 字段:

字段类型说明
time_rangeinteger arrayUnix 毫秒时间轴,与每组 values 按位置对应;数组元素可为 null
indexesarray指标元信息。
dataarray按代码组织的指标序列。

data.indexes[] 字段:

字段类型说明
index_idstring指标编码。
value_typestring | null指标值类型。
timestampinteger | null正数为 Unix 毫秒时间戳;0 和负数表示位置选择。
time_typestring | null指标时间类型。
attributeJSON | null动态指标属性。

data.data[] 及其 values[] 字段:

字段类型说明
thscodestring含市场后缀的完整同花顺代码。
values[].idxinteger对应 data.indexes[] 的指标下标。
values[].valuesJSON arraydata.time_range 对应的指标值序列。

基金表格指标

GET /api/fund/indicators/table

MCP Toolget_fund_indicators_table

请求参数

参数类型必需默认值说明
code_selectorsstring代码选择器 JSON 对象。stock_codefund_code 类型必须使用完整代码数组 thscodes;其它实体类型使用 values
indexesstring指标 JSON 数组。index_id 字符串必填;timestamp 可选,正数为 Unix 毫秒,0 为最新位置,负数为位置偏移;attribute 按指标定义。
page_infostring分页 JSON 对象。page_beginpage_sizecode_begincode_page_size 均为可选整数,起点为 0
sortstring排序 JSON 数组。每项的 idx 为指标下标整数,type 为排序方向字符串。

传入时,code_selectorspage_info 必须是 JSON 对象,indexessort 必须是 JSON 数组;省略任一参数时不会注入业务默认值。

请求示例

curl 'https://fuyao.aicubes.cn/api/fund/indicators/table?code_selectors=%7B%22include%22%3A%5B%7B%22type%22%3A%22fund_code%22%2C%22thscodes%22%3A%5B%22000001.OF%22%5D%7D%5D%7D&indexes=%5B%7B%22index_id%22%3A%22maxDrawDownWeek%22%7D%2C%7B%22index_id%22%3A%22maxDrawDownNow%22%7D%5D' \
-H 'X-api-key: <your-api-key>'

响应示例

{
"code": 0,
"message": "success",
"request_id": "9e12297c034b4362ad5a0383dc5fc1c0",
"data": {
"total": 1,
"indexes": [
{
"index_id": "maxDrawDownWeek",
"value_type": null,
"timestamp": null,
"time_type": null,
"attribute": null
},
{
"index_id": "maxDrawDownNow",
"value_type": null,
"timestamp": null,
"time_type": null,
"attribute": null
}
],
"data": [
{
"thscode": "000001.OF",
"values": [
{
"idx": 0,
"value": "3.127400"
},
{
"idx": 1,
"value": "59.088000"
}
]
}
],
"part_order_thscodes": null
}
}

返回字段

data 字段:

字段类型说明
totalinteger上游结果总数。
indexesarray指标元信息,字段语义与画线接口一致。
dataarray按代码组织的指标值。
part_order_thscodesstring array | null部分排序结果的完整同花顺代码列表;元素可为 null

data.data[] 及其 values[] 字段:

字段类型说明
thscodestring含市场后缀的完整同花顺代码。
values[].idxinteger对应 data.indexes[] 的指标下标。
values[].valueJSON | null单个表格指标值;数值字符串保持原样。