跳到主要内容

基金行情数据

场内基金行情快照

GET /api/fund/market/snapshot

operation_idget_fund_market_snapshot

仅支持 ETF。LOF、场外基金、REITs 或尚未开放的基金叶子类型返回 code=3004

请求参数

参数类型必需默认值说明
thscodestring单只 ETF 的完整 thscode,必须保留市场后缀,如 510300.SH;不接受逗号分隔的多个值。

该接口不接收 fund_type,系统会根据 thscode 识别标的类型。

curl 'https://fuyao.aicubes.cn/api/fund/market/snapshot?thscode=510300.SH' \
-H 'X-api-key: <your-api-key>'

响应示例

{
"code": 0,
"message": "success",
"request_id": "558cdc5105964a93953b1a541e7af901",
"data": {
"timestamp": 1784210584000,
"item": [
{
"thscode": "510300.SH",
"ticker": "510300",
"last_price": 4.753,
"open_price": 4.775,
"high_price": 4.825,
"low_price": 4.724,
"prev_price": 4.838,
"price_change_ratio_pct": -1.756924,
"price_change": -0.085,
"price_amplitude_ratio_pct": 2.08764,
"volume": 1657822800,
"turnover": 7909234100,
"turnover_ratio_pct": 9.012068
}
]
}
}

返回字段

data.timestamp 为本次快照最新的上游有效时间,使用毫秒级 Unix 时间戳;无有效数据时为 null

data.item[] 字段:

字段类型说明
thscodestringETF 的完整 thscode。
tickerstringETF 的纯基金代码,仅用于展示。
last_pricenumber最新价。
open_pricenumber开盘价。
high_pricenumber最高价。
low_pricenumber最低价。
prev_pricenumber昨收价。
price_change_ratio_pctnumber涨跌幅,百分数原值。
price_changenumber涨跌额。
price_amplitude_ratio_pctnumber振幅,百分数原值。
volumenumber成交量。
turnovernumber成交额。
turnover_ratio_pctnumber换手率,百分数原值。

场内基金历史日线行情

GET /api/fund/market/historical

operation_idget_fund_market_historical

仅支持 ETF;单次只允许一个 thscode,查询窗口最长 5 个自然年。

请求参数

参数类型必需默认值说明
thscodestring单只 ETF 的完整 thscode,必须保留市场后缀;不接受逗号分隔的多个值。
intervalstring1dK 线周期,当前仅支持 1d(日线)。
startlong起始时间,毫秒级 Unix 时间戳。
endlong结束时间,毫秒级 Unix 时间戳;必须不早于 start,且窗口最长 5 个自然年。
curl 'https://fuyao.aicubes.cn/api/fund/market/historical?thscode=510300.SH&interval=1d&start=1626451200000&end=1784217600000' \
-H 'X-api-key: <your-api-key>'

响应示例

{
"code": 0,
"message": "success",
"request_id": "f47444ed0e0d4e1c883ecb66511dc311",
"data": {
"timestamp": 1784131200000,
"thscode": "510300.SH",
"interval": "1d",
"adjust": null,
"item": [
{
"date_ms": 1626624000000,
"volume": 332046160,
"turnover": 1709347700,
"open_price": 4.728,
"high_price": 4.769,
"low_price": 4.687,
"close_price": 4.759
},
{
"date_ms": 1626710400000,
"volume": 306679330,
"turnover": 1581145200,
"open_price": 4.721,
"high_price": 4.76,
"low_price": 4.712,
"close_price": 4.746
}
]
}
}

返回字段

data 字段:

字段类型说明
timestamplong数据就绪时间,取序列中最新一根 K 线的有效时间。
thscodestring请求中的 ETF thscode。
intervalstringK 线周期,固定为 1d
adjustnull复权方式,当前固定为 null
itemarray历史日线数据列表。

data.item[] 字段:

字段类型说明
date_mslong交易日期,毫秒级 Unix 时间戳。
open_pricenumber开盘价。
high_pricenumber最高价。
low_pricenumber最低价。
close_pricenumber收盘价。
volumenumber成交量。
turnovernumber成交额。

通用参数与错误码参见基金 API 总览