币安API教程文档-行情接口5

币安binance量化交易机器人,完全免费,办公环境运行,适合小白入门。

获取未平仓合约数

响应:

 

{

    "openInterest": "10659.509", // 未平仓合约数量

    "symbol": "BTCUSDT",    // 交易对

    "time": 1589437530011   // 撮合引擎时间

}

 

GET /fapi/v1/openInterest

 

权重: 1

 

更新速率: 3s

 

参数:

 

名称         类型         是否必需         描述

symbol     STRING    YES   交易对

季度合约历史结算价

响应:

 

[

    {

        "deliveryPrice": 27101.10000000,

        "deliveryTime": 1695945600000

    },

    {

        "deliveryPrice": 30729.40000000,

        "deliveryTime": 1688083200000

    },

    {

        "deliveryPrice": 27823.70000000,

        "deliveryTime": 1680220800000

    },

    {

        "deliveryPrice": 44094.70000000,

        "deliveryTime": 1648166400000

    }

]

GET /futures/data/delivery-price

 

参数:

 

名称         类型         是否必需         描述

pair  STRING    YES   如BTCUSDT

合约持仓量

响应:

 

[

    {

         "symbol":"BTCUSDT",

          "sumOpenInterest":"20403.12345678",// 持仓总数量

          "sumOpenInterestValue": "176196512.12345678", // 持仓总价值

          "timestamp":"1583127900000"

 

     },

 

     {

 

         "symbol":"BTCUSDT",

         "sumOpenInterest":"20401.36700000",

         "sumOpenInterestValue":"149940752.14464448",

         "timestamp":"1583128200000"

 

        },  

 

]

 

GET /futures/data/openInterestHist

 

参数:

 

名称         类型         是否必需         描述

symbol     STRING    YES  

period       ENUM      YES   "5m","15m","30m","1h","2h","4h","6h","12h","1d"

limit LONG        NO   default 30, max 500

startTime         LONG        NO  

endTime  LONG        NO  

若无 startime 和 endtime 限制, 则默认返回当前时间往前的limit值

仅支持最近30天的数据

IP限频为1000次/5min

大户账户数多空比

响应:

 

[

    {

         "symbol":"BTCUSDT",

          "longShortRatio":"1.8105",// 大户多空账户数比值

          "longAccount": "0.6442", // 大户多仓账户数比例

          "shortAccount":"0.3558", // 大户空仓账户数比例

          "timestamp":"1583139600000"

 

    },

    {

 

         "symbol":"BTCUSDT",

          "longShortRatio":"1.8233",

          "longAccount": "0.5338",

          "shortAccount":"0.3454",                 

          "timestamp":"1583139900000"

 

    },      

]

GET /futures/data/topLongShortAccountRatio

 

参数:

 

名称         类型         是否必需         描述

symbol     STRING    YES  

period       ENUM      YES   "5m","15m","30m","1h","2h","4h","6h","12h","1d"

limit LONG        NO   default 30, max 500

startTime         LONG        NO  

endTime  LONG        NO  

若无 startime 和 endtime 限制, 则默认返回当前时间往前的limit值

仅支持最近30天的数据

IP限频为1000次/5min

大户持仓量多空比

响应:

 

[

    {

         "symbol":"BTCUSDT",

          "longShortRatio":"1.4342",// 大户多空持仓量比值

          "longAccount": "0.5344", // 大户多仓持仓量比例

          "shortAccount":"0.4656", // 大户空仓持仓量比例

          "timestamp":"1583139600000"

    },

    {

 

         "symbol":"BTCUSDT",

          "longShortRatio":"1.4337",

          "longAccount": "0.5891",

          "shortAccount":"0.4108",                 

          "timestamp":"1583139900000"    

    },      

]

GET /futures/data/topLongShortPositionRatio

 

参数:

 

名称         类型         是否必需         描述

symbol     STRING    YES  

period       ENUM      YES   "5m","15m","30m","1h","2h","4h","6h","12h","1d"

limit LONG        NO   default 30, max 500

startTime         LONG        NO  

endTime  LONG        NO  

若无 startime 和 endtime 限制, 则默认返回当前时间往前的limit值

仅支持最近30天的数据

IP限频为1000次/5min

多空持仓人数比

响应:

 

[

    {

        "symbol":"BTCUSDT",

        "longShortRatio":"0.1960", // 多空人数比值

        "longAccount": "0.6622", // 多仓人数比例

        "shortAccount":"0.3378", // 空仓人数比例

        "timestamp":"1583139600000"

 

    },

    {

 

        "symbol":"BTCUSDT",

        "longShortRatio":"1.9559",

        "longAccount": "0.6617",

        "shortAccount":"0.3382",                   

        "timestamp":"1583139900000"         

    },    

]

GET /futures/data/globalLongShortAccountRatio

 

参数:

 

名称         类型         是否必需         描述

symbol     STRING    YES  

period       ENUM      YES   "5m","15m","30m","1h","2h","4h","6h","12h","1d"

limit LONG        NO   default 30, max 500

startTime         LONG        NO  

endTime  LONG        NO  

若无 startime 和 endtime 限制, 则默认返回当前时间往前的limit值

仅支持最近30天的数据

IP限频为1000次/5min

合约主动买卖量

响应:

 

[

    {

          "buySellRatio":"1.5586",

          "buyVol": "387.3300", // 主动买入量

          "sellVol":"248.5030", // 主动卖出量

          "timestamp":"1585614900000"

    },

    {

          "buySellRatio":"1.3104",

          "buyVol": "343.9290",

          "sellVol":"248.5030",                    

          "timestamp":"1583139900000"              

    },      

]

 

