目录
  • 01
  • /RealTimeData

    获取实时数据接口

    此接口为GET请求,返回工具里所有品种合约的相关实时数据

    参数:

    该接口无需参数

    属性

    类型

    必填

    描述

    返回值:

    返回 JSON 格式

    字段

    类型

    描述

    Status

    int

    状态:1-成功 0-失败

    DataCount

    int

    数据总条数

    Data

    List

    数据列表

    ContractCode

    string

    合约代码

    ContractName

    string

    合约名称

    sellprice

    float

    卖出

    gsellprice

    float

    卖出挂单

    buyprice

    float

    买入

    gbuyprice

    float

    买入挂单

    lastprice

    float

    最新

    openprice

    float

    开盘

    highprice

    float

    最高

    lowprice

    float

    最低

    total

    float

    总量/成交量

    position

    float

    持仓量

    closed

    float

    结算价

    average

    float

    均价

    ydclosed

    float

    昨收

    ydknot

    float

    昨结

    dayadd

    float

    日增仓

    pricechange

    float

    涨跌

    presenthand

    float

    现手

    outvol

    float

    外盘

    innervol

    float

    内盘

    Cycle

    string

    K线周期 - m5 表示为5分钟,m60为1小时,m120为2小时,d1为1日,大写的M1为1个月,q1为1季,y1为1年,s5为5秒,以此类推

    precfunds

    longlong

    沉淀资金

    capitalflow

    longlong

    资金流向

    nowadd

    float

    现增仓

    riseprice

    float

    涨幅

    limitup

    float

    涨停

    limitdown

    float

    跌停

    buyprice2

    float

    买入2

    gbuyprice2

    float

    买入挂单2

    buyprice3

    float

    买入3

    gbuyprice3

    float

    买入挂单3

    buyprice4

    float

    买入4

    gbuyprice4

    float

    买入挂单4

    buyprice5

    float

    买入5

    gbuyprice5

    float

    买入挂单5

    sellprice2

    float

    卖出2

    gsellprice2

    float

    卖出挂单2

    sellprice3

    float

    卖出3

    gsellprice3

    float

    卖出挂单3

    sellprice4

    float

    卖出4

    gsellprice4

    float

    卖出挂单4

    sellprice5

    float

    卖出5

    gsellprice5

    float

    卖出挂单5

    exchange

    string

    交易所

    返回样例

                {
                    "Status": 1,
                    "DataCount": 8,
                    "Data": [
                        {
                           "ContractName": "橡胶主连",
                           "ContractCode": "2312",
                           "sellprice": 15320,
                           "gsellprice": 61,
                           "buyprice": 15315,
                           "gbuyprice": 27,
                           "lastprice": 15315,
                           "openprice": 15420,
                           "highprice": 15480,
                           "lowprice": 15265,
                           "total": 216376,
                           "position": 144017,
                           "closed": 15360,
                           "average": 15364.861,
                           "ydclosed": 15415,
                           "ydknot": 15325,
                           "dayadd": 3297,
                           "pricechange": -10,
                           "presenthand": 1,
                           "outvol": 105200,
                           "innervol": 111176,
                           "Cycle": "m1",
                           "precfunds": 4411240960,
                           "capitalflow": -1228675840,
                           "nowadd": 0,
                           "riseprice": -0.065252855,
                           "limitup": 16550,
                           "limitdown": 14095,
                           "buyprice2": 15310,
                           "gbuyprice2": 21,
                           "buyprice3": 15305,
                           "gbuyprice3": 79,
                           "buyprice4": 15300,
                           "gbuyprice4": 36,
                           "buyprice5": 15295,
                           "gbuyprice5": 38,
                           "sellprice2": 15325,
                           "gsellprice2": 68,
                           "sellprice3": 15330,
                           "gsellprice3": 105,
                           "sellprice4": 15335,
                           "gsellprice4": 60,
                           "sellprice5": 15340,
                           "gsellprice5": 39,
                           "exchange": "SHFE"
                        },
                        {
                           "ContractName": "螺纹钢主连",
                           "ContractCode": "6894",
                           "sellprice": 3103,
                           "gsellprice": 40,
                           "buyprice": 3102,
                           "gbuyprice": 525,
                           "lastprice": 3103,
                           "openprice": 3110,
                           "highprice": 3124,
                           "lowprice": 3093,
                           "total": 1039362,
                           "position": 1926153,
                           "closed": 3107,
                           "average": 3107.1892,
                           "ydclosed": 3096,
                           "ydknot": 3087,
                           "dayadd": 18024,
                           "pricechange": 16,
                           "presenthand": 5,
                           "outvol": 499107,
                           "innervol": 540255,
                           "Cycle": "m1",
                           "precfunds": 8367593984,
                           "capitalflow": -3447541760,
                           "nowadd": 0,
                           "riseprice": 0.51830256,
                           "limitup": 3241,
                           "limitdown": 2932,
                           "buyprice2": 3101,
                           "gbuyprice2": 366,
                           "buyprice3": 3100,
                           "gbuyprice3": 199,
                           "buyprice4": 3099,
                           "gbuyprice4": 415,
                           "buyprice5": 3098,
                           "gbuyprice5": 346,
                           "sellprice2": 3104,
                           "gsellprice2": 785,
                           "sellprice3": 3105,
                           "gsellprice3": 3309,
                           "sellprice4": 3106,
                           "gsellprice4": 709,
                           "sellprice5": 3107,
                           "gsellprice5": 844,
                           "exchange": "SHFE"
                        }
                        ......
                    ]
                }
                                    

  • 02
  • /HistoryData

    获取历史数据接口

    此接口为GET请求,返回指定品种下的指定K线周期相关历史数据

    参数:

    /HistoryData?ContractCode=lc2505&Cycle=m60

    属性

    类型

    必填

    描述

    ContractCode

    string

    指定合约代码

    Cycle

    string

    指定K线周期,m5 表示为5分钟,m60为1小时,m120为2小时,d1为1日,大写的M1为1个月,q1为1季,y1为1年,s5为5秒,以此类推

    返回值:

    返回 JSON 格式

    字段

    类型

    描述

    Status

    int

    状态:1-成功 0-失败

    ContractName

    string

    合约名称

    ContractCode

    string

    合约代码

    dataCount

    int

    数据总条数

    Cycle

    string

    K线周期

    Data

    List

    数据列表

    dateTime

    string

    时间

    open

    float

    开盘价

    high

    float

    最高价

    low

    float

    最低价

    close

    float

    收盘价

    vol

    float

    成交量

    positions

    float

    持仓量

    settlement

    float

    结算价

    返回样例

                {
                    "Status": 1,
                    "ContractName": "碳酸锂2505",
                    "ContractCode": "lc2505",
                    "dataCount": 664,
                    "Cycle": "m60",
                    "Data": [
                        {
                            "dateTime": "2025-04-17 14:15:00",
                            "open": 70600,
                            "high": 70680,
                            "low": 70460,
                            "close": 70500,
                            "vol": 5339,
                            "positions": 90216,
                            "settlement": 70558.25
                        },
                        {
                            "dateTime": "2025-04-17 11:15:00",
                            "open": 70360,
                            "high": 70680,
                            "low": 70240,
                            "close": 70600,
                            "vol": 9338,
                            "positions": 92421,
                            "settlement": 70509.921875
                        }
                        ......
                }
                                    

  • 03
  • /DetailedData

    获取逐笔数据接口

    此接口为GET请求,返回指定品种下的逐笔数据

    参数:

    /DetailedData?ContractCode=6894

    属性

    类型

    必填

    描述

    ContractCode

    string

    指定合约代码

    返回值:

    返回 JSON 格式

    字段

    类型

    描述

    Status

    int

    状态:1-成功 0-失败

    ContractName

    string

    合约名称

    ContractCode

    string

    合约代码

    dataCount

    int

    数据总条数

    Data

    List

    数据列表

    dateTime

    string

    时间

    timestamp

    long

    时间戳

    price

    float

    价位

    chand

    float

    现手

    nowadd

    float

    增仓

    oorc

    string

    开平

    bors

    string

    主动买/卖

    返回样例

                {
                     "Status": 1,
                     "ContractName": "螺纹钢主连",
                     "ContractCode": "6894",
                     "dataCount": 20,
                    "Data": [
                        {
                           "dateTime": "2025-10-10 14:59:50",
                           "timestamp": 1760079590,
                           "price": 3103,
                           "chand": 0,
                           "nowadd": 0,
                           "oorc": "---",
                           "bors": "主动买"
                        },
                        {
                           "dateTime": "2025-10-10 14:59:51",
                           "timestamp": 1760079591,
                           "price": 3102,
                           "chand": 55,
                           "nowadd": 0,
                           "oorc": "空换",
                           "bors": "主动卖"
                        }
                        ......
                }