跳转至

全球指数行情

来源同步:/Users/mac/Projects/chatgpt-codex/doc/api_WorldIndices.md

所属接口集:全球指数

请求 URL

GET /v1/api/world/indices

认证方式

Bearer Token(详见 认证与签名

接口概述

查询全球主要指数的实时行情数据,支持按地区和代码过滤。数据从 Redis 缓存读取。

请求参数

参数 类型 必填 说明
region string 地区过滤,默认 apac_cn。可选值:apac_cn(亚太-中国)、apac(亚太)、americas(美洲)、all(全部)
code string 指数代码过滤,需为配置中有效的指数代码

接口说明

  • 指数配置来源于 settings.WORLDIDX_CONF["INDEX_MAP"]
  • 数据从 Redis 缓存读取,键格式为 {prefix}:worldidx:index:{code}
  • 结果按涨幅(pct)降序排列,无涨幅数据排末尾
  • 若提供 code 参数,会校验其是否为配置中的有效代码

响应格式示例

{
  "ts": 1736755200,
  "region": "apac_cn",
  "code": null,
  "items": [
    {
      "code": "000001",
      "symbol": "SH000001",
      "name": "上证指数",
      "price": 3250.68,
      "pct": 0.85,
      "open": 3230.0,
      "high": 3260.0,
      "low": 3225.0,
      "prev_close": 3223.28,
      "ts": 1736755100,
      "source": "redis"
    },
    {
      "code": "399001",
      "symbol": "SZ399001",
      "name": "深证成指",
      "price": 10580.35,
      "pct": 0.62,
      "open": 10520.0,
      "high": 10600.0,
      "low": 10510.0,
      "prev_close": 10515.23,
      "ts": 1736755100,
      "source": "redis"
    }
  ]
}

返回状态

状态码 说明
200 成功
400 参数错误(无效的 region 或 code)
401 未认证
403 无权限