GET /futures/data/takerlongshortRatio

 

参数:

 

名称         类型         是否必需         描述

symbol     STRING    YES  

period       ENUM      YES   "5m","15m","30m","1h","2h","4h","6h","12h","1d"

limit LONG        NO   default 30, max 500

startTime         LONG        NO  

endTime  LONG        NO  

若无 startime 和 endtime 限制, 则默认返回当前时间往前的limit值

仅支持最近30天的数据

IP限频为1000次/5min

基差

响应:

 

[ 

    {

        "indexPrice": "34400.15945055",

        "contractType": "PERPETUAL",

        "basisRate": "0.0004",

        "futuresPrice": "34414.10",

        "annualizedBasisRate": "",

        "basis": "13.94054945",

        "pair": "BTCUSDT",

        "timestamp": 1698742800000

    }

]

GET /futures/data/basis

 

参数:

 

名称         类型         是否必需         描述

pair  STRING    YES   BTCUSDT

contractType   ENUM      YES   CURRENT_QUARTER, NEXT_QUARTER, PERPETUAL

period       ENUM      YES   "5m","15m","30m","1h","2h","4h","6h","12h","1d"

limit LONG        NO   Default 30,Max 500

startTime         LONG        NO  

endTime  LONG        NO  

若无 startime 和 endtime 限制, 则默认返回当前时间往前的limit值

仅支持最近30天的数据

杠杆代币历史净值K线

响应:

 

[

    [

        1598371200000,      // 开盘时间

        "5.88275270",       // 开盘净值

        "6.03142087",       // 最高净值

        "5.85749741",       // 最低净值

        "5.99403551",       // 收盘净值(当前K线未结束的即为最新净值)

        "2.28602984",       // 收盘真实杠杆

        1598374799999,      // 收盘时间

        "0",                // 请忽略

        6209,               // 净值更新笔数

        "14517.64507907",   // 请忽略

        "0",                // 请忽略

        "0"                 // 请忽略

    ]

]

GET /fapi/v1/lvtKlines

 

杠杆代币净值系统基于合约架构,故该接口采用fapi

 

权重: 1

 

参数:

 

名称         类型         是否必需         描述

symbol     STRING    YES   token name, e.g. "BTCDOWN", "BTCUP"

interval    ENUM      YES  

startTime         LONG        NO  

endTime  LONG        NO  

limit INT   NO   默认 500, 最大 1000

如果未发送 startTime 和 endTime ,默认返回最近的交易

综合指数交易对信息

响应:

 

[

    {

        "symbol": "DEFIUSDT",

        "time": 1589437530011,    // 请求时间

        "component": "baseAsset", //成分资产

        "baseAssetList":[

            {

                "baseAsset":"BAL",    // 基础资产

                "quoteAsset": "USDT", // 报价资产

                "weightInQuantity":"1.04406228",  //权重(数量)

                "weightInPercentage":"0.02783900" //权重(比例)

            },

            {

                "baseAsset":"BAND",

                "quoteAsset": "USDT",

                "weightInQuantity":"3.53782729",

                "weightInPercentage":"0.03935200"

            }

        ]

    }

]

 

获取交易对为综合指数的基础成分信息。

 

GET /fapi/v1/indexInfo

 

权重: 带symbol为1;不带symbol为10

 

参数:

 

名称         类型         是否必需         描述

symbol     STRING    NO  

多资产模式资产汇率指数

响应:

 

{

    "symbol": "ADAUSD",

    "time": 1635740268004,

    "index": "1.92957370",

    "bidBuffer": "0.10000000",

    "askBuffer": "0.10000000",

    "bidRate": "1.73661633",

    "askRate": "2.12253107",

    "autoExchangeBidBuffer": "0.05000000",

    "autoExchangeAskBuffer": "0.05000000",

    "autoExchangeBidRate": "1.83309501",

    "autoExchangeAskRate": "2.02605238"

}

或(当不发送交易对信息)

 

[

    {

        "symbol": "ADAUSD",

        "time": 1635740268004,

        "index": "1.92957370",

        "bidBuffer": "0.10000000",

        "askBuffer": "0.10000000",

        "bidRate": "1.73661633",

        "askRate": "2.12253107",

        "autoExchangeBidBuffer": "0.05000000",

        "autoExchangeAskBuffer": "0.05000000",

        "autoExchangeBidRate": "1.83309501",

        "autoExchangeAskRate": "2.02605238"

    }

]

GET /fapi/v1/assetIndex

 

多资产模式资产汇率指数

 

权重: 带symbol为1, 不带为10

 

参数:

 

名称         类型         是否必需         描述

symbol     STRING    NO   资产对

查询指数价格成分

响应:

 

{

    "symbol": "BTCUSDT",

    "time": 1697421272043,

    "constituents": [

        {

            "exchange": "binance",

            "symbol": "BTCUSDT"

        },

        {

            "exchange": "okex",

            "symbol": "BTC-USDT"

        },

        {

            "exchange": "huobi",

            "symbol": "btcusdt"

        },

        {

            "exchange": "coinbase",

            "symbol": "BTC-USDT"

        }

    ]

}

GET /fapi/v1/constituents

 

查询指数价格成分

 

权重: 2

 

参数:

 

名称         类型         是否必需         描述

symbol     STRING    YES   交易对



  admin   2024-4-16