# 获取实时K线

# 接口说明

获取已订阅股票的实时K线数据。

# 接口限制

单次请求K线数不能超过1500根。
1分钟K线最大可查询6天;
3分钟K线最大可查询9天;
5分钟K线最大可查询12天;
10分钟K线最大可查询18天;
15分钟K线最大可查询24天;
30分钟K线最大可查询36天;
60分钟K线最大可查询60天;
120分钟K线最大可查询96天;
240分钟K线最大可查询180天。

# 接口地址

POST http://127.0.0.1:11111/hq/KL

# 参数说明

参数 类型 必填 说明 可能值
Security Security 股票信息
startDate Int yyyyMMdd
direction Security 方向
exRightFlag Int 复权
cycType Int k线类型 参看数据字典
limit Int 分钟K线:表示需查询多少天数据;日K以上:表示需查询多少条数据
  • Post请求示例
{
    "timeout_sec": 10,
    "params": {
        "security": {
            "dataType": "int32 股票类型",
            "code": "string 股票代码(港股、沪深市场股票代码需要带后缀 .HK .SH .SZ)"
        },
        "startDate": "int64 yyyyMMdd",
        "direction": "int32 方向",
        "exRightFlag": "int32 复权",
        "cycType": "int32 k线类型",
        "limit": "int32 天数/数量"
    }
}
  • 响应结果
{
    "ok": true,
    "err": "",
    "data": {
        "security": {
            "dataType": "int32 股票类型",
            "code": "string 股票代码(港股、沪深市场股票代码需要带后缀 .HK .SH .SZ)"
        },
        "kline": [{
            "date": "string 日期 yyyy-MM-dd",
            "highPrice": "double 最高价",
            "openPrice": "double 开盘价",
            "lowPrice": "double 最低价",
            "closePrice": "double 收盘价",
            "lastClosePrice": "double 昨收价",
            "volume": "int64 成交量",
            "turnover": "double 成交额",
            "timestamp": "int64 时间戳",
            "time": "string 时间字符串 HH:mm"
        }]
    }
}