Navbar
简体中文

更新日志

重要文档通知

Binance 推出了全新的 API 文档门户。现有的 GitHub API 文档 已废弃(2024-06-17),并将在用户迁移完成后的几个月内下线;具体日期将在适当时候确定并通知。

在此过渡阶段,两者网站将同时维持。然而,任何新服务将只会在新的门户上发布。

下面是当前和新 API 文档的链接的参考表:

功能 当前文档 新文档
现货交易 当前文档 新文档
现货Websocket API 当前文档 新文档
杠杆交易 当前文档 新文档
U本位合约 当前文档 新文档
币本位合约 当前文档 新文档
欧式期权 当前文档 新文档
统一账户 当前文档 新文档
钱包 当前文档 新文档
子母账户 当前文档 新文档
赚币 当前文档 新文档
双币投资 当前文档 新文档
定投 当前文档 新文档
ETH质押 当前文档 新文档
矿池接口 当前文档 新文档
策略交易 当前文档 新文档
跟单交易 当前文档 新文档
统一账户专业版 当前文档 新文档
法币 当前文档 新文档
C2C 当前文档 新文档
VIP借币 当前文档 新文档
质押借币 当前文档 新文档
Pay 当前文档 新文档
闪兑 当前文档 新文档
返佣 当前文档 新文档
NFT 当前文档 新文档
礼品卡 当前文档 新文档

2024-10-18

Rest 和 WebSocket API:


2024-10-17

Exchange Information 的更改 (即 REST API 的 GET /api/v3/exchangeInfo 和 WebSocket API 的 exchangeInfo)。


2024-09-02


2024-08-16

注意: 以下的变更正在逐步推出,可能需要大约一周的时间才能完成。

常规更改: * 在市场流动性低的情况下,当提交包含 quoteOrderQty 的市价单(又名反向市价单)被拒绝时,添加了新的错误消息。


2024-07-22

SPOT API


2024-06-11


2024-06-06

此功能将在 6月6日 11:59 UTC 前上线。

SPOT API


2024-06-04


2024-05-30

WebSocket Streams


2024-05-22


2024-04-18


2024-04-10

以下更新的生效时间已被推迟到 4月25日 05:00 UTC

SBE


2024-04-08


2024-04-02

注意: 以下的变更将逐步推出,并预计需要大约一周的时间完成。

User Data Stream

以下内容将于发布日期 大约 一周后生效:

SBE


2024-02-28

将于 2024 年 3 月 5 日生效。

简单二进制编码 (SBE) 将部署到现货的 Rest API 和 WebSocket API 生产系统上。

更多关于SBE的信息, 请参考常见问题解答 (FAQ)


2024-02-27


2024-02-23


2024-02-08

现货的 WebSocket API 现在在测试网上支持简单二进制编码(SBE)。

SBE 模式已经更新了 WebSocket API 元数据,但并没有增加 schemaId 或者 version

SBE 的 FAQ 已经更新。


2024-01-24


2024-01-19


2024-01-15


2024-01-09


2023-12-22


2023-12-08

简单二进制编码 (SBE) 已经在现货测试网上线。 生产系统会在随后支持。 更多关于SBE的信息, 请参考常见问题解答 (FAQ)


2023-12-04

注意: 以下的变更将逐步推出,并预计需要大约一周的时间完成。

REST API

WebSocket Streams

User Data Streams

以下将在发布日期后大约一周后生效:


2023-11-21


2023-11-17


2023-11-02


2023-10-19

从 2023-10-19 00:00 UTC 开始生效

调高如下接口的请求权重:

SPOT API 条件 之前的权重 调整后权重
GET /api/v3/trades N/A 2 10
GET /api/v3/depth Limit 1-100 2 5
Limit 101-500 10 25
Limit 501-1000 20 50
Limit 1001-5000 100 250

2023-10-16


2023-10-11


2023-10-03


2023-09-25


2023-09-22


2023-09-18


2023-09-14


2023-09-04


2023-08-31


2023-08-26


2023-08-25

下面的变更会在UTC时间 2023-08-25 00:00 上线

请求接口 之前请求权重 新请求权重
GET /api/v3/order 2 4
GET /api/v3/orderList 2 4
GET /api/v3/openOrders - symbol 3 6
GET /api/v3/openOrders- 不带 symbol 40 80
GET /api/v3/openOrderList 3 6
GET /api/v3/allOrders 10 20
GET /api/v3/allOrderList 10 20
GET /api/v3/myTrades 10 20
GET /api/v3/myAllocations 10 20
GET /api/v3/myPreventedMatches - 使用 preventedMatchId 1 2
GET /api/v3/myPreventedMatches - 使用 orderId 10 20
GET /api/v3/account 10 20
GET /api/v3/rateLimit/order 20 40
GET /api/v3/exchangeInfo 10 20
GET /api/v3/depth - Limit 1-100 1 2
GET /api/v3/depth - Limit 101-500 5 10
GET /api/v3/depth - Limit 501-1000 10 20
GET /api/v3/depth - Limit 1001-5000 50 100
GET /api/v3/aggTrades 1 2
GET /api/v3/trades 1 2
GET /api/v3/historicalTrades 5 10
GET /api/v3/klines 1 2
GET /api/v3/uiKlines 1 2
GET /api/v3/ticker/bookTicker - symbol 1 2
GET /api/v3/ticker/bookTicker - 不带 symbol 或者 symbols 2 4
GET /api/v3/ticker/price- symbol 1 2
GET /api/v3/ticker/price- 不带 symbol 或者 symbols 2 4
GET /api/v3/ticker/24hr - symbol or symbols 1-20 交易对 1 2
GET /api/v3/ticker/24hr - symbols 21-100 交易对 20 40
GET /api/v3/ticker/24hr - 不带 symbol 或者 symbols 包括101个或者更多交易对 40 80
GET /api/v3/avgPrice 1 2
GET /api/v3/ticker 2 4
GET /api/v3/ticker - 请求的最大权重 100 200
POST /api/v3/userDataStream 1 2
PUT /api/v3/userDataStream 1 2
DELETE /api/v3/userDataStream 1 2

2023-08-18


2023-08-08

智能订单路由(Smart Order Routing:SOR)添加到 API 中。您可以在SOR 常见问题文档中找到更多详细信息。 具体上线时间请关注相关公告。

REST API

USER DATA STREAM


2023-08-02


2023-07-20


2023-07-18


2023-07-14


2023-07-11

注意: 所有更改都将逐步推出,可能需要一周时间才能完成。


2023-07-07


2023-06-29


2023-06-22


2023-06-20


2023-06-09


2023-06-06


2023-06-01


2023-05-30


2023-05-26

注意: 所有更改都将逐步推出到我们的所有服务器,并可能需要一周时间才能完成。


2023-05-24


2023-05-18


2023-05-09


2023-04-20


2023-04-18


2023-03-23


2023-03-13

注意: 所有更改都将逐步推出到我们的所有服务器,并可能需要一周时间才能完成。

情况 之前的错误消息 新错误消息
由于交易权限被禁用,账户无法下订单或取消订单。 This action is disabled on this account. This account may not place or cancel orders.
当配置在交易对上的权限与账户上的权限不匹配时。 This symbol is not permitted for this account.
当账户在其没有权限的交易对上下订单时。 This symbol is restricted for this account.
symbol 不在 TRADING 时下订单。 Unsupported order combination. This order type is not possible in this trading phase.
在不支持 IOCFOK 的交易阶段上使用 timeinForce = IOCFOK 下订单时。 Limit orders require GTC for this phase.

虽然以下更改将在发布日期后 大约一周内生效,但是与其相关的文档已经被更改了:

现货 API


2023-02-27


2023-02-21


2023-02-17

WebSocket频率限制变动

Websocket Stream 现在限制每个IP地址、每5分钟可以发送连接请求的上限是300次。


2023-02-13


2023-02-02


2023-01-26

根据此公告,Self-Trade Prevention 将在 2023-01-26 08:00 UTC 发布。


2023-01-23


2023-01-23

实际发布日期待定

新功能:Self-Trade Prevention(STP)会添加到系统中。此功能将阻止订单与来自同一账户或者同一 tradeGroupId 账户的订单交易。

请使用现货 REST API 的 GET /api/v3/exchangeInfo 或 Websocket API 的 exchangeInfo 看 STP 的状态。

现货 API

"defaultSelfTradePreventionMode": "NONE",   // selfTradePreventionMode 的默认值
"allowedSelfTradePreventionModes": [        // selfTradePrevention 的可用模式
    "NONE",
    "EXPIRE_TAKER",
    "EXPIRE_BOTH",
    "EXPIRE_MAKER"
]

Websocket 账户信息推送


2023-01-13


2023-01-05


2022-12-26


2022-12-15


2022-12-13

REST API

错误代码 -1003 的一些错误消息改动:

Too much request weight used; current limit is %s request weight per %s %s. Please use the websocket for live updates to avoid polling the API.

改成了:

Too much request weight used; current limit is %s request weight per %s. Please use WebSocket Streams for live updates to avoid polling the API.

Way too much request weight used; IP banned until %s. Please use the websocket for live updates to avoid bans.

改成了:

Way too much request weight used; IP banned until %s Please use WebSocket Streams for live updates to avoid bans.


2022-12-05

备注: 这些更新正在逐步部署到我们所有的服务器,大约需要一周时间才能完成。

WEBSOCKET

REST API

备注: 这些新字段将在发布日期后大约一周出现。

USER DATA STREAM


2022-12-02


2022-11-29


2022-11-22


2022-11-18


2022-11-14


2022-11-02


2022-11-01


2022-10-28


2022-10-15


2022-09-30


2022-09-30

!bookTicker的WebSocket推送的变更.


2022-09-29


2022-09-22


2022-09-16


2022-09-15


2022-09-15

这些变动会是滚动发布,可能需要几天才会部署到所有服务器.


2022-09-12


2022-09-05


2022-08-23

这些变动会是滚动发布,可能需要几天才会部署到所有服务器.


2022-08-18


2022-08-08

REST API

USER DATA STREAM


2022-08-05


2022-07-21


2022-07-18


2022-07-01


2022-06-20

接口 GET /api/v3/ticker 变动

    {
     "code": -1101,
     "msg": "Too many values sent for parameter 'symbols', maximum allowed up to 100." 
    }

2022-06-15

注意: 此变动不会立刻可用, 会在后面几天上线。

SPOT API

WEBSOCKETS

2022-06-02


2022-05-27


2022-05-26


2022-05-23

2022-05-19


2022-05-17

{
"code": -1102,
"msg": "Mandatory parameter 'symbol' was not sent, was empty/null, or malformed." 
}
接口 Symbols的数量 权重
GET /api/v3/ticker/price Any 2
GET /api/v3/ticker/bookTicker Any 2
GET /api/v3/ticker/24hr 1-20 1
GET /api/v3/ticker/24hr 21-100 20
GET /api/v3/ticker/24hr >= 101 40

2022-05-05


2022-04-28


2022-04-27

FAQ: 时间加权平均价格策略(Twap) 介绍


2022-04-26


2022-04-20

FAQ: 币安合约统一账户总览

目前仅对特定用户开放此功能,详情:加入统一账户计划


2022-04-19


2022-04-13

FAQ: 成交量份额参与算法(VP) 介绍


2022-04-13

支持追踪止损订单

REST API

USER DATA STREAM


2022-04-12

Note: 下面的变更会在后面几天上线.


2022-3-29

以下更新于3月 31, 2022 08:00 AM UTC生效

接口查询时间窗口缩短为30天;若startTimeendTime没传,则默认返回最近30天数据。


2022-03-25


2022-03-08


2022-02-28


2022-02-22**

现货API

Limit Request Weight
1-100 1
101-500 5
501-1000 10
1001-5000 50

2022-2-18


font size=4>2022-2-17

以下更新于2月 24, 2022 08:00 AM UTC生效

接口查询范围缩短为仅支持查询最近一个月数据,即startTime不支持选定最近1个月之外的时间。


2022-2-09


2022-1-25


2022-1-21


2022-1-4


2021-12-30


2021-12-29


2021-12-24


2021-12-03


2021-11-30


2021-11-19


2021-11-18

以下更新于11月 25, 2021 08:00 AM UTC生效

接口查询范围缩短为仅支持查询最近半年内的数据,即startTime不支持选定最近6个月之外的时间。若您没有传入startTime和endTime,则默认返回最近7天的数据


2021-11-17


2021-11-16


2021-11-09


2021-11-08


2021-11-05


2021-11-04

以下更新于11月 11, 2021 08:00 AM UTC生效

接口查询范围缩短为仅支持查询最近半年内的数据,即startTime不支持选定最近6个月之外的时间。若您没有传入startTime和endTime,则默认返回最近7天的数据


2021-11-01


2021-10-22


2021-10-14


2021-09-18


2021-09-17


2021-09-08


2021-09-03


2021-08-27


2021-08-23

用法与现货账户 OCO 相同


2021-08-20


2021-08-12


2021-08-05


2021-08-05

以上接口查询范围更改为:仅支持startTimeendTime查询最大间隔为30天,若startTimeendTime均未发送,则默认返回最近30天记录


2021-07-29


2021-07-27


2021-07-16


2021-07-09


2021-06-24


2021-06-17


2021-06-15


2021-06-04

八月 01, 2021 02:00 AM UTC 开始,以下WAPI接口将停止使用:

目前WAPI已从API文档中移除,为了保证您的所有交易策略顺利执行,强烈建议所有API用户尽快更新交易程序,替换成现有的SAPI接口


2021-05-26


2021-05-12


2021-04-28

May 15, 2021 08:00 UTC 开始, 以下创建逐仓杠杆账户接口将关闭:

后续,用户可通过逐仓杠杆账户划转 POST /sapi/v1/margin/isolated/transfer 直接完成逐仓杠杆账户的创建与交易准备,无需调用接口创建账户


2021-04-26

April 28, 2021 00:00 UTC 开始,下面接口的权重有如下变动:


2021-04-08


2021-04-02


2021-04-01


2021-03-31


2021-03-08


2021-03-05


2021-02-08


2021-02-04


2021-01-15


2021-01-10


2021-01-01

USER DATA STREAM


2020-12-30


2020-12-22


2020-12-11


2020-12-02


2020-12-01


2020-11-27

为了优化性能,除了当前的api.binance.com,新加了一些API的集群。如果访问api.binance.com有性能问题,也可以尝试访问:


2020-11-16


2020-11-13


2020-11-10


2020-11-09


2020-11-03


2020-10-14


2020-10-10


2020-09-30


2020-09-28


2020-09-23


2020-09-09

用户数据 STREAM


2020-09-03


2020-09-01


2020-08-27


2020-08-26


2020-07-28

逐仓杠杆相关接口


2020-07-20


2020-07-17


2020-07-13


2020-06-28


2020-05-06


2020-05-01


2020-04-25

现货 API

用户数据 STREAM


2020-04-23

WEB SOCKET 连接限制


2020-04-16


2020-04-02


2020-03-24


2020-03-13


2020-02-05


2020-01-15


2019-12-25

2019-12-18


2019-11-30


2019-11-28


2019-11-22


2019-11-19


2019-11-13

Rest API

    {
      "code": -1128,
      "msg": "Combination of optional parameters invalid. Recommendation: 'stopLimitTimeInForce' should also be sent."
    }

v1 接口将被弃用:

2020年一季度末,以下接口将被移除。目前文档已经将这些接口更新为v3版本。

以下接口将不会移植到v3版本,请使用新接口予以替换

旧的 V1 接口 新的 V3 接口
GET api/v1/ticker/allPrices GET api/v3/ticker/price
GET api/v1/ticker/allBookTickers GET api/v3/ticker/bookTicker

USER DATA STREAM

WEB SOCKET STREAM


2019-11-08


2019-11-04


2019-10-29


2019-10-14


2019-10-11


2019-09-09


2019-09-03


2019-08-16


2019-09-15

Rest API

用户数据流

新的错误码

新的-2011错误内容


2019-03-12

Rest API

Websocket 流

系统改进


2018-11-13

Rest API

平均价格的计算规则解释:

  1. [过去5分钟所有订单的数量*价格求和] / 过去5分钟所有订单的数量

  2. 如果最近5分钟内没有交易,则以5分钟窗口外发生的第一笔交易为准。     例如,如果最后一次交易是在20分钟前,则该交易的价格为5分钟的平均值。

  3. 如果代码上没有交易,则没有平均价格,因此无法下达市价单。对于在MIN_NOTIONAL过滤器上启用了applyToMarket的新交易对,除非有至少一笔交易,才能下达市价单。

  4. 当前的平均价格可以在这里查看:https://api.binance.com/api/v3/avgPrice?symbol=<symbol> 例如: https://api.binance.com/api/v3/avgPrice?symbol=BNBUSDT

用户数据流


2018-07-18

Rest API

用户数据流


2018-01-23


2018-01-20


2018-01-14

介绍

API Key 设置

API Key 权限设置

账户

现货账户

新注册的币安账号都会有一个现货(SPOT)账号。

杠杆账户

为了开设杠杆(MARGIN)账户, 可以参考Binance杠杆交易账户设置指南

现货测试网

用户可以使用现货的测试网来体验SPOT交易. 现在只能通过API来交易。

更多信息请参考现货测试网

API 代码库

Connectors

以下有一些轻量级的代码库,使不同语言的用户能够直接调用现货的 Binance 公共 API:

Postman Collections

Postman 集合现已推出。推荐给寻求快速和轻松地开始使用 API 的新用户。

https://github.com/binance/binance-api-postman

Swagger

以下有提供包含 RESTful API 的 OpenAPI 规范的 YAML 文件,以及可供参考的 Swagger UI 页面。

https://github.com/binance/binance-api-swagger

联系我们

基本信息

API 基本信息

HTTP 返回代码

接口错误代码

API 与 SAPI 的错误代码返回形式如下:

{
  "code": -1121,
  "msg": "Invalid symbol."
}

接口的基本信息


访问限制

访问限制基本信息

IP 访问限制

未成交订单计数

WEB SOCKET 连接限制

/api/ 与 /sapi/ 接口限频说明

/api/*接口和 /sapi/*接口采用两套不同的访问限频规则, 两者互相独立。


数据来源

系统一共有3个数据来源,按照更新速度的先后排序。排在前面的数据最新,在后面就有可能存在延迟。


接口鉴权类型

鉴权类型 描述
NONE 不需要鉴权的接口
TRADE 需要有效的 API-Key 和签名
MARGIN 需要有效的 API-Key 和签名
USER_DATA 需要有效的 API-Key 和签名
USER_STREAM 需要有效的 API-Key
MARKET_DATA 需要有效的 API-Key

SIGNED (TRADE、USER_DATA AND MARGIN) Endpoint security

时间同步安全

逻辑伪代码如下:

  if (timestamp < (serverTime + 1000) && (serverTime - timestamp) <= recvWindow)
  {
    // process request
  } 
  else 
  {
    // reject request
  }

关于交易时效性 互联网状况并不完全稳定可靠,因此你的程序本地到币安服务器的时延会有抖动。这是我们设置recvWindow的目的所在,如果你从事高频交易,对交易时效性有较高的要求,可以灵活设置recvWindow以达到你的要求。

POST /api/v3/order 的示例 - HMAC Keys

以下是在 linux bash 环境下使用 echo openssl 和 curl 工具实现的一个调用接口下单的示例 apikey、secret仅供示范

Key Value
apiKey vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A
secretKey NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j
参数 取值
symbol LTCBTC
side BUY
type LIMIT
timeInForce GTC
quantity 1
price 0.1
recvWindow 5000
timestamp 1499827319559

示例 1: 所有参数通过 request body 发送

示例 1

HMAC SHA256 signature:

    $ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j"
    (stdin)= c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71

curl command:

    (HMAC SHA256)
    $ curl -H "X-MBX-APIKEY: vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" -X POST 'https://api.binance.com/api/v3/order' -d 'symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559&signature=c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71'

symbol=LTCBTC
&side=BUY
&type=LIMIT
&timeInForce=GTC
&quantity=1
&price=0.1
&recvWindow=5000
&timestamp=1499827319559

示例 2: 所有参数通过 query string 发送

示例 2

HMAC SHA256 signature:

    $ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j"
    (stdin)= c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71

curl command:

    (HMAC SHA256)
   $ curl -H "X-MBX-APIKEY: vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" -X POST 'https://api.binance.com/api/v3/order?symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559&signature=c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71'

symbol=LTCBTC
&side=BUY
&type=LIMIT
&timeInForce=GTC
&quantity=1
&price=0.1
&recvWindow=5000
&timestamp=1499827319559

示例 3: 混合使用 query string 和 request body

示例 3

HMAC SHA256 signature:

   $ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTCquantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j"
    (stdin)= 0fd168b8ddb4876a0358a8d14d0c9f3da0e9b20c5d52b2a00fcf7d1c602f9a77

curl command:

    (HMAC SHA256)
    $ curl -H "X-MBX-APIKEY: vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" -X POST 'https://api.binance.com/api/v3/order?symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC' -d 'quantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559&signature=0fd168b8ddb4876a0358a8d14d0c9f3da0e9b20c5d52b2a00fcf7d1c602f9a77'

symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC

quantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559

请注意,签名与示例3不同。 "GTC"和"quantity = 1"之间没有&。

POST /api/v3/order 的示例 - RSA Keys

对于这个例子,Private Key 将被引用为test-prv-key.pem

Key Value
apiKey CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ
参数 取值
symbol BTCUSDT
side SELL
type LIMIT
timeInForce GTC
quantity 1
price 0.2
recvWindow 5000
timestamp 1668481559918

有列出参数的签名 payload:

symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2&timestamp=1668481559918&recvWindow=5000

第1步: Payload

将参数列表排列成一个 string。 用 & 分隔每个参数。对于上述参数,签名 payload 如右所示。

第2步: 计算签名

2.1 - 将签名有效负载编码为 ASCII 数据。

第2.2步

 $ echo -n 'symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2&timestamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem

2.2 - 使用带有 SHA-256 hash 函数的 RSASSA-PKCS1-v1_5 算法对 payload 进行签名。

第2.3步

$ echo -n 'symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2&timestamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A
HZ8HOjiJ1s/igS9JA+n7+7Ti/ihtkRF5BIWcPIEluJP6tlbFM/Bf44LfZka/iemtahZAZzcO9TnI5uaXh3++lrqtNonCwp6/245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH+XxaCmR0WcvlKjNQnp12/eKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang/1WOq+Jaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT/fNnMRxFc7u+j3qI//5yuGuu14KR0MuQKKCSpViieD+fIti46sxPTsjSemoUKp0oXA==

2.3 - 将输出编码为 base64 string。

第2.4步

HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D

2.4 - 由于签名可能包含 /=,这可能会导致发送请求时出现问题。 所以签名必须是 URL 编码的。

第2.5步

 curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://api.binance.com/api/v3/order?symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2&timestamp=1668481559918&recvWindow=5000&signature=HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D'

2.5 - curl 命令

Bash 脚本

#!/usr/bin/env bash

# 设置身份验证:
API_KEY="替换成您的 API Key"
PRIVATE_KEY_PATH="test-prv-key.pem"

# 设置您的请求:
API_METHOD="POST"
API_CALL="api/v3/order"
API_PARAMS="symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2"

# 计算签名:
timestamp=$(date +%s000)
api_params_with_timestamp="$API_PARAMS&timestamp=$timestamp"
signature=$(echo -n "$api_params_with_timestamp" \
            | openssl dgst -sha256 -sign "$PRIVATE_KEY_PATH" \
            | openssl enc -base64 -A)

# 发送请求:
curl -H "X-MBX-APIKEY: $API_KEY" -X "$API_METHOD" \
    "https://api.binance.com/$API_CALL?$api_params_with_timestamp" \
    --data-urlencode "signature=$signature"

右边有示例 Bash 脚本执行上述类似的步骤.

POST /api/v3/order 的示例 - Ed25519 Keys

参数 取值
symbol BTCUSDT
side SELL
type LIMIT
timeInForce GTC
quantity 1
price 0.2
timestamp 1668481559918

Python 脚本

#!/usr/bin/env python3
import base64
import requests
import time
from cryptography.hazmat.primitives.serialization import load_pem_private_key
# 设置身份验证:
API_KEY='替换成您的 API Key'
PRIVATE_KEY_PATH='test-prv-key.pem'
# 加载 private key。
# 在这个例子中,private key 没有加密,但我们建议使用强密码以提高安全性。
with open(PRIVATE_KEY_PATH, 'rb') as f:
    private_key = load_pem_private_key(data=f.read(), password=None)
# 设置请求参数:
params = {
    'symbol':       'BTCUSDT',
    'side':         'SELL',
    'type':         'LIMIT',
    'timeInForce':  'GTC',
    'quantity':     '1.0000000',
    'price':        '0.20',
}
# 参数中加时间戳:
timestamp = int(time.time() * 1000) # 以毫秒为单位的 UNIX 时间戳
params['timestamp'] = timestamp
# 参数中加签名:
payload = '&'.join([f'{param}={value}' for param, value in params.items()])
signature = base64.b64encode(private_key.sign(payload.encode('ASCII')))
params['signature'] = signature
# 发送请求:
headers = {
    'X-MBX-APIKEY': API_KEY,
}
response = requests.post(
    'https://api.binance.com/api/v3/order',
    headers=headers,
    data=params,
)
print(response.json())

右边有 Python 脚本来示例如何使用 Ed25519 key 签名。


公开 API 参数

术语

这里的术语适用于全部文档,建议特别是新手熟读,也便于理解。

枚举定义

交易对状态 (状态 status):

交易对类型:

订单状态 (状态 status):

状态 描述
NEW 订单被交易引擎接
PARTIALLY_FILLED 部分订单被成交
FILLED 订单完全成交
CANCELED 用户撤销了订单
PENDING_CANCEL 撤销中(目前并未使用)
REJECTED 订单没有被交易引擎接受,也没被处理
EXPIRED 订单被交易引擎取消,比如:

LIMIT FOK 订单没有成交

市价单没有完全成交

强平期间被取消的订单

交易所维护期间被取消的订单
EXPIRED_IN_MATCH 表示订单由于 STP 触发而过期 (e.g. 带有 EXPIRE_TAKER 的订单与订单簿上属于同账户或同 tradeGroupId 的订单撮合)

订单列表状态 (状态类型集 listStatusType):

状态 描述
RESPONSE 当ListStatus响应失败的操作时使用。 (订单列表完成或取消订单列表)
EXEC_STARTED 当订单列表已经下单或者订单列表有更新时。
ALL_DONE 当订单列表执行结束或者不在激活状态。。

订单列表的订单状态 (订单状态集 listOrderStatus):

状态 描述
EXECUTING 当已经下单或者订单有更新时
ALL_DONE 当订单执行结束或者不在激活状态
REJECT 当订单状态响应失败(订单完成或取消订单)

指定订单的类型

分配类型 (allocationtype, type):

工作平台:

订单类型 (orderTypes, type):

订单返回类型 (newOrderRespType):

订单方向 (方向 side):

有效方式 (timeInForce):

这里定义了订单多久能够失效

状态 描述
GTC 成交为止

订单会一直有效,直到被成交或者取消。
IOC 无法立即成交的部分就撤销

订单在失效前会尽量多的成交。
FOK 无法全部立即成交就撤销

如果无法全部成交,订单会失效。

K线间隔:

s -> 秒; m -> 分钟; h -> 小时; d -> 天; w -> 周; M -> 月

限制种类 (rateLimitType):

REQUEST_WEIGHT

    {
      "rateLimitType": "REQUEST_WEIGHT",
      "interval": "MINUTE",
      "intervalNum": 1,
      "limit": 6000
    }

ORDERS

    {
      "rateLimitType": "ORDERS",
      "interval": "SECOND",
      "intervalNum": 10,
      "limit": 100
    },
    {
      "rateLimitType": "ORDERS",
      "interval": "DAY",
      "intervalNum": 1,
      "limit": 200000
    }

RAW_REQUESTS

    {
      "rateLimitType": "RAW_REQUESTS",
      "interval": "MINUTE",
      "intervalNum": 5,
      "limit": 5000
    }

限制间隔 (interval)

STP 模式:


过滤器

过滤器,即Filter,定义了一系列交易规则。 共有两类,分别是针对交易对的过滤器symbol filters,和针对整个交易所的过滤器 exchange filters

交易对过滤器

PRICE_FILTER 价格过滤器

/exchangeInfo 响应中的格式:

  {
    "filterType": "PRICE_FILTER",
    "minPrice": "0.00000100",
    "maxPrice": "100000.00000000",
    "tickSize": "0.00000100"
  }

价格过滤器 用于检测订单中 price 参数的合法性。包含以下三个部分:

以上每一项均可为0,为0时代表这一项不再做限制。

逻辑伪代码如下:

PERCENT_PRICE 价格振幅过滤器

/exchangeInfo 响应中的格式:

  {
    "filterType": "PERCENT_PRICE",
    "multiplierUp": "5",
    "multiplierDown": "0.2",
    "avgPriceMins": 5
  }

PERCENT_PRICE过滤器基于先前交易的平均值来定义价格的有效范围。
avgPriceMins是计算平均价格的分钟数。 0表示使用最后的价格。

为了通过"价格百分比","价格"必须符合以下条件:

PERCENT_PRICE_BY_SIDE 基于买卖方向的价格振幅过滤器

ExchangeInfo format:

    {
          "filterType": "PERCENT_PRICE_BY_SIDE",
          "bidMultiplierUp": "1.2",
          "bidMultiplierDown": "0.2",
          "askMultiplierUp": "5",
          "askMultiplierDown": "0.8",
          "avgPriceMins": 1
    }

PERCENT_PRICE_BY_SIDE 过滤器定义了基于交易对平均价格的合法价格范围. 取决于BUY或者SELL, 价格范围可能有所不同.

avgPriceMins 是用来计算平均价格的分钟数. 0 表示用最新价(last price).

买向订单需要满足:

卖向订单需要满足:

LOT_SIZE 订单尺寸

/exchangeInfo 响应中的格式:

  {
    "filterType": "LOT_SIZE",
    "minQty": "0.00100000",
    "maxQty": "100000.00000000",
    "stepSize": "0.00100000"
  }

Lots是拍卖术语,LOT_SIZE 过滤器对订单中的 quantity 也就是数量参数进行合法性检查。包含三个部分:

逻辑伪代码如下:

MIN_NOTIONAL 最小名义价值(成交额)

/exchangeInfo 响应中的格式:

  {
    "filterType": "MIN_NOTIONAL",
    "minNotional": "0.00100000",
    "applyToMarket": true,
    "avgPriceMins": 5
  }

MIN_NOTIONAL过滤器定义了交易对订单所允许的最小名义价值(成交额)。 订单的名义价值是价格*数量。 如果是高级订单(比如止盈止损订单STOP_LOSS_LIMIT),名义价值会按照stopPrice * quantity来计算。 如果是冰山订单,名义价值会按照price * icebergQty来计算。 applyToMarket确定 MIN_NOTIONAL过滤器是否也将应用于MARKET订单。
由于MARKET订单没有价格,因此会在最后avgPriceMins分钟内使用平均价格。
avgPriceMins是计算平均价格的分钟数。 0表示使用最后的价格。

NOTIONAL 名义价值

/exchangeInfo 响应中的格式:

{
   "filterType": "NOTIONAL",
   "minNotional": "10.00000000",
   "applyMinToMarket": false,
   "maxNotional": "10000.00000000",
   "applyMaxToMarket": false,
   "avgPriceMins": 5
}

名义价值过滤器(NOTIONAL)定义了订单在一个交易对上可以下单的名义价值区间.



applyMinToMarket 定义了 minNotional 是否适用于市价单(MARKET)

applyMaxToMarket 定义了 maxNotional 是否适用于市价单(MARKET).

要通过此过滤器, 订单的名义价值 (单价 x 数量, price * quantity) 需要满足如下条件:

对于市价单(MARKET), 用于计算的价格采用的是在 avgPriceMins 定义的时间之内的平均价.

如果 avgPriceMins 为 0, 则采用最新的价格.

ICEBERG_PARTS 冰山订单拆分数

/exchangeInfo 响应中的格式:

  {
    "filterType": "ICEBERG_PARTS",
    "limit": 10
  }

ICEBERG_PARTS 代表冰山订单最多可以拆分成多少个小订单。
计算方法为 向上取整(qty / icebergQty)

MARKET_LOT_SIZE 市价订单尺寸

**/exchangeInfo 响应中的格式:*

  {
    "filterType": "MARKET_LOT_SIZE",
    "minQty": "0.00100000",
    "maxQty": "100000.00000000",
    "stepSize": "0.00100000"
  }

MARKET_LOT_SIZE过滤器为交易对上的MARKET订单定义了数量(即拍卖中的"手数")规则。 共有3部分:

为了通过market lot sizequantity必须满足以下条件:

MAX_NUM_ORDERS 最多订单数

/exchangeInfo 响应中的格式:

  {
    "filterType": "MAX_NUM_ORDERS",
    "maxNumOrders": 25
  }

定义了某个交易对最多允许的挂单数量(不包括已关闭的订单)
普通订单与条件订单均计算在内

MAX_NUM_ALGO_ORDERS 最多条件单数

/exchangeInfo 响应中的格式:

  {
    "filterType": "MAX_NUM_ALGO_ORDERS",
    "maxNumAlgoOrders": 5
  }

MAX_NUM_ALGO_ORDERS过滤器定义允许账户在交易对上开设的"algo"订单的最大数量。
"Algo"订单是STOP_LOSSSTOP_LOSS_LIMITTAKE_PROFITTAKE_PROFIT_LIMIT止盈止损单。

MAX_NUM_ICEBERG_ORDERS 最多冰山单数

MAX_NUM_ICEBERG_ORDERS过滤器定义了允许在交易对上开设账户的ICEBERG订单的最大数量。
ICEBERG订单是icebergQty大于0的任何订单。.

/exchangeInfo 响应中的格式:

  {
    "filterType": "MAX_NUM_ICEBERG_ORDERS",
    "maxNumIcebergOrders": 5
  }

MAX_POSITION 过滤器

这个过滤器定义账户允许的基于base asset的最大仓位。一个用户的仓位可以定义为如下资产的总和: 1. base asset的可用余额 1. base asset的锁定余额 1. 所有处于open的买单的数量总和

如果用户的仓位大于最大的允许仓位,买单会被拒绝。

如果一个订单的数量(quantity) 可能导致持有仓位溢出, 会触发过滤器 MAX_POSITION.

/exchangeInfo 响应中的格式:

{
  "filterType": "MAX_POSITION",
  "maxPosition": "10.00000000"
}

TRAILING_DELTA

ExchangeInfo format:

    {
          "filterType": "TRAILING_DELTA",
          "minTrailingAboveDelta": 10,
          "maxTrailingAboveDelta": 2000,
          "minTrailingBelowDelta": 10,
          "maxTrailingBelowDelta": 2000
   }

此过滤器定义了参数trailingDelta的最大和最小值.

下追踪止损订单, 需要满足条件:

对于 STOP_LOSS BUY, STOP_LOSS_LIMIT_BUY, TAKE_PROFIT SELLTAKE_PROFIT_LIMIT SELL 订单:

对于 STOP_LOSS SELL, STOP_LOSS_LIMIT SELL, TAKE_PROFIT BUY, 和 TAKE_PROFIT_LIMIT BUY 订单:

交易所级别过滤器

EXCHANGE_MAX_NUM_ORDERS 最多订单数

/exchangeInfo 响应中的格式:

  {
    "filterType": "EXCHANGE_MAX_NUM_ORDERS",
    "maxNumOrders": 1000
  }

EXCHANGE_MAX_NUM_ORDERS过滤器定义了允许在交易对上开设账户的最大订单数。
请注意,此过滤器同时计算"algo"订单和常规订单。

EXCHANGE_MAX_ALGO_ORDERS 交易最大ALGO订单数

/exchangeInfo 响应中的格式:

  {
    "filterType": "EXCHANGE_MAX_ALGO_ORDERS",
    "maxNumAlgoOrders": 200
  }

EXCHANGE_MAX_ALGO_ORDERS过滤器定义了允许在交易上开设账户的"algo"订单的最大数量。
"Algo"订单是STOP_LOSSSTOP_LOSS_LIMITTAKE_PROFITTAKE_PROFIT_LIMIT订单。

EXCHANGE_MAX_NUM_ICEBERG_ORDERS 冰山订单的最大订单数

此过滤器定义了允许账号持有的最大冰山订单数量.

/exchangeInfo 响应中的格式:

{
  "filterType": "EXCHANGE_MAX_NUM_ICEBERG_ORDERS",
  "maxNumIcebergOrders": 10000
}

钱包接口

系统状态(System)

响应

{ 
        "status": 0,              // 0: 正常,1:系统维护
        "msg": "normal"           // "normal", "system_maintenance"
}

GET /sapi/v1/system/status

获取系统状态。

权重(IP): 1

获取所有币信息 (USER_DATA)

获取针对用户的所有(Binance支持充提操作的)币种信息。

响应

[
    {
        "coin": "BTC",
        "depositAllEnable": true,
        "free": "0.08074558",
        "freeze": "0.00000000",
        "ipoable": "0.00000000",
        "ipoing": "0.00000000",
        "isLegalMoney": false,
        "locked": "0.00000000",
        "name": "Bitcoin",
        "networkList": [
            {
                "addressRegex": "^(bnb1)[0-9a-z]{38}$",
                "coin": "BTC",
                "depositDesc": "Wallet Maintenance, Deposit Suspended", // 仅在充值关闭时返回
                "depositEnable": false,
                "isDefault": false,        
                "memoRegex": "^[0-9A-Za-z\\-_]{1,120}$",
                "minConfirm": 1,  // 上账所需的最小确认数
                "name": "BEP2",
                "network": "BNB",            
                "specialTips": "Both a MEMO and an Address are required to successfully deposit your BEP2-BTCB tokens to Binance.",
                "unLockConfirm": 0,  // 解锁需要的确认数 
                "withdrawDesc": "Wallet Maintenance, Withdrawal Suspended", // 仅在提现关闭时返回
                "withdrawEnable": false,
                "withdrawFee": "0.00000220",
                "withdrawIntegerMultiple": "0.00000001",
                "withdrawMax": "9999999999.99999999",
                "withdrawMin": "0.00000440",
                "sameAddress": true,  // 是否需要memo
                "estimatedArrivalTime": 25,
                "busy": false,
                "contractAddressUrl": "https://bscscan.com/token/",
                "contractAddress": "0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c"
            },
            {
                "addressRegex": "^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$|^(bc1)[0-9A-Za-z]{39,59}$",
                "coin": "BTC",
                "depositEnable": true,
                "isDefault": true,
                "memoRegex": "",
                "minConfirm": 1,  // 上账所需的最小确认数
                "name": "BTC",
                "network": "BTC",
                "specialTips": "",
                "unLockConfirm": 0,  // 解锁需要的确认数
                "withdrawEnable": true,
                "withdrawFee": "0.00050000",
                "withdrawIntegerMultiple": "0.00000001",
                "withdrawMax": "750",
                "withdrawMin": "0.00100000",
                "sameAddress": false,
                "estimatedArrivalTime": 25,
                "busy": false,
                "contractAddressUrl": "",
                "contractAddress": ""
            }
        ],
        "storage": "0.00000000",
        "trading": true,
        "withdrawAllEnable": true,
        "withdrawing": "0.00000000"
    }
]

GET /sapi/v1/capital/config/getall

权重(IP): 10

参数:

名称 类型 是否必需 描述
recvWindow LONG NO
timestamp LONG YES

查询每日资产快照 (USER_DATA)

响应

{
   "code":200, // 200表示返回正确,否则即为错误码
   "msg":"", // 与错误码对应的报错信息
   "snapshotVos":[
      {
         "data":{
            "balances":[
               {
                  "asset":"BTC",
                  "free":"0.09905021",
                  "locked":"0.00000000"
               },
               {
                  "asset":"USDT",
                  "free":"1.89109409",
                  "locked":"0.00000000"
               }
            ],
            "totalAssetOfBtc":"0.09942700"
         },
         "type":"spot",
         "updateTime":1576281599000
      }
   ]
}

{
   "code":200, // 200表示返回正确,否则即为错误码
   "msg":"", // 与错误码对应的报错信息
   "snapshotVos":[
      {
         "data":{
            "marginLevel":"2748.02909813",
            "totalAssetOfBtc":"0.00274803",
            "totalLiabilityOfBtc":"0.00000100",
            "totalNetAssetOfBtc":"0.00274750",
            "userAssets":[
               {
                  "asset":"XRP",
                  "borrowed":"0.00000000",
                  "free":"1.00000000",
                  "interest":"0.00000000",
                  "locked":"0.00000000",
                  "netAsset":"1.00000000"
               }
            ]
         },
         "type":"margin",
         "updateTime":1576281599000
      }
   ]
}

{
   "code":200, // 200表示返回正确,否则即为错误码
   "msg":"", // 与错误码对应的报错信息
   "snapshotVos":[
      {
         "data":{
            "assets":[
               {
                  "asset":"USDT",
                  "marginBalance":"118.99782335", // 不会实时更新,可以忽略
                  "walletBalance":"120.23811389"
               }
            ],
            "position":[
               {
                  "entryPrice":"7130.41000000",
                  "markPrice":"7257.66239673",
                  "positionAmt":"0.01000000",
                  "symbol":"BTCUSDT",
                  "unRealizedProfit":"1.24029054" // 只显示开仓当时的未实现盈亏,不会实时更新,可以忽略
               }
            ]
         },
         "type":"futures",
         "updateTime":1576281599000
      }
   ]
}

GET /sapi/v1/accountSnapshot

权重(IP): 2400

参数:

名称 类型 是否必需 描述
type STRING YES "SPOT", "MARGIN", "FUTURES"
startTime LONG NO
endTime LONG NO
limit INT NO min 7, max 30, default 7
recvWindow LONG NO
timestamp LONG YES

关闭站内划转 (USER_DATA)

响应

{}

POST /sapi/v1/account/disableFastWithdrawSwitch

权重(IP): 1

参数:

名称 类型 是否必需 描述
recvWindow LONG NO
timestamp LONG YES

开启站内划转 (USER_DATA)

响应

{}

POST /sapi/v1/account/enableFastWithdrawSwitch

权重(IP): 1

参数:

名称 类型 是否必需 描述
recvWindow LONG NO
timestamp LONG YES

提币 (USER_DATA)

响应

{
    "id":"7213fea8e94b4a5593d507237e5a555b"
}

POST /sapi/v1/capital/withdraw/apply

Submit a withdraw request.

权重(UID): 600

参数:

名称 类型 是否必需 描述
coin STRING YES
withdrawOrderId STRING NO 自定义提币ID
network STRING NO 提币网络
address STRING YES 提币地址
addressTag STRING NO 某些币种例如 XRP,XMR 允许填写次级地址标签
amount DECIMAL YES 数量
transactionFeeFlag BOOLEAN NO 当站内转账时免手续费, true: 手续费归资金转入方; false: 手续费归资金转出方; . 默认 false.
name STRING NO 地址的备注,填写该参数后会加入该币种的提现地址簿。地址簿上限为200,超出后会造成提现失败。地址中的空格需要encode成%20
walletType INTEGER NO 表示出金使用的钱包,0为现货钱包,1为资金钱包。默认walletType为"充币账户"是您设置在钱包->现货账户或资金账户->充值。
recvWindow LONG NO
timestamp LONG YES

获取充值历史(支持多网络) (USER_DATA)

响应

[
    {
        "id": "769800519366885376",
        "amount": "0.001",
        "coin": "BNB",
        "network": "BNB",
        "status": 0,
        "address": "bnb136ns6lfw4zs5hg4n85vdthaad7hq5m4gtkgf23",
        "addressTag": "101764890",
        "txId": "98A3EA560C6B3336D348B6C83F0F95ECE4F1F5919E94BD006E5BF3BF264FACFC",
        "insertTime": 1661493146000,
        "transferType": 0,
        "confirmTimes": "1/1",
        "unlockConfirm": 0,
        "walletType": 0
    },
    {
        "id": "769754833590042625",
        "amount":"0.50000000",
        "coin":"IOTA",
        "network":"IOTA",
        "status":1,
        "address":"SIZ9VLMHWATXKV99LH99CIGFJFUMLEHGWVZVNNZXRJJVWBPHYWPPBOSDORZ9EQSHCZAMPVAPGFYQAUUV9DROOXJLNW",
        "addressTag":"",
        "txId":"ESBFVQUTPIWQNJSPXFNHNYHSQNTGKRVKPRABQWTAXCDWOAKDKYWPTVG9BGXNVNKTLEJGESAVXIKIZ9999",
        "insertTime":1599620082000,
        "transferType":0,
        "confirmTimes": "1/1",
        "unlockConfirm": 0,
        "walletType": 0
    }
]

GET /sapi/v1/capital/deposit/hisrec

权重(IP): 1

参数:

名称 类型 是否必需 描述
includeSource Boolean NO 默认 false,如果为true时会返回sourceAddress字段
coin STRING NO
status INT NO 0(0:pending,6: credited but cannot withdraw,7=Wrong Deposit,8=Waiting User confirm,1:success)
startTime LONG NO 默认当前时间90天前的时间戳
endTime LONG NO 默认当前时间戳
offset INT NO 默认:0
limit INT NO 默认:1000,最大1000
recvWindow LONG NO
timestamp LONG YES
txId STRING NO

获取提币历史 (支持多网络) (USER_DATA)

响应

[
  {
    "id": "b6ae22b3aa844210a7041aee7589627c",  // 该笔提现在币安的id
    "amount": "8.91000000",   // 提现转出金额
    "transactionFee": "0.004", // 手续费
    "coin": "USDT",
    "status": 6,
    "address": "0x94df8b352de7f46f64b01d3666bf6e936e44ce60",
    "txId": "0xb5ef8c13b968a406cc62a93a8bd80f9e9a906ef1b3fcf20a2e48573c17659268"   // 提现交易id
    "applyTime": "2019-10-12 11:12:02",  // UTC 时间
    "network": "ETH",
    "transferType": 0 // 1: 站内转账, 0: 站外转账    
    "withdrawOrderId": "WITHDRAWtest123", // 自定义ID, 如果没有则不返回该字段
    "info": "The address is not valid. Please confirm with the recipient",  // 提币失败原因
    "confirmNo":3,  // 提现确认数
    "walletType": 1,  //1: 资金钱包 0:现货钱包
    "txKey": "",
    "completeTime": "2023-03-23 16:52:41"  // 提现完成,成功下账时间(UTC)
  },
  {
    "id": "156ec387f49b41df8724fa744fa82719",
    "amount": "0.00150000",
    "transactionFee": "0.004",
    "coin": "BTC",
    "status": 6,
    "address": "1FZdVHtiBqMrWdjPyRPULCUceZPJ2WLCsB",
    "txId": "60fd9007ebfddc753455f95fafa808c4302c836e4d1eebc5a132c36c1d8ac354"
    "applyTime": "2019-09-24 12:43:45",
    "network": "BTC",
    "transferType": 0, 
    "info": "",
    "confirmNo": 2,
    "walletType": 1,
    "txKey": "",
    "completeTime": "2023-03-23 16:52:41" 
  }
]

GET /sapi/v1/capital/withdraw/history

权重(UID): 18000

请求限制: 每秒10次

参数:

名称 类型 是否必需 描述
coin STRING NO
withdrawOrderId STRING NO
status INT NO 0(0:已发送确认Email,1:已被用户取消 2:等待确认 3:被拒绝 4:处理中 5:提现交易失败 6 提现完成)
offset INT NO
limit INT NO 默认:1000, 最大:1000
startTime LONG NO 默认当前时间90天前的时间戳
endTime LONG NO 默认当前时间戳
recvWindow LONG NO
timestamp LONG YES

获取充值地址 (支持多网络) (USER_DATA)

响应

{
    "address": "1HPn8Rx2y6nNSfagQBKy27GB99Vbzg89wv",
    "coin": "BTC",
    "tag": "",
    "url": "https://btc.com/1HPn8Rx2y6nNSfagQBKy27GB99Vbzg89wv"
}

GET /sapi/v1/capital/deposit/address

权重(IP): 10

参数:

名称 类型 是否必需 描述
coin STRING YES
network STRING NO
amount DECIMAL NO
recvWindow LONG NO
timestamp LONG YES

账户状态 (USER_DATA)

响应

{
    "data": "Normal" 
}

GET /sapi/v1/account/status

获取账户状态详情。

权重(IP): 1

参数:

名称 类型 是否必需 描述
recvWindow LONG NO
timestamp LONG YES

账户API交易状态(USER_DATA)

响应

{
    "data": {          // 账户API交易状态详情
            "isLocked": false,   // API交易功能是否被锁
            "plannedRecoverTime": 0,  // API交易功能被锁情况下的预计恢复时间
            "triggerCondition": { 
                    "GCR": 150,  // Number of GTC orders
                    "IFER": 150, // Number of FOK/IOC orders
                    "UFR": 300   // Number of orders
            },
            "updateTime": 1547630471725   
    }
}

GET /sapi/v1/account/apiTradingStatus

获取 api 账户交易状态详情。

权重(IP): 1

参数:

名称 类型 是否必需 描述
recvWindow LONG NO
timestamp LONG YES

小额资产转换BNB历史 (USER_DATA)

响应

{
        "total": 8,   //共计发生过的转换笔数
        "userAssetDribblets": [
            {
                "operateTime": 1615985535000,
                "totalTransferedAmount": "0.00132256",   //本次转换所得BNB
                "totalServiceChargeAmount": "0.00002699",   //本次转换手续费(BNB)
                "transId": 45178372831,
                "userAssetDribbletDetails": [           //本次转换的细节
                    {
                        "transId": 4359321,
                        "serviceChargeAmount": "0.000009",
                        "amount": "0.0009",
                        "operateTime": 1615985535000,
                        "transferedAmount": "0.000441",
                        "fromAsset": "USDT"
                    },
                    {
                        "transId": 4359321,
                        "serviceChargeAmount": "0.00001799",
                        "amount": "0.0009",
                        "operateTime": 1615985535000,
                        "transferedAmount": "0.00088156",
                        "fromAsset": "ETH"
                    }
                ]
            },
            {
                "operateTime":1616203180000,
                "totalTransferedAmount": "0.00058795",
                "totalServiceChargeAmount": "0.000012",
                "transId": 4357015,
                "userAssetDribbletDetails": [       
                    {
                        "transId": 4357015,
                        "serviceChargeAmount": "0.00001"
                        "amount": "0.001",
                        "operateTime": 1616203180000,
                        "transferedAmount": "0.00049",
                        "fromAsset": "USDT"
                    },
                    {
                        "transId": 4357015,
                        "serviceChargeAmount": "0.000002"         
                        "amount": "0.0001",
                        "operateTime": 1616203180000,
                        "transferedAmount": "0.00009795",
                        "fromAsset": "ETH"
                    }
                ]
            }
        ]
    }
}

GET /sapi/v1/asset/dribblet

权重(IP): 1

参数:

名称 类型 是否必需 描述
accountType STRING NO SPOTMARGIN,默认SPOT
startTime LONG NO
endTime LONG NO
recvWindow LONG NO
timestamp LONG YES

获取可以转换成BNB的小额资产 (USER_DATA)

响应

{
    "details": [
        {
            "asset": "ADA",         //资产名
            "assetFullName": "ADA", //资产全称
            "amountFree": "6.21",   //可转换数量
            "toBTC": "0.00016848",  //等值BTC
            "toBNB": "0.01777302",  //可转换BNB(未扣除手续费)
            "toBNBOffExchange": "0.01741756", //可转换BNB(已扣除手续费)
            "exchange": "0.00035546" //手续费
        }
    ],
    "totalTransferBtc": "0.00016848",//全部资产等值BTC
    "totalTransferBNB": "0.01777302",//总共可以转换的BNB数量
    "dribbletPercentage": "0.02"     //转换手续费
}  

POST /sapi/v1/asset/dust-btc

获取可以转换成 BNB 的小额资产列表.

权重(IP): 1

参数:

名称 类型 是否必需 描述
accountType STRING NO SPOTMARGIN,默认SPOT
recvWindow LONG NO
timestamp LONG YES

小额资产转换 (USER_DATA)

响应

{
    "totalServiceCharge":"0.02102542",
    "totalTransfered":"1.05127099",
    "transferResult":[
        {
            "amount":"0.03000000",
            "fromAsset":"ETH",
            "operateTime":1563368549307,
            "serviceChargeAmount":"0.00500000",
            "tranId":2970932918,
            "transferedAmount":"0.25000000"
        },
        {
            "amount":"0.09000000",
            "fromAsset":"LTC",
            "operateTime":1563368549404,
            "serviceChargeAmount":"0.01548000",
            "tranId":2970932918,
            "transferedAmount":"0.77400000"
        },
        {
            "amount":"248.61878453",
            "fromAsset":"TRX",
            "operateTime":1563368549489,
            "serviceChargeAmount":"0.00054542",
            "tranId":2970932918,
            "transferedAmount":"0.02727099"
        }
    ]
}

POST /sapi/v1/asset/dust

把小额资产转换成 BNB.

权重(UID): 10

参数:

名称 类型 是否必需 描述
asset ARRAY YES 正在转换的资产。 例如:asset=BTC,USDT
accountType STRING NO SPOTMARGIN,默认SPOT
recvWindow LONG NO
timestamp LONG YES

资产利息记录 (USER_DATA)

响应

{
    "rows":[
        {
            "id":1637366104,
            "amount":"10.00000000",
            "asset":"BHFT",
            "divTime":1563189166000,
            "enInfo":"BHFT distribution",
            "tranId":2968885920
        },
        {
            "id": 1631750237,
            "amount":"10.00000000",
            "asset":"BHFT",
            "divTime":1563189165000,
            "enInfo":"BHFT distribution",
            "tranId":2968885920
        }
    ],
    "total":2
}

GET /sapi/v1/asset/assetDividend

获取资产利息记录。

权重(IP): 10

参数:

名称 类型 是否必需 描述
asset STRING NO
startTime LONG NO
endTime LONG NO
limit INT NO Default 20, max 500
recvWindow LONG NO
timestamp LONG YES

上架资产详情 (USER_DATA)

响应

{
    "CTR": {
            "minWithdrawAmount": "70.00000000",   //最小提现数量
            "depositStatus": false,   //是否可以充值(只有所有网络都关闭充值才为false)
            "withdrawFee": 35,   // 提现手续费
            "withdrawStatus": true,    //是否开放提现(只有所有网络都关闭提币才为false)
            "depositTip": "Delisted, Deposit Suspended"   //暂停充值的原因(如果暂停才有这一项)
        },
        "SKY": {
            "minWithdrawAmount": "0.02000000",
            "depositStatus": true,
            "withdrawFee": 0.01,
            "withdrawStatus": true
        }
}

GET /sapi/v1/asset/assetDetail

权重(IP): 1

参数:

名称 类型 是否必需 描述
asset STRING NO
recvWindow LONG NO
timestamp LONG YES

交易手续费率查询 (USER_DATA)

响应

[
    {
        "symbol": "ADABNB",
        "makerCommission": "0.001",
        "takerCommission": "0.001"
    },
    {
        "symbol": "BNBBTC",
        "makerCommission": "0.001",
        "takerCommission": "0.001"
    }
]

GET /sapi/v1/asset/tradeFee

权重(IP): 1

参数:

名称 类型 是否必需 描述
symbol STRING NO
recvWindow LONG NO
timestamp LONG YES

用户万向划转 (USER_DATA)

响应:

{
    "tranId":13526853623
}

POST /sapi/v1/asset/transfer

您需要开通api key 允许万向划转权限来调用此接口。

权重(UID)): 900

参数:

名称 类型 是否必需 描述
type ENUM YES
asset STRING YES
amount DECIMAL YES
fromSymbol STRING NO
toSymbol STRING NO
recvWindow LONG NO
timestamp LONG YES

查询用户万向划转历史 (USER_DATA)

响应:

{
    "total":2,
    "rows":[
        {
            "asset":"USDT",
            "amount":"1",
            "type":"MAIN_UMFUTURE"
            "status": "CONFIRMED", // status: CONFIRMED / FAILED / PENDING
            "tranId": 11415955596,
            "timestamp":1544433328000
        },
        {
            "asset":"USDT",
            "amount":"2",
            "type":"MAIN_UMFUTURE",
            "status": "CONFIRMED",
            "tranId": 11366865406,
            "timestamp":1544433328000
        }
    ]
}

GET /sapi/v1/asset/transfer

权重(IP): 1

参数:

名称 类型 是否必需 描述
type ENUM YES
startTime LONG NO
endTime LONG NO
current INT NO 默认 1
size INT NO 默认 10, 最大 100
fromSymbol STRING NO
toSymbol STRING NO
recvWindow LONG NO
timestamp LONG YES

资金账户 (USER_DATA)

响应

[
    {
        "asset": "USDT",
        "free": "1",    // 可用余额
        "locked": "0",  // 锁定资金
        "freeze": "0",  //冻结资金
        "withdrawing": "0",  // 提币
        "btcValuation": "0.00000091"  // btc估值
    }
]

POST /sapi/v1/asset/get-funding-asset

权重(IP): 1

参数:

名称 类型 是否必需 描述
asset STRING NO
needBtcValuation STRING NO true or false
recvWindow LONG NO
timestamp LONG YES

用户持仓 (USER_DATA)

响应

[
  {
    "asset": "AVAX",
    "free": "1",
    "locked": "0",
    "freeze": "0",
    "withdrawing": "0",
    "ipoable": "0",
    "btcValuation": "0"
  },
  {
    "asset": "BCH",
    "free": "0.9",
    "locked": "0",
    "freeze": "0",
    "withdrawing": "0",
    "ipoable": "0",
    "btcValuation": "0"
  },
  {
    "asset": "BNB",
    "free": "887.47061626",
    "locked": "0",
    "freeze": "10.52",
    "withdrawing": "0.1",
    "ipoable": "0",
    "btcValuation": "0"
  },
  {
    "asset": "BUSD",
    "free": "9999.7",
    "locked": "0",
    "freeze": "0",
    "withdrawing": "0",
    "ipoable": "0",
    "btcValuation": "0"
  },
  {
    "asset": "SHIB",
    "free": "532.32",
    "locked": "0",
    "freeze": "0",
    "withdrawing": "0",
    "ipoable": "0",
    "btcValuation": "0"
  },
  {
    "asset": "USDT",
    "free": "50300000001.44911105",
    "locked": "0",
    "freeze": "0",
    "withdrawing": "0",
    "ipoable": "0",
    "btcValuation": "0"
  },
  {
    "asset": "WRZ",
    "free": "1",
    "locked": "0",
    "freeze": "0",
    "withdrawing": "0",
    "ipoable": "0",
    "btcValuation": "0"
  }
]

POST /sapi/v3/asset/getUserAsset

获取用户持仓,仅返回>0的数据。

权重(IP): 5

参数:

名称 类型 是否必需 描述
asset STRING NO 如果资产为空,则查询用户所有的正资产。
needBtcValuation BOOLEAN NO 是否需要返回兑换成BTC的估值
recvWindow LONG NO
timestamp LONG YES

稳定币自动兑换划转 (TRADE)

响应

{
  "tranId": 118263407119,
  "status": "S"
}

POST /sapi/v1/asset/convert-transfer

稳定币和BUSD之间的自动划转

权重(UID): 5

参数

名称 类型 是否必需 描述
clientTranId STRING YES 用户自定义流水号,唯一标志,限制最短长度为20
asset STRING YES 当前资产
amount BigDecimal YES 数量必须为正数
targetAsset String YES 目标资产
accountType String NO 仅支持MAIN和CARD,如果为空,默认查询主账户MAIN

稳定币自动兑换划转查询 (USER_DATA)

响应

{
  "total":3,
  "rows":
  [
    {
      "tranId":118263615991,
      "type":244,
      "time":1664442078000,
      "deductedAsset":"BUSD",
      "deductedAmount":"1",
      "targetAsset":"USDC",
      "targetAmount":"1",
      "status":"S",
      "accountType":"MAIN"
    },{
      "tranId":118263598801,
      "type":244,
      "time":1664442061000,
      "deductedAsset":"BUSD",
      "deductedAmount":"1",
      "targetAsset":"USDC",
      "targetAmount":"1",
      "status":"S",
      "accountType":"MAIN"
    },{
      "tranId":118263407119,
      "type":244,
      "time":1664441820000,
      "deductedAsset":"BUSD",
      "deductedAmount":"1",
      "targetAsset":"USDC",
      "targetAmount":"1",
      "status":"S",
      "accountType":"MAIN"
    }
  ]
}

GET /sapi/v1/asset/convert-transfer/queryByPage

权重(UID): 5

参数

名称 类型 是否必需 描述
tranId LONG NO 流水号
clientTranId STRING NO 用户自定义流水号
asset STRING NO 不传或者空字符串查全部, 匹配扣除币种和目标币种
startTime LONG YES 开始时间(包含),单位:毫秒
endTime LONG YES 结束时间(不包含),单位:毫秒
accountType STRING NO 账户类型: MAIN-主账户。CARD-资金账户。如果传入则仅返回对应wallet的记录,不传或者传null则返回该用户spot和card钱包的记录。
current INTEGER NO 当前页面,默认1,最小值为1
size INTEGER NO 页面大小,默认10,最大值为100

云算力历史记录分页查询 (USER_DATA)

响应:

{
  "total":5,
  "rows":[
    {"createTime":1667880112000,"tranId":121230610120,"type":248,"asset":"USDT","amount":"25.0068","status":"S"},
    {"createTime":1666776366000,"tranId":119991507468,"type":249,"asset":"USDT","amount":"0.027","status":"S"},
    {"createTime":1666764505000,"tranId":119977966327,"type":248,"asset":"USDT","amount":"0.027","status":"S"},
    {"createTime":1666758189000,"tranId":119973601721,"type":248,"asset":"USDT","amount":"0.018","status":"S"},
    {"createTime":1666757278000,"tranId":119973028551,"type":248,"asset":"USDT","amount":"0.018","status":"S"}
  ]
}

GET /sapi/v1/asset/ledger-transfer/cloud-mining/queryByPage

云算力支付和退款历史分页查询

权重(UID): 600

参数:

名称 类型 是否必需 描述
tranId LONG NO 流水号
clientTranId STRING NO 外部唯一流水号
asset STRING NO 不传或者空字符串查全部
startTime LONG YES 开始时间(包含),单位:毫秒
endTime LONG YES 结束时间(不包含),单位:毫秒
current INTEGER NO 当前页面,默认1,最小值为1
size INTEGER NO 页面大小,默认10,最大值为100

查询用户API Key权限 (USER_DATA)

响应

{
   "ipRestrict": false,  // 是否限制ip访问
   "createTime": 1623840271000,   // 创建时间
   "enableInternalTransfer": true,  // 此选项授权此密钥在您的母账户和子账户之间划转资金
   "enableFutures": false,  // 合约交易权限,需注意开通合约账户之前创建的API Key不支持合约API功能
   "enablePortfolioMarginTrading":true,  //  统一账户交易权限
   "enableVanillaOptions": false,  // 欧式期权交易权限
   "permitsUniversalTransfer": true,  // 授权该密钥可用于专用的万向划转接口,用以操作其支持的多种类型资金划转。各业务自身的划转接口使用权限,不受本授权影响
   "enableReading": true,
   "enableSpotAndMarginTrading": false, // 现货和杠杆交易权限
   "enableWithdrawals": false,   // 此选项允许通过此api提现。开启提现选项必须添加IP访问限制过滤器
   "enableMargin": false   // 此选项在全仓账户完成划转后可编辑
}

GET /sapi/v1/account/apiRestrictions

权重(IP): 1

参数:

名称 类型 是否必需 描述
recvWindow LONG NO
timestamp LONG YES

查询用户稳定币与 BUSD 互相转换的设置 (USER_DATA)

响应:

{
  "convertEnabled": true,
  "coins": [
    "USDC",
    "USDP",
    "TUSD"
  ],
  "exchangeRates": {
    "USDC": "1",
    "TUSD": "1",
    "USDP": "1"
  }
}

GET /sapi/v1/capital/contract/convertible-coins

查询用户充值/提现时候稳定币与 BUSD 互转的设置

权重(UID): 600

参数: None

修改哪些稳定币可与 BUSD 互相转换(USER_DATA)

响应: 成功返回 200,无 body

POST /sapi/v1/capital/contract/convertible-coins

修改哪些稳定币可与 BUSD 互相转换

权重(UID): 600

参数:

名称 类型 是否必需 描述
coin STRING YES USDC、USDP、TUSD 中的一个
enable BOOLEAN YES true: 打开转换。false: 关闭转换

一键上账 (充值到过期地址) (USER_DATA)

响应:

{
    "code": "000000",
    "message": "success",
    "data":true,
    "success": true
}

POST /sapi/v1/capital/deposit/credit-apply

申请充值到过期地址的一键上账.

权重(IP): 1

参数:

名称 类型 是否必需 描述
depositId LONG NO 充值记录Id,优先使用
txId STRING NO 充值txId,当depositId没指定时使用
subAccountId LONG NO Cloud的子账户ID
subUserId LONG NO 母账户的子账户userId

查询充值地址列表(USER_DATA)

响应:

[
  {
    "coin": "ETH",
    "address": "0xD316E95Fd9E8E237Cb11f8200Babbc5D8D177BA4",
    "tag":"",
    "isDefault": 0
  }, 
  {
    "coin": "ETH",
    "address": "0xD316E95Fd9E8E237Cb11f8200Babbc5D8D177BA4",
    "tag":"",
    "isDefault": 0
  }, 
  {
    "coin": "ETH",
    "address": "0x00003ada75e7da97ba0db2fcde72131f712455e2",
    "tag":"",
    "isDefault": 1 
  }
]

GET /sapi/v1/capital/deposit/address/list

根据网络币种或币种获取充值地址列表

权重(IP): 10

参数:

名称 类型 是否必需 描述
coin STRING YES coin是网络的地址空间名称
network STRING NO 网络
timestamp LONG YES 时间戳

查询用户钱包余额 (USER_DATA)

响应:

[
  {
    "activate": true,
    "balance": "0",
    "walletName": "Spot"
  }, 
  {
    "activate": true,
    "balance": "0",
    "walletName": "Funding"
  }, 
  {
    "activate": true,
    "balance": "0",
    "walletName": "Cross Margin"
  }, 
  {
    "activate": true,
    "balance": "0",
    "walletName": "Isolated Margin"
  }, 
  {
    "activate": true,
    "balance": "0.71842752",
    "walletName": "USDⓈ-M Futures"
  }, 
  {
    "activate": true,
    "balance": "0",
    "walletName": "COIN-M Futures"
  }, 
  {
    "activate": true,
    "balance": "0",
    "walletName": "Earn"
  }, 
  {
    "activate": false,
    "balance": "0",
    "walletName": "Options"
  }
]

GET /sapi/v1/asset/wallet/balance

查询用户钱包余额

权重(IP): 60

参数:

名称 类型 是否必需 描述
recvWindow LONG NO
timestamp LONG YES

查询用户委托资金历史(适用主账户)(USER_DATA)

响应:

{
    "total": 3316,
    "rows": [
      {
        "clientTranId": "293915932290879488",
        "transferType": "Undelegate",
        "asset": "ETH",
        "amount": "1",
        "time": 1695205406000
      }, 
      {
        "clientTranId": "293915892281413632",
        "transferType": "Delegate",
        "asset": "ETH",
        "amount": "1",
        "time": 1695205396000
      }
    ]
}

GET /sapi/v1/asset/custody/transfer-history

查询用户委托资金历史

权重(IP): 60

参数:

名称 类型 是否必需 描述
email STRING YES
startTime LONG YES
endTime LONG YES
type ENUM NO Delegate/Undelegate
asset STRING NO
current INTEGER NO 默认 1
size INTEGER NO 默认 10, 最大 100
recvWindow LONG NO
timestamp LONG YES

查询现货币对的下架计划 (MARKET_DATA)

GET /sapi/v1/spot/delist-schedule

查询现货币对的下架计划

响应:

[
  {
    "delistTime": 1686161202000,
    "symbols": [
      "ADAUSDT",
      "BNBUSDT"
    ]
  },
  {
    "delistTime": 1686222232000,
    "symbols": [
      "ETHUSDT"
    ]
  }
]

权重(IP): 100

参数:

名称 类型 是否必需 描述
recvWindow LONG NO
timestamp LONG YES

查询提现地址簿 (USER_DATA)

GET /sapi/v1/capital/withdraw/address/list

查询提现地址簿

响应:

[
  {
    "address": "string",
    "addressTag": "string",
    "coin": "string",
    "name": "string",
    "network": "string",
    "origin": "string",
    "originType": "string",
    "whiteStatus": true
  }
]

权重(IP): 10

帐户信息 (USER_DATA)

GET /sapi/v1/account/info

获取帐户信息详情。

响应:

{
  "vipLevel": 0,
  "isMarginEnabled": true,    
  "isFutureEnabled": true
}

权重(IP): 1

参数:

名称 类型 是否必需 描述
recvWindow LONG NO
timestamp LONG YES

子母账户接口

创建虚拟子账户(适用主账户)

响应:

{
    "email":"addsdd_virtual@aasaixwqnoemail.com"
}

POST /sapi/v1/sub-account/virtualSubAccount

权重(IP): 1

参数:

名称 类型 是否必需 描述
subAccountString STRING YES 请输入字符串,我们将为您创建一个虚拟邮箱进行注册
recvWindow LONG NO
timestamp LONG YES

查询子账户列表(适用主账户)

响应:

{
    "subAccounts":[
        {
            "email":"testsub@gmail.com",
            "isFreeze":false,
            "createTime":1544433328000,
            "isManagedSubAccount": false,
            "isAssetManagementSubAccount": false
        },
        {
            "email":"virtual@oxebmvfonoemail.com",
            "isFreeze":false,
            "createTime":1544433328000,
            "isManagedSubAccount": false,
            "isAssetManagementSubAccount": false
        }
    ]
}

GET /sapi/v1/sub-account/list

权重(IP): 1

参数:

名称 类型 是否必需 描述
email STRING NO Sub-account email
isFreeze STRING NO true or false
page INT NO 默认: 1
limit INT NO 默认: 1, 最大: 200
recvWindow LONG NO
timestamp LONG YES

查询子账户现货资金划转历史 (适用主账户)

响应:

[
    {
        "from":"aaa@test.com",
        "to":"bbb@test.com",
        "asset":"BTC",
        "qty":"10",
        "status": "SUCCESS",
        "tranId": 6489943656,
        "time":1544433328000
    },
    {
        "from":"bbb@test.com",
        "to":"ccc@test.com",
        "asset":"ETH",
        "qty":"2",
        "status": "SUCCESS",
        "tranId": 6489938713,
        "time":1544433328000
    }
]

GET /sapi/v1/sub-account/sub/transfer/history

权重(IP): 1

参数:

名称 类型 是否必需 描述
fromEmail STRING NO
toEmail STRING NO
startTime LONG NO
endTime LONG NO
page INT NO 默认: 1
limit INT NO 默认: 500
recvWindow LONG NO
timestamp LONG YES

查询子账户合约资金划转历史 (适用主账户)

响应

{
    "success":true,
    "futuresType": 2,
    "transfers":[
        {
            "from":"aaa@test.com",
            "to":"bbb@test.com",
            "asset":"BTC",
            "qty":"1",
            "tranId":11897001102,
            "time":1544433328000
        },
        {
            "from":"bbb@test.com",
            "to":"ccc@test.com",
            "asset":"ETH",
            "qty":"2",
            "tranId":11631474902,
            "time":1544433328000
        }
    ]
}

GET /sapi/v1/sub-account/futures/internalTransfer

权重(IP): 1

参数:

名称 类型 是否必需 描述
email STRING YES 子账户邮箱 备注
futuresType LONG YES 1:USDT合约,2: 币本位合约
startTime LONG NO 默认返回100天内历史记录
endTime LONG NO 默认返回100天内历史记录
page INT NO 默认值: 1
limit INT NO 默认值: 50, 最大值:500
recvWindow LONG NO
timestamp LONG YES

执行子账户合约资金划转 (适用主账户)

响应

{
    "success":true,
    "txnId":"2934662589"
}

POST /sapi/v1/sub-account/futures/internalTransfer

权重(IP): 1

参数:

名称 类型 是否必需 描述
fromEmail STRING YES 发送者邮箱 备注
toEmail STRING YES 接收者邮箱 备注
futuresType LONG YES 1:USDT合约, 2: 币本位合约
asset STRING YES
amount DECIMAL YES
recvWindow LONG NO
timestamp LONG YES

查询子账户资产 (适用主账户)

响应

{
    "balances":[
        {
            "asset":"ADA",
            "free":10000,
            "locked":0
        },
        {
            "asset":"BNB",
            "free":10003,
            "locked":0
        },
        {
            "asset":"BTC",
            "free":11467.6399,
            "locked":0
        },
        {
            "asset":"ETH",
            "free":10004.995,
            "locked":0
        },
        {
            "asset":"USDT",
            "free":11652.14213,
            "locked":0
        }
    ],
}

GET /sapi/v3/sub-account/assets

权重(UID): 60

参数:

名称 类型 是否必需 描述
email STRING YES 子账户邮箱 备注
recvWindow LONG NO
timestamp LONG YES

查询子账户现货资产汇总 (适用主账户)

响应:

{
    "totalCount":2,
    "masterAccountTotalAsset":"0.23231201",
    "spotSubUserAssetBtcVoList":[
        {
            "email":"sub123@test.com",
            "totalAsset":"9999.00000000"
        },
        {
            "email":"test456@test.com",
            "totalAsset":"0.00000000"
        }
    ]
}

获取BTC计价的子账户现货资产汇总。

GET /sapi/v1/sub-account/spotSummary

权重(IP): 1

参数:

名称 类型 是否必需 描述
email STRING NO 子账户邮箱
page LONG NO 分页,默认 1
size LONG NO 单页条目数, 默认 10, 最大 20
recvWindow LONG NO
timestamp LONG YES

获取子账户充值地址 (适用主账户)

响应

{
    "address":"TDunhSa7jkTNuKrusUTU1MUHtqXoBPKETV",
    "coin":"USDT",
    "tag":"",
    "url":"https://tronscan.org/#/address/TDunhSa7jkTNuKrusUTU1MUHtqXoBPKETV"
}

GET /sapi/v1/capital/deposit/subAddress (HMAC SHA256)

权重(IP): 1

参数:

名称 类型 是否必需 描述
email STRING YES 子账户邮箱 备注
coin STRING YES
network STRING NO
amount DECIMAL NO
recvWindow LONG NO
timestamp LONG YES

获取子账户充值记录 (适用主账户)

响应

[
    {
        "id": "769800519366885376",
        "amount": "0.001",
        "coin": "BNB",
        "network": "BNB",
        "status": 0,
        "address": "bnb136ns6lfw4zs5hg4n85vdthaad7hq5m4gtkgf23",
        "addressTag": "101764890",
        "txId": "98A3EA560C6B3336D348B6C83F0F95ECE4F1F5919E94BD006E5BF3BF264FACFC",
        "insertTime": 1661493146000,
        "transferType": 0,
        "confirmTimes": "1/1",
        "unlockConfirm": 0,
        "walletType": 0
    },
    {
        "id": "769754833590042625",
        "amount":"0.50000000",
        "coin":"IOTA",
        "network":"IOTA",
        "status":1,
        "address":"SIZ9VLMHWATXKV99LH99CIGFJFUMLEHGWVZVNNZXRJJVWBPHYWPPBOSDORZ9EQSHCZAMPVAPGFYQAUUV9DROOXJLNW",
        "addressTag":"",
        "txId":"ESBFVQUTPIWQNJSPXFNHNYHSQNTGKRVKPRABQWTAXCDWOAKDKYWPTVG9BGXNVNKTLEJGESAVXIKIZ9999",
        "insertTime":1599620082000,
        "transferType":0,
        "confirmTimes": "1/1",
        "unlockConfirm": 0,
        "walletType": 0
    }
]

GET /sapi/v1/capital/deposit/subHisrec

权重(IP): 1

参数:

名称 类型 是否必需 描述
email STRING YES 子账户邮箱 备注
coin STRING NO
status INT NO 0(0:pending,6: credited but cannot withdraw,7:Wrong Deposit,8:Waiting User confirm,1:success)
startTime LONG NO
endTime LONG NO
limit INT NO
offset INT NO default:0
recvWindow LONG NO
timestamp LONG YES
txId STRING NO

查询子账户Margin/Futures状态 (适用主账户)

响应

[
    {
        "email":"123@test.com",      // user email
        "isSubUserEnabled": true,    // true or false
        "isUserActive": true,        // true or false
        "insertTime": 1570791523523,  // sub account create time
        "isMarginEnabled": true,     // true or false for margin
        "isFutureEnabled": true,      // true or false for futures.
        "mobile": 1570791523523      // user mobile number
    }
]

GET /sapi/v1/sub-account/status

权重(IP): 10

参数:

名称 类型 是否必需 描述
email STRING NO 子账户邮箱 备注
recvWindow LONG NO
timestamp LONG YES

为子账户开通Margin (适用主账户)

响应

{

    "email":"123@test.com",
    "isMarginEnabled": true

}

POST /sapi/v1/sub-account/margin/enable

权重(IP): 1

参数:

名称 类型 是否必需 描述
email STRING YES 子账户邮箱 备注
recvWindow LONG NO
timestamp LONG YES

查询子账户Margin账户详情 (适用主账户)

响应

{
      "email":"123@test.com",
      "marginLevel": "11.64405625",
      "totalAssetOfBtc": "6.82728457",
      "totalLiabilityOfBtc": "0.58633215",
      "totalNetAssetOfBtc": "6.24095242",
      "marginTradeCoeffVo": 
            {
                "forceLiquidationBar": "1.10000000",  // 强平风险率
                "marginCallBar": "1.50000000",        // 补仓风险率
                "normalBar": "2.00000000"             // 初始风险率
            },
      "marginUserAssetVoList": [
          {
              "asset": "BTC",
              "borrowed": "0.00000000",
              "free": "0.00499500",
              "interest": "0.00000000",
              "locked": "0.00000000",
              "netAsset": "0.00499500"
          },
          {
              "asset": "BNB",
              "borrowed": "201.66666672",
              "free": "2346.50000000",
              "interest": "0.00000000",
              "locked": "0.00000000",
              "netAsset": "2144.83333328"
          },
          {
              "asset": "ETH",
              "borrowed": "0.00000000",
              "free": "0.00000000",
              "interest": "0.00000000",
              "locked": "0.00000000",
              "netAsset": "0.00000000"
          },
          {
              "asset": "USDT",
              "borrowed": "0.00000000",
              "free": "0.00000000",
              "interest": "0.00000000",
              "locked": "0.00000000",
              "netAsset": "0.00000000"
          }
      ]
}

GET /sapi/v1/sub-account/margin/account

权重(IP): 10

参数:

名称 类型 是否必需 描述
email STRING YES 子账户邮箱 备注
recvWindow LONG NO
timestamp LONG YES

查询子账户Margin账户汇总 (适用主账户)

响应

{
    "totalAssetOfBtc": "4.33333333", 
    "totalLiabilityOfBtc": "2.11111112", 
    "totalNetAssetOfBtc": "2.22222221",
    "subAccountList":[
        {
            "email":"123@test.com",
            "totalAssetOfBtc": "2.11111111",
            "totalLiabilityOfBtc": "1.11111111",
            "totalNetAssetOfBtc": "1.00000000"
        },
        { 
            "email":"345@test.com",
            "totalAssetOfBtc": "2.22222222", 
            "totalLiabilityOfBtc": "1.00000001", 
            "totalNetAssetOfBtc": "1.22222221"
        }
    ]
}

GET /sapi/v1/sub-account/margin/accountSummary

权重(IP): 10

参数:

名称 类型 是否必需 描述
recvWindow LONG NO
timestamp LONG YES

为子账户开通Futures (适用主账户)

响应

{

    "email":"123@test.com",
    "isFuturesEnabled": true  // true or false

}

POST /sapi/v1/sub-account/futures/enable

权重(IP): 1

参数:

名称 类型 是否必需 描述
email STRING YES 子账户邮箱 备注
recvWindow LONG NO
timestamp LONG YES

查询子账户Futures账户详情 (适用主账户)

响应


{
    "email": "abc@test.com",
    "asset": "USDT",
    "assets":[
        {
            "asset": "USDT",
            "initialMargin": "0.00000000",
            "maintenanceMargin": "0.00000000",
            "marginBalance": "0.88308000",
            "maxWithdrawAmount": "0.88308000",
            "openOrderInitialMargin": "0.00000000",
            "positionInitialMargin": "0.00000000",
            "unrealizedProfit": "0.00000000",
            "walletBalance": "0.88308000"
         }
    ],
    "canDeposit": true,
    "canTrade": true,
    "canWithdraw": true,
    "feeTier": 2,
    "maxWithdrawAmount": "0.88308000",
    "totalInitialMargin": "0.00000000",
    "totalMaintenanceMargin": "0.00000000",
    "totalMarginBalance": "0.88308000",
    "totalOpenOrderInitialMargin": "0.00000000",
    "totalPositionInitialMargin": "0.00000000",
    "totalUnrealizedProfit": "0.00000000",
    "totalWalletBalance": "0.88308000",
    "updateTime": 1576756674610
 }

GET /sapi/v1/sub-account/futures/account

权重(IP): 10

参数:

名称 类型 是否必需 描述
email STRING YES 子账户邮箱 备注
recvWindow LONG NO
timestamp LONG YES

查询子账户Futures账户汇总 (适用主账户)

响应

{
    "totalInitialMargin": "9.83137400", 
    "totalMaintenanceMargin": "0.41568700", 
    "totalMarginBalance": "23.03235621", 
    "totalOpenOrderInitialMargin": "9.00000000",
    "totalPositionInitialMargin": "0.83137400",
    "totalUnrealizedProfit": "0.03219710",
    "totalWalletBalance": "22.15879444",
    "asset": "USD", 
    "subAccountList":[
        {
            "email": "123@test.com",
            "totalInitialMargin": "9.00000000", 
            "totalMaintenanceMargin": "0.00000000", 
            "totalMarginBalance": "22.12659734", 
            "totalOpenOrderInitialMargin": "9.00000000",
            "totalPositionInitialMargin": "0.00000000",
            "totalUnrealizedProfit": "0.00000000",
            "totalWalletBalance": "22.12659734",
            "asset": "USD"  
        },
        { 
            "email": "345@test.com",
            "totalInitialMargin": "0.83137400", 
            "totalMaintenanceMargin": "0.41568700",
            "totalMarginBalance": "0.90575887",
            "totalOpenOrderInitialMargin": "0.00000000",
            "totalPositionInitialMargin": "0.83137400",
            "totalUnrealizedProfit": "0.03219710",
            "totalWalletBalance": "0.87356177",
            "asset": "USD"
        }
    ]
}

GET /sapi/v1/sub-account/futures/accountSummary

权重(IP): 1

参数:

名称 类型 是否必需 描述
recvWindow LONG NO
timestamp LONG YES

查询子账户合约持仓信息 (仅适用主账户)

响应

[
    {
        "entryPrice": "9975.12000",
        "leverage": "50",              // current initial leverage
        "maxNotional": "1000000",      // notional value limit of current initial leverage
        "liquidationPrice": "7963.54",
        "markPrice": "9973.50770517",
        "positionAmount": "0.010",
        "symbol": "BTCUSDT",
        "unrealizedProfit": "-0.01612295"
    }
]

GET /sapi/v1/sub-account/futures/positionRisk

权重(IP): 10

参数:

名称 类型 是否必需 描述
email STRING YES 子账户邮箱 备注
recvWindow LONG NO
timestamp LONG YES

子账户Futures划转 (仅适用主账户)

响应

{
    "txnId":"2966662589"
}

POST /sapi/v1/sub-account/futures/transfer

权重(IP): 1

参数:

名称 类型 是否必需 描述
email STRING YES 子账户邮箱 备注
asset STRING YES 划转资产, e.g., USDT
amount DECIMAL YES 划转数量
type INT YES 1: 由子账户的现货账户划转至其USDT本位合约账户; 2: 由子账户的USDT本位合约账户划转至其现货账户; 3:由子账户现货账户划转至其COIN本位合约账户;4: 由子账户COIN本位合约账户划转至其现货账户
recvWindow LONG NO
timestamp LONG YES

子账户Margin划转 (仅适用主账户)

响应

{
    "txnId":"2966662589"
}

POST /sapi/v1/sub-account/margin/transfer

权重(IP): 1

参数:

名称 类型 是否必需 描述
email STRING YES 子账户邮箱 备注
asset STRING YES 划转资产, e.g., USDT
amount DECIMAL YES 划转数量
type INT YES 1: 由子账户的现货账户划转至其杠杆账户; 2: 由子账户的杠杆账户划转至其现货账户
recvWindow LONG NO
timestamp LONG YES

向共同主账户下的子账户主动划转 (仅适用子账户)

响应

{
    "txnId":"2966662589"
}

POST /sapi/v1/sub-account/transfer/subToSub

权重(IP): 1

参数:

名称 类型 是否必需 描述
toEmail STRING YES 接收者子邮箱地址 备注
asset STRING YES
amount DECIMAL YES
recvWindow LONG NO
timestamp LONG YES

向主账户主动划转 (仅适用子账户)

响应

{
    "txnId":"2966662589"
}

POST /sapi/v1/sub-account/transfer/subToMaster

权重(IP): 1

参数:

名称 类型 是否必需 描述
asset STRING YES
amount DECIMAL YES
recvWindow LONG NO
timestamp LONG YES

查询子账户划转历史 (仅适用子账户)

响应

[
  {
    "counterParty":"master",
    "email":"master@test.com",
    "type":1,  // 1 for transfer in , 2 for transfer out
    "asset":"BTC",
    "qty":"1",
    "fromAccountType":"SPOT",
    "toAccountType":"SPOT",
    "status":"SUCCESS", // status: PROCESS / SUCCESS / FAILURE
    "tranId":11798835829,
    "time":1544433325000
  },
  {
    "counterParty": "subAccount",
    "email": "sub2@test.com",
    "type":  1,                                 
    "asset":"ETH",
    "qty":"2",
    "fromAccountType":"SPOT",
    "toAccountType":"COIN_FUTURE",
    "status":"SUCCESS",
    "tranId":11798829519,
    "time":1544433326000
  }
]

GET /sapi/v1/sub-account/transfer/subUserHistory

权重(IP): 1

参数:

名称 类型 是否必需 描述
asset STRING NO 如不提供,返回所有asset 划转记录
type INT NO 1: transfer in, 2: transfer out; 如不提供,返回transfer out方向划转记录
startTime LONG NO
endTime LONG NO
limit INT NO 默认值: 500
returnFailHistory BOOLEAN NO 默认False,返回PROCESS和SUCCESS状态的数据;如果传True返回PROCESS、SUCCESS、FAILURE状态的数据
recvWindow LONG NO
timestamp LONG YES

子母账户万能划转 (适用主账户)

响应

{
    "tranId":11945860693,
    "clientTranId":"test"
}

POST /sapi/v1/sub-account/universalTransfer

权重(IP): 1

参数:

名称 类型 是否必需 描述
fromEmail STRING NO
toEmail STRING NO
fromAccountType STRING YES "SPOT","USDT_FUTURE","COIN_FUTURE","MARGIN"(Cross),"ISOLATED_MARGIN"
toAccountType STRING YES "SPOT","USDT_FUTURE","COIN_FUTURE","MARGIN"(Cross),"ISOLATED_MARGIN"
clientTranId STRING NO 不可重复
symbol STRING NO 仅在ISOLATED_MARGIN类型下使用
asset STRING YES
amount DECIMAL YES
recvWindow LONG NO
timestamp LONG YES

查询子母账户万能划转历史 (适用主账户)

响应

{
    "result": [
        {
            "tranId": 92275823339,
            "fromEmail": "abctest@gmail.com",
            "toEmail": "deftest@gmail.com",
            "asset": "BNB",
            "amount": "0.01",
            "createTimeStamp": 1640317374000,
            "fromAccountType": "USDT_FUTURE",
            "toAccountType": "SPOT",
            "status": "SUCCESS",
            "clientTranId": "test"
        }
    ],
    "totalCount": 1
}

GET /sapi/v1/sub-account/universalTransfer

权重(IP): 1

参数:

名称 类型 是否必需 描述
fromEmail STRING NO
toEmail STRING NO
clientTranId STRING NO
startTime LONG NO
endTime LONG NO
page INT NO 默认 1
limit INT NO 默认 500, 最大 500
recvWindow LONG NO
timestamp LONG YES

查询子账户Futures账户详情V2 (适用主账户)

响应

USDT Margined Futures:


{
    "futureAccountResp": {
    "email": "abc@test.com",
    "assets":[
        {
            "asset": "USDT",
            "initialMargin": "0.00000000",
            "maintenanceMargin": "0.00000000",
            "marginBalance": "0.88308000",
            "maxWithdrawAmount": "0.88308000",
            "openOrderInitialMargin": "0.00000000",
            "positionInitialMargin": "0.00000000",
            "unrealizedProfit": "0.00000000",
            "walletBalance": "0.88308000"
         }
    ],
    "canDeposit": true,
    "canTrade": true,
    "canWithdraw": true,
    "feeTier": 2,
    "maxWithdrawAmount": "0.88308000",
    "totalInitialMargin": "0.00000000",
    "totalMaintenanceMargin": "0.00000000",
    "totalMarginBalance": "0.88308000",
    "totalOpenOrderInitialMargin": "0.00000000",
    "totalPositionInitialMargin": "0.00000000",
    "totalUnrealizedProfit": "0.00000000",
    "totalWalletBalance": "0.88308000",
    "updateTime": 1576756674610
 }

COIN Margined Futures:


{
    "deliveryAccountResp": {
        "email": "abc@test.com",
        "assets":[
            {
                "asset": "BTC",
                "initialMargin": "0.00000000",
                "maintenanceMargin": "0.00000000",
                "marginBalance": "0.88308000",
                "maxWithdrawAmount": "0.88308000",
                "openOrderInitialMargin": "0.00000000",
                "positionInitialMargin": "0.00000000",
                "unrealizedProfit": "0.00000000",
                "walletBalance": "0.88308000"
             }
        ],
        "canDeposit": true,
        "canTrade": true,
        "canWithdraw": true,
        "feeTier": 2,
        "updateTime": 1598959682001
    }
 }

GET /sapi/v2/sub-account/futures/account

权重(IP): 1

参数:

名称 类型 是否必需 描述
email STRING YES 子账户邮箱 备注
futuresType INT YES 1:USDT Margined Futures, 2:COIN Margined Futures
recvWindow LONG NO
timestamp LONG YES

查询子账户Futures账户汇总V2 (适用主账户)

响应

USDT Margined Futures:

{
  "futureAccountSummaryResp": {
    "totalInitialMargin": "9.83137400", 
    "totalMaintenanceMargin": "0.41568700", 
    "totalMarginBalance": "23.03235621", 
    "totalOpenOrderInitialMargin": "9.00000000",
    "totalPositionInitialMargin": "0.83137400",
    "totalUnrealizedProfit": "0.03219710",
    "totalWalletBalance": "22.15879444",
    "asset": "USD",  
    "subAccountList":[
        {
            "email": "123@test.com",
            "totalInitialMargin": "9.00000000", 
            "totalMaintenanceMargin": "0.00000000", 
            "totalMarginBalance": "22.12659734", 
            "totalOpenOrderInitialMargin": "9.00000000",
            "totalPositionInitialMargin": "0.00000000",
            "totalUnrealizedProfit": "0.00000000",
            "totalWalletBalance": "22.12659734",
            "asset": "USD"  
        },
        { 
            "email": "345@test.com",
            "totalInitialMargin": "0.83137400", 
            "totalMaintenanceMargin": "0.41568700",
            "totalMarginBalance": "0.90575887",
            "totalOpenOrderInitialMargin": "0.00000000",
            "totalPositionInitialMargin": "0.83137400",
            "totalUnrealizedProfit": "0.03219710",
            "totalWalletBalance": "0.87356177",
            "asset": "USD"
        }
    ]
}

COIN Margined Futures:

{
  "deliveryAccountSummaryResp": {
    "totalMarginBalanceOfBTC": "25.03221121", 
    "totalUnrealizedProfitOfBTC": "0.12233410",
    "totalWalletBalanceOfBTC": "22.15879444",
    "asset": "BTC",
    "subAccountList":[
        {
            "email": "123@test.com",
            "totalMarginBalance": "22.12659734", 
            "totalUnrealizedProfit": "0.00000000",
            "totalWalletBalance": "22.12659734",
            "asset": "BTC"
        },
        { 
            "email": "345@test.com",
            "totalMarginBalance": "0.90575887",
            "totalUnrealizedProfit": "0.03219710",
            "totalWalletBalance": "0.87356177",
            "asset": "BTC"
        }
    ]
  }
}

GET /sapi/v2/sub-account/futures/accountSummary

权重(IP): 10

参数:

名称 类型 是否必需 描述
futuresType INT YES 1:USDT Margined Futures, 2:COIN Margined Futures
page INT NO default:1
limit INT NO default:10, max:20
recvWindow LONG NO
timestamp LONG YES

查询子账户合约持仓信息V2 (仅适用主账户)

响应

USDT Margined Futures:

{
  "futurePositionRiskVos": [
     {
        "entryPrice": "9975.12000",
        "leverage": "50",              // current initial leverage
        "maxNotional": "1000000",      // notional value limit of current initial leverage
        "liquidationPrice": "7963.54",
        "markPrice": "9973.50770517",
        "positionAmount": "0.010",
        "symbol": "BTCUSDT",
        "unrealizedProfit": "-0.01612295"
     }
   ]
}

COIN Margined Futures:

{
  "deliveryPositionRiskVos": [
     {
        "entryPrice": "9975.12000",
        "markPrice": "9973.50770517",
        "leverage": "20",          
        "isolated": "false",                
        "isolatedWallet": "9973.50770517",
        "isolatedMargin": "0.00000000",
        "isAutoAddMargin": "false",
        "positionSide": "BOTH",
        "positionAmount": "1.230",
        "symbol": "BTCUSD_201225",
        "unrealizedProfit": "-0.01612295"
     }
   ]
}

GET /sapi/v2/sub-account/futures/positionRisk

权重(IP): 1

参数:

名称 类型 是否必需 描述
email STRING YES 子账户邮箱 备注
futuresType INT YES 1:USDT Margined Futures, 2:COIN Margined Futures
recvWindow LONG NO
timestamp LONG YES

查询子账户API Key IP白名单 (适用母账户)

响应:

{
    "ipRestrict": "true",
    "ipList": [
        "69.210.67.14",
        "8.34.21.10"
    ],
    "updateTime": 1636371437000,
    "apiKey": "k5V49ldtn4tszj6W3hystegdfvmGbqDzjmkCtpTvC0G74WhK7yd4rfCTo4lShf"
}

GET /sapi/v1/sub-account/subAccountApi/ipRestriction

权重(UID): 3000

参数:

名称 类型 是否必需 描述
email STRING YES Sub-account email
subAccountApiKey STRING YES
recvWindow LONG NO
timestamp LONG YES

删除子账户API Key IP白名单 (适用母账户)

响应:

{
  "ipRestrict": "true",
  "ipList": [
    "69.210.67.14",
    "8.34.21.10"
  ],
  "updateTime": 1636371437000,
  "apiKey": "k5V49ldtn4tszj6W3hystegdfvmGbqDzjmkCtpTvC0G74WhK7yd4rfCTo4lShf"
}

DELETE /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList

权重(UID): 3000

参数:

名称 类型 是否必需 描述
email STRING YES Sub-account email
subAccountApiKey STRING YES
ipAddress STRING NO 可批量删除,用逗号分隔
recvWindow LONG NO
timestamp LONG YES

为子账户API Key增加IP白名单 (适用母账户)

响应:

{
  "status": "2", 
  "ipList": [
    "69.210.67.14",
    "8.34.21.10",  //只当您有开启IP白名单且添加了IP白名单地址时才返回
  ],
  "updateTime": 1636371437000,
  "apiKey": "k5V49ldtn4tszj6W3hystegdfvmGbqDzjmkCtpTvC0G74WhK7yd4rfCTo4lShf"
}

POST /sapi/v2/sub-account/subAccountApi/ipRestriction

权重(UID): 3000

参数:

名称 类型 是否必需 描述
email STRING YES Sub-account email
subAccountApiKey STRING YES
status STRING YES IP限制状态。1或不填入(null) = IP未受限。2 = 仅限受信任IP访问。
ipAddress STRING NO 可批量填入IP,以逗号区隔
recvWindow LONG NO
timestamp LONG YES

投资人账户为托管子账户充值资产 (适用投资人母账户)

响应

{
    "tranId":66157362489
}

POST /sapi/v1/managed-subaccount/deposit

权重(IP): 1

参数:

名称 类型 是否必需 描述
toEmail STRING YES
asset STRING YES
amount DECIMAL YES
recvWindow LONG NO
timestamp LONG YES

投资人账户查询托管子账户资产 (适用投资人母账户)

响应

[
  {
     "coin": "INJ",                //币种
     "name": "Injective Protocol", //名称
     "totalBalance": "0",          //总资产
     "availableBalance": "0",      //可用资产
     "inOrder": "0",               //下单冻结
     "btcValue": "0"               //btc估值
  },
  {
     "coin": "FILDOWN",
     "name": "FILDOWN",
     "totalBalance": "0",
     "availableBalance": "0",
     "inOrder": "0",
     "btcValue": "0" 
  }
]

GET /sapi/v1/managed-subaccount/asset

权重(IP): 1

参数:

名称 类型 是否必需 描述
email STRING YES
recvWindow LONG NO
timestamp LONG YES

投资人账户为托管子账户提币资产 (适用投资人母账户)

响应

{
    "tranId":66157362489
}

POST /sapi/v1/managed-subaccount/withdraw

权重(IP): 1

参数:

名称 类型 是否必需 描述
fromEmail STRING YES
asset STRING YES
amount DECIMAL YES
transferDate LONG NO 提币会自动发生在选择的日期(UTC0),如果没有选择日期,提币会立即生效
recvWindow LONG NO
timestamp LONG YES

查询托管子账户资产快照 (适用投资人母账户)

响应

{
   "code":200, // 200表示返回正确,否则即为错误码
   "msg":"", // 与错误码对应的报错信息
   "snapshotVos":[
      {
         "data":{
            "balances":[
               {
                  "asset":"BTC",
                  "free":"0.09905021",
                  "locked":"0.00000000"
               },
               {
                  "asset":"USDT",
                  "free":"1.89109409",
                  "locked":"0.00000000"
               }
            ],
            "totalAssetOfBtc":"0.09942700"
         },
         "type":"spot",
         "updateTime":1576281599000
      }
   ]
}

{
   "code":200, // 200表示返回正确,否则即为错误码
   "msg":"", // 与错误码对应的报错信息
   "snapshotVos":[
      {
         "data":{
            "marginLevel":"2748.02909813",
            "totalAssetOfBtc":"0.00274803",
            "totalLiabilityOfBtc":"0.00000100",
            "totalNetAssetOfBtc":"0.00274750",
            "userAssets":[
               {
                  "asset":"XRP",
                  "borrowed":"0.00000000",
                  "free":"1.00000000",
                  "interest":"0.00000000",
                  "locked":"0.00000000",
                  "netAsset":"1.00000000"
               }
            ]
         },
         "type":"margin",
         "updateTime":1576281599000
      }
   ]
}

{
   "code":200, // 200表示返回正确,否则即为错误码
   "msg":"", // 与错误码对应的报错信息
   "snapshotVos":[
      {
         "data":{
            "assets":[
               {
                  "asset":"USDT",
                  "marginBalance":"118.99782335",
                  "walletBalance":"120.23811389"
               }
            ],
            "position":[
               {
                  "entryPrice":"7130.41000000",
                  "markPrice":"7257.66239673",
                  "positionAmt":"0.01000000",
                  "symbol":"BTCUSDT",
                  "unRealizedProfit":"1.24029054" //只显示开仓当时的未实现盈亏,不会实时更新,可以忽略
               }
            ]
         },
         "type":"futures",
         "updateTime":1576281599000
      }
   ]
}

GET /sapi/v1/managed-subaccount/accountSnapshot

权重(IP): 2400

参数:

名称 类型 是否必需 描述
email STRING YES
type STRING YES "SPOT"(现货), "MARGIN"(全仓), "FUTURES"(U本位合约)
startTime LONG NO
endTime LONG NO
limit INT NO min 7, max 30, default 7
recvWindow LONG NO
timestamp LONG YES

查询托管子账户的划转记录(适用投资人母账户) (USER_DATA)

响应

{
    managerSubTransferHistoryVos: [
        {
            fromEmail: "test_0_virtual@kq3kno9imanagedsub.com"
            fromAccountType: "SPOT"
            toEmail: "wdywl0lddakh@test.com"
            toAccountType: "SPOT"
            asset: "BNB"
            amount: "0.01"
            scheduledData: 1679416673000
            createTime: 1679416673000
            status: "SUCCESS"
            tranId: 91077779
        },
        {
            fromEmail: "wdywl0lddakh@test.com"
            fromAccountType: "SPOT"
            toEmail: "test_0_virtual@kq3kno9imanagedsub.com"
            toAccountType: "SPOT"
            asset: "BNB"
            amount: "1"
            scheduledData: 1679416616000
            createTime: 1679416616000
            status: "SUCCESS"
            tranId: 91077676
        }
    ]
    count: 2
}

GET /sapi/v1/managed-subaccount/queryTransLogForInvestor

投资人可以根据此接口查询其托管子账户划转记录。此接口可供托管子账户的投资者使用。托管子账户是为重视资产配置与账户应用灵活性,并同时将交易委托专业交易团队的投资者的子账户类型。 请参阅链接

权重(UID): 60

参数:

名称 类型 是否必需 描述
email STRING YES 托管子账户邮箱
startTime LONG YES 开始时间
endTime LONG YES 结束时间(开始时间结束时间间隔不能超过半年)
page INT YES 页数
limit INT YES 每页数量 (最大值: 500)
transfers STRING NO 划转方向 (from/to)
transferFunctionAccountType STRING NO 划转账户类型 (SPOT/MARGIN/ISOLATED_MARGIN/USDT_FUTURE/COIN_FUTURE)

查询托管子账户的划转记录(适用交易团队母账户)(USER_DATA)

响应

{
    managerSubTransferHistoryVos: [
        {
            fromEmail: "test_0_virtual@kq3kno9imanagedsub.com"
            fromAccountType: "SPOT"
            toEmail: "wdywl0lddakh@test.com"
            toAccountType: "SPOT"
            asset: "BNB"
            amount: "0.01"
            scheduledData: 1679416673000
            createTime: 1679416673000
            status: "SUCCESS"
            tranId: 91077779
        },
        {
            fromEmail: "wdywl0lddakh@test.com"
            fromAccountType: "SPOT"
            toEmail: "test_0_virtual@kq3kno9imanagedsub.com"
            toAccountType: "SPOT"
            asset: "BNB"
            amount: "1"
            scheduledData: 1679416616000
            createTime: 1679416616000
            status: "SUCCESS"
            tranId: 91077676
        }
    ]
    count: 2
}

GET /sapi/v1/managed-subaccount/queryTransLogForTradeParent

交易团队可以根据此接口查询其托管子账户划转记录。此接口可供托管子账户的交易团队使用。托管子账户是为重视资产配置与账户应用灵活性,并同时将交易委托专业交易团队的投资者的子账户类型。 请参阅链接

权重(UID): 60

参数:

名称 类型 是否必需 描述
email STRING YES 托管子账户邮箱
startTime LONG YES 开始时间
endTime LONG YES 结束时间(开始时间结束时间间隔不能超过半年)
page INT YES 页数
limit INT YES 每页数量 (最大值: 500)
transfers STRING NO 划转方向 (FROM/TO)
transferFunctionAccountType STRING NO 划转账户类型 (SPOT/MARGIN/ISOLATED_MARGIN/USDT_FUTURE/COIN_FUTURE)

投资人账户查询托管子账户期货资产 (适用投资人母账户) (USER_DATA)

响应

{
  "code": "200",
  "message": "OK",
  "snapshotVos": [
    {
      "type": "FUTURES",
      "updateTime": 1672893855394,
      "data": {
        "assets": [
          {
            "asset": "USDT",
            "marginBalance": 100,
            "walletBalance": 120
          }
        ],
        "position": [
          {
            "symbol": "BTCUSDT",
            "entryPrice": 17000,
            "markPrice": 17000,
            "positionAmt": 0.0001
          }
        ]
      }
    }
  ]
}

GET /sapi/v1/managed-subaccount/fetch-future-asset

投资人可以根据此接口查询其托管子账户期货资产

权重(IP): 1

参数:

名称 类型 是否必需 描述
email STRING YES 托管子账户邮箱

投资人账户查询托管子账户杠杆资产 (适用投资人母账户) (USER_DATA)

响应

{
  marginLevel:"999"
  totalAssetOfBtc:"0"
  totalLiabilityOfBtc:"0"
  totalNetAssetOfBtc:"0"
  userAssets:[
    0:{
    asset:"MATIC"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    1:{
    asset:"VET"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    2:{
    asset:"BAKE"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    3:{
    asset:"SHIB"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    4:{
    asset:"USDT"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    5:{
    asset:"DOGE"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    6:{
    asset:"AAVE"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    7:{
    asset:"ONT"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    8:{
    asset:"XRP"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    9:{
    asset:"XLM"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    10:{
    asset:"LINK"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    11:{
    asset:"QTUM"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    12:{
    asset:"ETHW"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    13:{
    asset:"XTZ"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    14:{
    asset:"LUNA"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    15:{
    asset:"EUR"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    16:{
    asset:"IOST"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    17:{
    asset:"BCH"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    18:{
    asset:"BTC"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    19:{
    asset:"IOTA"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    20:{
    asset:"CREAM"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    21:{
    asset:"BAT"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    22:{
    asset:"BNB"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    23:{
    asset:"ETH"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    24:{
    asset:"ZEC"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    25:{
    asset:"USDC"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    26:{
    asset:"LTC"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    27:{
    asset:"BUSD"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    28:{
    asset:"ZIL"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    29:{
    asset:"THETA"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
  ]
}

GET /sapi/v1/managed-subaccount/marginAsset

投资人可以根据此接口查询其托管子账户杠杆资产

权重(IP): 1

参数:

名称 类型 是否必需 描述
email STRING YES 托管子账户邮箱

查询子账户资产(适用主账户)(USER_DATA)

响应

{
    "balances":[
        {
            "asset":"ADA",
            "free":"10000",
            "locked":"0"
        },
        {
            "asset":"BNB",
            "free":"10003",
            "locked":"0"
        },
        {
            "asset":"BTC",
            "free":"11467.6399",
            "locked":"0"
        }
    ]
}

GET /sapi/v4/sub-account/assets

获取子账户资产

权重(UID): 60

参数:

名称 类型 是否必需 描述
email STRING YES 托管子账户邮箱
recvWindow LONG NO
timestamp LONG YES

查询托管子账户列表 (适用投资人母账户)(USER_DATA)

响应

{
    "total": 3,
    "managerSubUserInfoVoList": [
        {
            "rootUserId": 1000138475670,
            "managersubUserId": 1000137842513,
            "bindParentUserId": 1000138475669,
            "email": "test_0_virtual@kq3kno9imanagedsub.com",
            "insertTimeStamp": 1678435149000,
            "bindParentEmail": "wdyw8xsh8pey@test.com",
            "isSubUserEnabled": true,
            "isUserActive": true,
            "isMarginEnabled": false,
            "isFutureEnabled": false,
            "isSignedLVTRiskAgreement": false
        },
        {
            "rootUserId": 1000138475670,
            "managersubUserId": 1000137842514,
            "bindParentUserId": 1000138475669,
            "email": "test_1_virtual@4qd2u7zxmanagedsub.com",
            "insertTimeStamp": 1678435152000,
            "bindParentEmail": "wdyw8xsh8pey@test.com",
            "isSubUserEnabled": true,
            "isUserActive": true,
            "isMarginEnabled": false,
            "isFutureEnabled": false,
            "isSignedLVTRiskAgreement": false
        },
        {
            "rootUserId": 1000138475670,
            "managersubUserId": 1000137842515,
            "bindParentUserId": 1000138475669,
            "email": "test_2_virtual@akc05o8hmanagedsub.com",
            "insertTimeStamp": 1678435153000,
            "bindParentEmail": "wdyw8xsh8pey@test.com",
            "isSubUserEnabled": true,
            "isUserActive": true,
            "isMarginEnabled": false,
            "isFutureEnabled": false,
            "isSignedLVTRiskAgreement": false
        }
    ]
}

GET /sapi/v1/managed-subaccount/info

获取投资人之托管子账户列表

权重(UID): 60

参数:

名称 类型 是否必需 描述
email STRING NO 托管子账户邮箱
page INT NO 默认值: 1
limit INT NO 默认值: 20, 最大值: 20
recvWindow LONG NO
timestamp LONG YES

查询子账户交易量统计列表 (适用母账户)(USER_DATA)

响应

{
    "recent30BtcTotal": "0",
    "recent30BtcFuturesTotal": "0",
    "recent30BtcMarginTotal": "0",
    "recent30BusdTotal": "0",
    "recent30BusdFuturesTotal": "0",
    "recent30BusdMarginTotal": "0",
    "tradeInfoVos": []
}
{
    "recent30BtcTotal": "0",
    "recent30BtcFuturesTotal": "0",
    "recent30BtcMarginTotal": "0",
    "recent30BusdTotal": "0",
    "recent30BusdFuturesTotal": "0",
    "recent30BusdMarginTotal": "0",
    "tradeInfoVos": [
        {
            "userId": 1000138138384,
            "btc": 0,
            "btcFutures": 0,
            "btcMargin": 0,
            "busd": 0,
            "busdFutures": 0,
            "busdMargin": 0,
            "date": 1676851200000
        },
        {
            "userId": 1000138138384,
            "btc": 0,
            "btcFutures": 0,
            "btcMargin": 0,
            "busd": 0,
            "busdFutures": 0,
            "busdMargin": 0,
            "date": 1676937600000
        },
        {
            "userId": 1000138138384,
            "btc": 0,
            "btcFutures": 0,
            "btcMargin": 0,
            "busd": 0,
            "busdFutures": 0,
            "busdMargin": 0,
            "date": 1677024000000
        }
    ]
}

GET /sapi/v1/sub-account/transaction-statistics

查询子账户交易量统计列表 (适用母账户)

权重(UID): 60

参数:

名称 类型 是否必需 描述
email STRING Yes 子账户邮箱
recvWindow LONG NO
timestamp LONG YES

获取托管子账户充值地址 (适用投资人母账户)(USER_DATA)

响应

{
    "coin": "USDT",
    "address": "0x206c22d833bb0bb2102da6b7c7d4c3eb14bcf73d",
    "tag": "",
    "url": "https://etherscan.io/address/0x206c22d833bb0bb2102da6b7c7d4c3eb14bcf73d"
}

GET /sapi/v1/managed-subaccount/deposit/address

获取投资人之托管子账户充值地址

权重(UID): 1

参数:

名称 类型 是否必需 描述
email STRING YES 托管子账户邮箱
coin STRING YES
network STRING NO 网络可以在GET /sapi/v1/capital/deposit/address获取
recvWindow LONG NO
timestamp LONG YES

为子账户开通期权(适用主账户)(USER_DATA)

响应

{
    "email":"123@test.com",
    "isEOptionsEnabled": true  // true or false
}

POST /sapi/v1/sub-account/eoptions/enable

为子账户开通期权 (适用主账户)

权重(IP): 1

参数:

名称 类型 是否必需 描述
email STRING YES 托管子账户邮箱
recvWindow LONG NO
timestamp LONG YES

查询托管子账户的划转记录(适用交易团队子账户)(USER_DATA)

响应

{
    "managerSubTransferHistoryVos": [
        {
            "fromEmail": "test_0_virtual@kq3kno9imanagedsub.com",
            "fromAccountType": "SPOT",
            "toEmail": "wdywl0lddakh@test.com",
            "toAccountType": "SPOT",
            "asset": "BNB",
            "amount": "0.01",
            "scheduledData": 1679416673000,
            "createTime": 1679416673000,
            "status": "SUCCESS",
            "tranId": 91077779
        },
        {
            "fromEmail": "wdywl0lddakh@test.com",
            "fromAccountType": "SPOT",
            "toEmail": "test_0_virtual@kq3kno9imanagedsub.com",
            "toAccountType": "SPOT",
            "asset": "BNB",
            "amount": "1",
            "scheduledData": 1679416616000,
            "createTime": 1679416616000,
            "status": "SUCCESS",
            "tranId": 91077676
        }
    ],
    "count": 2
}

GET /sapi/v1/managed-subaccount/query-trans-log

查询托管子账户的划转记录(适用交易团队子账户)

权重(UID): 60

参数:

Name Type Mandatory Description
startTime LONG YES 开始时间
endTime LONG YES 结束时间(开始时间结束时间间隔不能超过半年)
page INT YES 页数
limit INT YES 每页数量 (最大值: 500)
transfers STRING NO 划转方向 (FROM/TO)
transferFunctionAccountType STRING NO 划转账户类型 (SPOT/MARGIN/ISOLATED_MARGIN/USDT_FUTURE/COIN_FUTURE)
recvWindow LONG NO
timestamp LONG YES

行情接口

测试服务器连通性

响应

{}

GET /api/v3/ping

测试能否联通 Rest API。

权重(IP): 1

参数:

NONE

数据源: 缓存

获取服务器时间

响应

{
  "serverTime": 1499827319559
}

GET /api/v3/time

测试能否联通 Rest API 并 获取服务器时间。

权重(IP): 1

参数:

NONE

数据源: 缓存

交易规范信息

响应

{
    "timezone": "UTC",
    "serverTime": 1565246363776,
    "rateLimits": [
        {
            //这些在"限制种类 (rateLimitType)"下的"枚举定义"部分中定义
            //所有限制都是可选的
        }
    ],
    "exchangeFilters": [
            //这些是"过滤器"部分中定义的过滤器
            //所有限制都是可选的
    ],
    "symbols": [
        {
            "symbol": "ETHBTC",
            "status": "TRADING",
            "baseAsset": "ETH",
            "baseAssetPrecision": 8,
            "quoteAsset": "BTC",
            "quotePrecision": 8,
            "quoteAssetPrecision": 8,
            "orderTypes": [
                "LIMIT",
                "LIMIT_MAKER",
                "MARKET",
                "STOP_LOSS",
                "STOP_LOSS_LIMIT",
                "TAKE_PROFIT",
                "TAKE_PROFIT_LIMIT"
            ],
            "icebergAllowed": true,
            "ocoAllowed": true,
            "quoteOrderQtyMarketAllowed": false,
            "allowTrailingStop": false,
            "isSpotTradingAllowed": true,
            "isMarginTradingAllowed": true,
            "cancelReplaceAllowed": false,
            "filters": [
                //这些在"过滤器"部分中定义
                //所有限制都是可选的
            ],
            "permissions": [],
            "permissionSets": [
              [
                "SPOT",
                "MARGIN"
              ]
            ],
            "defaultSelfTradePreventionMode": "NONE",
            "allowedSelfTradePreventionModes": [
              "NONE"
            ]
        }
    ]
}

GET /api/v3/exchangeInfo

获取交易规则和交易对信息。

权重(IP): 20

参数:

名称 类型 是否必须 描述
symbol STRING No 示例:curl -X GET "https://api.binance.com/api/v3/exchangeInfo?symbol=BNBBTC"
symbols ARRAY OF STRING No 示例:curl -X GET "https://api.binance.com/api/v3/exchangeInfo?symbols=%5B%22BNBBTC%22,%22BTCUSDT%22%5D"

curl -g -X GET 'https://api.binance.com/api/v3/exchangeInfo?symbols=["BTCUSDT","BNBBTC"]'
permissions ENUM No 示例:curl -X GET "https://api.binance.com/api/v3/exchangeInfo?permissions=SPOT"
or
curl -X GET "https://api.binance.com/api/v3/exchangeInfo?permissions=%5B%22MARGIN%22%2C%22LEVERAGED%22%5D"
or
curl -g -X GET 'https://api.binance.com/api/v3/exchangeInfo?permissions=["MARGIN","LEVERAGED"]'
showPermissionSets BOOLEAN No 用于控制是否提供 permissionSets 字段的内容。默认为 true
symbolStatus ENUM No 用于过滤具有此 tradingStatus 的交易对。有效值: TRADINGHALTBREAK
不能与 symbolssymbol 组合使用。

备注: * 如果参数 symbol 或者 symbols 提供的交易对不存在, 系统会返回错误并提示交易对不正确。 * 所有的参数都是可选的。 * permissions 可以支持单个或多个值(例如 SPOT, ["MARGIN","LEVERAGED"])。此参数不能与 symbolsymbols 组合使用。 * 如果未提供 permissions 参数,那么所有具有 SPOTMARGINLEVERAGED 权限的交易对都将被返回。 * 要显示具有任何权限的交易对,您需要在 permissions 中明确指定它们:(例如 ["SPOT","MARGIN",...])。有关完整列表,请参阅 可用权限

解释响应中的 permissionSets

数据源: 缓存

深度信息

响应

{
  "lastUpdateId": 1027024,
  "bids": [
    [
      "4.00000000",     // 价位
      "431.00000000"    // 挂单量
    ]
  ],
  "asks": [
    [
      "4.00000200",
      "12.00000000"
    ]
  ]
}

GET /api/v3/depth

权重(IP):

基于限制调整:

限制 权重
1-100 5
101-500 25
501-1000 50
1001-5000 250

参数:

名称 类型 是否必需 描述
symbol STRING YES
limit INT NO 默认 100; 最大 5000. 可选值:[5, 10, 20, 50, 100, 500, 1000, 5000]

如果 limit > 5000, 最多返回5000条数据.

数据源: 缓存

近期成交列表

响应

[
  {
    "id": 28457,
    "price": "4.00000100",
    "qty": "12.00000000",
    "time": 1499865549590, // 交易成交时间, 和websocket中的T一致.
    "isBuyerMaker": true,
    "isBestMatch": true
  }
]

GET /api/v3/trades

获取近期成交

权重(IP): 25

参数:

名称 类型 是否必需 描述
symbol STRING YES
limit INT NO 默认 500; 最大值 1000.

数据源: 缓存

查询历史成交

响应

[
  {
    "id": 28457,
    "price": "4.00000100",
    "qty": "12.00000000",
    "quoteQty": "48.000012",
    "time": 1499865549590,
    "isBuyerMaker": true,
    "isBestMatch": true
  }
]

GET /api/v3/historicalTrades

获取历史成交。

权重(IP): 25

参数:

名称 类型 是否必需 描述
symbol STRING YES
limit INT NO 默认 500; 最大值 1000.
fromId LONG NO 从哪一条成交id开始返回. 缺省返回最近的成交记录。

数据源: 数据库

近期成交(归集)

响应

[
  {
    "a": 26129,         // 归集成交ID
    "p": "0.01633102",  // 成交价
    "q": "4.70443515",  // 成交量
    "f": 27781,         // 被归集的首个成交ID
    "l": 27781,         // 被归集的末个成交ID
    "T": 1498793709153, // 成交时间
    "m": true,          // 是否为主动卖出单
    "M": true           // 是否为最优撮合单(可忽略,目前总为最优撮合)
  }
]

GET /api/v3/aggTrades

归集交易与逐笔交易的区别在于,同一价格、同一方向、同一时间的trade会被聚合为一条

权重(IP): 2

参数:

名称 类型 是否必需 描述
symbol STRING YES
fromId LONG NO 从包含fromId的成交id开始返回结果
startTime LONG NO 从该时刻之后的成交记录开始返回结果
endTime LONG NO 返回该时刻为止的成交记录
limit INT NO 默认 500; 最大 1000.

数据源: 数据库

K线数据

响应

[
  [
    1499040000000,      // k线开盘时间
    "0.01634790",       // 开盘价
    "0.80000000",       // 最高价
    "0.01575800",       // 最低价
    "0.01577100",       // 收盘价(当前K线未结束的即为最新价)
    "148976.11427815",  // 成交量
    1499644799999,      // k线收盘时间
    "2434.19055334",    // 成交额
    308,                // 成交笔数
    "1756.87402397",    // 主动买入成交量
    "28.46694368",      // 主动买入成交额
    "17928899.62484339" // 请忽略该参数
  ]
]

GET /api/v3/klines

每根K线代表一个交易对。
每根K线的开盘时间可视为唯一ID

权重(IP): 2

参数:

名称 类型 是否必需 描述
symbol STRING YES
interval ENUM YES 详见枚举定义:K线间隔
startTime LONG NO
endTime LONG NO
timeZone STRING NO 默认: 0 (UTC)
limit INT NO 默认 500; 最大 1000.

数据源: 数据库

当前平均价格

响应

{
  "mins": 5,
  "price": "9.35751834",
  "closeTime": 1694061154503
}

GET /api/v3/avgPrice

权重(IP): 2

参数:

名称 类型 是否必需 描述
symbol STRING YES

数据源: 缓存

UIK线数据

响应

[
  [
    1499040000000,      // k线开盘时间
    "0.01634790",       // 开盘价
    "0.80000000",       // 最高价
    "0.01575800",       // 最低价
    "0.01577100",       // 收盘价(当前K线未结束的即为最新价)
    "148976.11427815",  // 成交量
    1499644799999,      // k线收盘时间
    "2434.19055334",    // 成交额
    308,                // 成交笔数
    "1756.87402397",    // 主动买入成交量
    "28.46694368",      // 主动买入成交额
    "0" // 请忽略该参数
  ]
]

GET /api/v3/uiKlines

请求参数与响应和k线接口相同。

uiKlines 返回修改后的k线数据,针对k线图的呈现进行了优化。

权重(IP): 2

参数:

名称 类型 是否必需 描述
symbol STRING YES
interval ENUM YES
startTime LONG NO
endTime LONG NO
timeZone STRING NO Default: 0 (UTC)
limit INT NO 默认 500; 最大 1000.

数据源: 数据库

24hr 价格变动情况

响应 - FULL

{
  "symbol": "BNBBTC",
  "priceChange": "-94.99999800",
  "priceChangePercent": "-95.960",
  "weightedAvgPrice": "0.29628482",
  "prevClosePrice": "0.10002000",
  "lastPrice": "4.00000200",
  "lastQty": "200.00000000",
  "bidPrice": "4.00000000",
  "bidQty": "100.00000000",
  "askPrice": "4.00000200",
  "askQty": "100.00000000",
  "openPrice": "99.00000000",
  "highPrice": "100.00000000",
  "lowPrice": "0.10000000",
  "volume": "8913.30000000",
  "quoteVolume": "15.30000000",
  "openTime": 1499783499040,
  "closeTime": 1499869899040,
  "firstId": 28385,   // 首笔成交id
  "lastId": 28460,    // 末笔成交id
  "count": 76         // 成交笔数
}

OR

[
  {
    "symbol": "BNBBTC",
    "priceChange": "-94.99999800",
    "priceChangePercent": "-95.960",
    "weightedAvgPrice": "0.29628482",
    "prevClosePrice": "0.10002000",
    "lastPrice": "4.00000200",
    "lastQty": "200.00000000",
    "bidPrice": "4.00000000",
    "bidQty": "100.00000000",
    "askPrice": "4.00000200",
    "askQty": "100.00000000",
    "openPrice": "99.00000000",
    "highPrice": "100.00000000",
    "lowPrice": "0.10000000",
    "volume": "8913.30000000",
    "quoteVolume": "15.30000000",
    "openTime": 1499783499040,
    "closeTime": 1499869899040,
    "firstId": 28385,  
    "lastId": 28460,   
    "count": 76      
  }
]

Response - MINI

{
  "symbol":      "BNBBTC",          // 交易对
  "openPrice":   "99.00000000",     // 间隔开盘价
  "highPrice":   "100.00000000",    // 间隔最高价
  "lowPrice":    "0.10000000",      // 间隔最低价
  "lastPrice":   "4.00000200",      // 间隔收盘价
  "volume":      "8913.30000000",   // 总交易量 (base asset)
  "quoteVolume": "15.30000000",     // 总交易量 (quote asset)
  "openTime":    1499783499040,     // ticker间隔的开始时间
  "closeTime":   1499869899040,     // ticker间隔的结束时间
  "firstId":     28385,             // 统计时间内的第一笔trade id
  "lastId":      28460,             // 统计时间内的最后一笔trade id
  "count":       76                 // 统计时间内交易笔数
}

OR

[
  {
    "symbol": "BNBBTC",
    "openPrice": "99.00000000",
    "highPrice": "100.00000000",
    "lowPrice": "0.10000000",
    "lastPrice": "4.00000200",
    "volume": "8913.30000000",
    "quoteVolume": "15.30000000",
    "openTime": 1499783499040,
    "closeTime": 1499869899040,
    "firstId": 28385,
    "lastId": 28460,
    "count": 76
  },
  {
    "symbol": "LTCBTC",
    "openPrice": "0.07000000",
    "highPrice": "0.07000000",
    "lowPrice": "0.07000000",
    "lastPrice": "0.07000000",
    "volume": "11.00000000",
    "quoteVolume": "0.77000000",
    "openTime": 1656908192899,
    "closeTime": 1656994592899,
    "firstId": 0,
    "lastId": 10,
    "count": 11
  }
]

GET /api/v3/ticker/24hr

24 小时滚动窗口价格变动数据。 请注意,不携带symbol参数会返回全部交易对数据,不仅数据庞大,而且权重极高

权重(IP):

参数 提供Symbol数量 权重
symbol 1 2
不提供symbol 80
symbols 1-20 2
21-100 40
>= 101 80
不提供symbol 80

参数:

名称 类型 是否强制要求 详情
symbol STRING NO 参数 `symbol` 和 `symbols` 不可以一起使用

如果都不提供, 所有symbol的ticker数据都会返回.



symbols参数可接受的格式: ["BTCUSDT","BNBUSDT"]



%5B%22BTCUSDT%22,%22BNBUSDT%22%5D
symbols STRING NO
type ENUM NO 可接受的参数: FULLMINI.

如果不提供, 默认值为 FULL

数据源: 缓存

交易日行情(Ticker)

响应 - FULL

{
  "symbol":             "BTCUSDT",
  "priceChange":        "-83.13000000",         // 绝对价格变动
  "priceChangePercent": "-0.317",               // 相对价格变动百分比
  "weightedAvgPrice":   "26234.58803036",       // 报价成交量 / 成交量
  "openPrice":          "26304.80000000",
  "highPrice":          "26397.46000000",
  "lowPrice":           "26088.34000000",
  "lastPrice":          "26221.67000000",
  "volume":             "18495.35066000",       // 基础资产的成交量
  "quoteVolume":        "485217905.04210480",   // 报价资产的成交量
  "openTime":           1695686400000,
  "closeTime":          1695772799999,
  "firstId":            3220151555,             // 区间内的第一个交易的交易ID
  "lastId":             3220849281,             // 区间内的最后一个交易的交易ID
  "count":              697727                  // 区间内的交易数量
}

或者

[
  {
    "symbol": "BTCUSDT",
    "priceChange": "-83.13000000",
    "priceChangePercent": "-0.317",
    "weightedAvgPrice": "26234.58803036",
    "openPrice": "26304.80000000",
    "highPrice": "26397.46000000",
    "lowPrice": "26088.34000000",
    "lastPrice": "26221.67000000",
    "volume": "18495.35066000",
    "quoteVolume": "485217905.04210480",
    "openTime": 1695686400000,
    "closeTime": 1695772799999,
    "firstId": 3220151555,
    "lastId": 3220849281,
    "count": 697727
  },
  {
    "symbol": "BNBUSDT",
    "priceChange": "2.60000000",
    "priceChangePercent": "1.238",
    "weightedAvgPrice": "211.92276958",
    "openPrice": "210.00000000",
    "highPrice": "213.70000000",
    "lowPrice": "209.70000000",
    "lastPrice": "212.60000000",
    "volume": "280709.58900000",
    "quoteVolume": "59488753.54750000",
    "openTime": 1695686400000,
    "closeTime": 1695772799999,
    "firstId": 672397461,
    "lastId": 672496158,
    "count": 98698
  }
]

响应: - MINI

{
  "symbol":         "BTCUSDT",
  "openPrice":      "26304.80000000",
  "highPrice":      "26397.46000000",
  "lowPrice":       "26088.34000000",
  "lastPrice":      "26221.67000000",
  "volume":         "18495.35066000",       // 基础资产的成交量
  "quoteVolume":    "485217905.04210480",   // 报价资产的成交量
  "openTime":       1695686400000,
  "closeTime":      1695772799999,
  "firstId":        3220151555,             // 区间内的第一个交易的交易ID
  "lastId":         3220849281,             // 区间内的最后一个交易的交易ID
  "count":          697727                  // 区间内的交易数量
}

或者

[
  {
    "symbol": "BTCUSDT",
    "openPrice": "26304.80000000",
    "highPrice": "26397.46000000",
    "lowPrice": "26088.34000000",
    "lastPrice": "26221.67000000",
    "volume": "18495.35066000",
    "quoteVolume": "485217905.04210480",
    "openTime": 1695686400000,
    "closeTime": 1695772799999,
    "firstId": 3220151555,
    "lastId": 3220849281,
    "count": 697727
  },
  {
    "symbol": "BNBUSDT",
    "openPrice": "210.00000000",
    "highPrice": "213.70000000",
    "lowPrice": "209.70000000",
    "lastPrice": "212.60000000",
    "volume": "280709.58900000",
    "quoteVolume": "59488753.54750000",
    "openTime": 1695686400000,
    "closeTime": 1695772799999,
    "firstId": 672397461,
    "lastId": 672496158,
    "count": 98698
  }
]

GET /api/v3/ticker/tradingDay

交易日价格变动统计。

权重:

每个交易对占用4个权重.

当请求中的交易对数量超过50,此请求的权重将限制在200。

参数:

参数名 类型 是否必需 描述
symbol STRING YES symbol 或者 symbols 必须提供之一

symbols 可以接受的格式:
["BTCUSDT","BNBUSDT"]
或者
%5B%22BTCUSDT%22,%22BNBUSDT%22%5D

symbols 最多可以发送100个
symbols
timeZone STRING NO Default: 0 (UTC)
type ENUM NO 可接受值: FULLMINI
默认值: FULL

注意:

数据源: 数据库

最新价格

响应

{
  "symbol": "LTCBTC",
  "price": "4.00000200"
}

OR

[
  {
    "symbol": "LTCBTC",
    "price": "4.00000200"
  },
  {
    "symbol": "ETHBTC",
    "price": "0.07946600"
  }
]

GET /api/v3/ticker/price

获取交易对最新价格

权重(IP):

参数 Symbols数量 权重
symbol 1 2
不提供symbol 4
symbols 不限 4

参数:

参数名 类型 是否强制 详情
symbol STRING NO 参数 `symbol` 和 `symbols` 不可以一起使用

如果都不提供, 所有`symbol`的价格数据都会返回

`symbols`参数可接受的格式:
["BTCUSDT","BNBUSDT"]

%5B%22BTCUSDT%22,%22BNBUSDT%22%5D

symbols STRING NO

数据源: 缓存

当前最优挂单

响应

{
  "symbol": "LTCBTC",
  "bidPrice": "4.00000000",
  "bidQty": "431.00000000",
  "askPrice": "4.00000200",
  "askQty": "9.00000000"
}

OR

[
  {
    "symbol": "LTCBTC",
    "bidPrice": "4.00000000",
    "bidQty": "431.00000000",
    "askPrice": "4.00000200",
    "askQty": "9.00000000"
  },
  {
    "symbol": "ETHBTC",
    "bidPrice": "0.07946700",
    "bidQty": "9.00000000",
    "askPrice": "100000.00000000",
    "askQty": "1000.00000000"
  }
]

GET /api/v3/ticker/bookTicker

返回当前最优的挂单(最高买单,最低卖单)

权重(IP):

参数 Symbols数量 权重
symbol 1 2
不提供symbol 4
symbols 不限 4

参数:

参数名 类型 是否强制 详情
symbol STRING NO 参数 `symbol` 和 `symbols` 不可以一起使用

如果都不提供, 所有symbol的价格数据都会返回.



symbols参数可接受的格式: ["BTCUSDT","BNBUSDT"]



%5B%22BTCUSDT%22,%22BNBUSDT%22%5D
symbols STRING NO

数据源: 缓存

滚动窗口价格变动统计

响应 - FULL

{
  "symbol":             "BNBBTC",
  "priceChange":        "-8.00000000",  // 价格变化
  "priceChangePercent": "-88.889",      // 价格变化百分比
  "weightedAvgPrice":   "2.60427807",  
  "openPrice":          "9.00000000",
  "highPrice":          "9.00000000",
  "lowPrice":           "1.00000000",
  "lastPrice":          "1.00000000",
  "volume":             "187.00000000",
  "quoteVolume":        "487.00000000",
  "openTime":           1641859200000,  // ticker的开始时间
  "closeTime":          1642031999999,  // ticker的结束时间
  "firstId":            0,              // 统计时间内的第一笔trade id
  "lastId":             60,
  "count":              61              // 统计时间内交易笔数
}

或者

[
  {
    "symbol": "BTCUSDT",
    "priceChange": "-154.13000000",
    "priceChangePercent": "-0.740",
    "weightedAvgPrice": "20677.46305250",
    "openPrice": "20825.27000000",
    "highPrice": "20972.46000000",
    "lowPrice": "20327.92000000",
    "lastPrice": "20671.14000000",
    "volume": "72.65112300",
    "quoteVolume": "1502240.91155513",
    "openTime": 1655432400000,
    "closeTime": 1655446835460,
    "firstId": 11147809,
    "lastId": 11149775,
    "count": 1967
  },
  {
    "symbol": "BNBBTC",
    "priceChange": "0.00008530",
    "priceChangePercent": "0.823",
    "weightedAvgPrice": "0.01043129",
    "openPrice": "0.01036170",
    "highPrice": "0.01049850",
    "lowPrice": "0.01033870",
    "lastPrice": "0.01044700",
    "volume": "166.67000000",
    "quoteVolume": "1.73858301",
    "openTime": 1655432400000,
    "closeTime": 1655446835460,
    "firstId": 2351674,
    "lastId": 2352034,
    "count": 361
  }
]

响应 - MINI

{
    "symbol": "LTCBTC",
    "openPrice": "0.10000000",
    "highPrice": "2.00000000",
    "lowPrice": "0.10000000",
    "lastPrice": "2.00000000",
    "volume": "39.00000000",
    "quoteVolume": "13.40000000",  // 此k线内所有交易的price(价格) x volume(交易量)的总和
    "openTime": 1656986580000,     // ticker窗口的开始时间
    "closeTime": 1657001016795,    // ticker窗口的结束时间
    "firstId": 0,                  // 首笔成交id
    "lastId": 34,
    "count": 35                    // 统计时间内交易笔数
}

OR

[
    {
        "symbol": "BNBBTC",
        "openPrice": "0.10000000",
        "highPrice": "2.00000000",
        "lowPrice": "0.10000000",
        "lastPrice": "2.00000000",
        "volume": "39.00000000",
        "quoteVolume": "13.40000000", // 此k线内所有交易的price(价格) x volume(交易量)的总和
        "openTime": 1656986880000,    // ticker窗口的开始时间
        "closeTime": 1657001297799,   // ticker窗口的结束时间
        "firstId": 0,                 // 首笔成交id
        "lastId": 34,
        "count": 35                   // 统计时间内交易笔数
    },
    {
        "symbol": "LTCBTC",
        "openPrice": "0.07000000",
        "highPrice": "0.07000000",
        "lowPrice": "0.07000000",
        "lastPrice": "0.07000000",
        "volume": "33.00000000",
        "quoteVolume": "2.31000000",
        "openTime": 1656986880000,
        "closeTime": 1657001297799,
        "firstId": 0,
        "lastId": 32,
        "count": 33
    }
]

GET /api/v3/ticker

注意: 此接口和 GET /api/v3/ticker/24hr 有所不同.

此接口统计的时间范围比请求的windowSize多不超过59999ms.

接口的 openTime 是某一分钟的起始,而结束是当前的时间. 所以实际的统计区间会比请求的时间窗口多不超过59999ms.

比如, 结束时间 closeTime 是 1641287867099 (January 04, 2022 09:17:47:099 UTC) , windowSize1d. 那么开始时间 openTime 则为 1641201420000 (January 3, 2022, 09:17:00 UTC)

权重(IP):

4/交易对。

如果symbols请求的交易对超过50, 上限是200。

参数

Name Type Mandatory Description
symbol STRING YES 提供 symbol 或者 symbols 其中之一

symbols 可以传入的格式:
["BTCUSDT","BNBUSDT"]

%5B%22BTCUSDT%22,%22BNBUSDT%22%5D

symbols 允许最多100个交易对
symbols
windowSize ENUM NO 默认为 1d

windowSize 支持的值:
如果是分钟: 1m, 2m, ..., 59m
如果是小时: 1h, 2h, ..., 23h
如果是天: 1d, ..., 7d

不可以组合使用,比如 1d2h
type ENUM NO 可接受的参数: FULLMINI

如果不提供, 默认值为 FULL

数据源: 数据库


Websocket 行情推送

实时订阅/取消数据流

订阅一个信息流

响应

  {
    "result": null,
    "id": 1
  }

取消订阅一个信息流

响应

  {
    "result": null,
    "id": 312
  }

{
"method": "UNSUBSCRIBE",
"params":
[
"btcusdt@depth"
],
"id": 312
}

已订阅信息流

响应

  {
    "result": [
      "btcusdt@aggTrade"
    ],
    "id": 3
  }

{
"method": "LIST_SUBSCRIPTIONS",
"id": 3
}

设定属性

当前,唯一可以设置的属性是设置是否启用combined("组合")信息流。
当使用/ws/("原始信息流")进行连接时,combined属性设置为false,而使用 /stream/进行连接时则将属性设置为true

响应

{
  "result": null,
  "id": 5
}

{
"method": "SET_PROPERTY",
"params":
[
"combined",
true
],
"id": 5
}

检索属性

响应

  {
    "result": true, // Indicates that combined is set to true.
    "id": 2
  }

{
"method": "GET_PROPERTY",
"params":
[
"combined"
],
"id": 2
}

错误信息

错误信息 描述
{"code": 0, "msg": "Unknown property"} SET_PROPERTYGET_PROPERTY中应用的参数无效
{"code": 1, "msg": "Invalid value type: expected Boolean", "id": '%s'} 仅接受truefalse
{"code": 2, "msg": "Invalid request: property name must be a string"} 提供的属性名无效
{"code": 2, "msg": "Invalid request: request ID must be an unsigned integer"} 参数id未提供或id值是无效类型
{"code": 2, "msg": "Invalid request: unknown variant %s, expected one of SUBSCRIBE, UNSUBSCRIBE, LIST_SUBSCRIPTIONS, SET_PROPERTY, GET_PROPERTY at line 1 column 28"} 错字提醒,或提供的值不是预期类型
{"code": 2, "msg": "Invalid request: too many parameters"} 数据中提供了不必要参数
{"code": 2, "msg": "Invalid request: property name must be a string"} 未提供属性名
{"code": 2, "msg": "Invalid request: missing field method at line 1 column 73"} 数据未提供method
{"code":3,"msg":"Invalid JSON: expected value at line %s column %s"} JSON 语法有误.

归集交易流

Payload:

{
  "e": "aggTrade",  // 事件类型
  "E": 1672515782136,   // 事件时间
  "s": "BNBBTC",    // 交易对
  "a": 12345,       // 归集交易ID
  "p": "0.001",     // 成交价格
  "q": "100",       // 成交数量
  "f": 100,         // 被归集的首个交易ID
  "l": 105,         // 被归集的末次交易ID
  "T": 1672515782136,   // 成交时间
  "m": true,        // 买方是否是做市方。如true,则此次成交是一个主动卖出单,否则是一个主动买入单。
  "M": true         // 请忽略该字段
}

归集交易 stream 推送交易信息,是对单一订单的集合。

Stream 名称: <symbol>@aggTrade
更新速度: 实时

逐笔交易

Payload:

{
  "e": "trade",     // 事件类型
  "E": 1672515782136,   // 事件时间
  "s": "BNBBTC",    // 交易对
  "t": 12345,       // 交易ID
  "p": "0.001",     // 成交价格
  "q": "100",       // 成交数量
  "T": 1672515782136,   // 成交时间
  "m": true,        // 买方是否是做市方。如true,则此次成交是一个主动卖出单,否则是一个主动买入单。
  "M": true         // 请忽略该字段
}

Stream 名称: <symbol>@trade

逐笔交易推送每一笔成交的信息。 成交(或者说交易)的定义是仅有一个吃单者与一个挂单者相互交易。

更新速度: 实时

UTC K线 Streams

Payload:

{
  "e": "kline",     // 事件类型
  "E": 1672515782136,   // 事件时间
  "s": "BNBBTC",    // 交易对
  "k": {
    "t": 123400000, // 这根K线的起始时间
    "T": 123460000, // 这根K线的结束时间
    "s": "BNBBTC",  // 交易对
    "i": "1m",      // K线间隔
    "f": 100,       // 这根K线期间第一笔成交ID
    "L": 200,       // 这根K线期间末一笔成交ID
    "o": "0.0010",  // 这根K线期间第一笔成交价
    "c": "0.0020",  // 这根K线期间末一笔成交价
    "h": "0.0025",  // 这根K线期间最高成交价
    "l": "0.0015",  // 这根K线期间最低成交价
    "v": "1000",    // 这根K线期间成交量
    "n": 100,       // 这根K线期间成交笔数
    "x": false,     // 这根K线是否完结(是否已经开始下一根K线)
    "q": "1.0000",  // 这根K线期间成交额
    "V": "500",     // 主动买入的成交量
    "Q": "0.500",   // 主动买入的成交额
    "B": "123456"   // 忽略此参数
  }
}

K线stream逐秒推送所请求的K线种类(最新一根K线)的更新。此更新是基于 UTC+0 时区的。

Stream 名称: <symbol>@kline_<interval>

更新速度: 1s 1000ms,其它间隔 2000ms K线图间隔参数:

s -> 秒; m -> 分钟; h -> 小时; d -> 天; w -> 周; M -> 月

带有时区偏移量的K线

Payload:

{
  "e": "kline",     // 事件类型
  "E": 1672515782136,   // 事件时间
  "s": "BNBBTC",    // 交易对
  "k": {
    "t": 123400000, // 这根K线的起始时间
    "T": 123460000, // 这根K线的结束时间
    "s": "BNBBTC",  // 交易对
    "i": "1m",      // K线间隔
    "f": 100,       // 这根K线期间第一笔成交ID
    "L": 200,       // 这根K线期间末一笔成交ID
    "o": "0.0010",  // 这根K线期间第一笔成交价
    "c": "0.0020",  // 这根K线期间末一笔成交价
    "h": "0.0025",  // 这根K线期间最高成交价
    "l": "0.0015",  // 这根K线期间最低成交价
    "v": "1000",    // 这根K线期间成交量
    "n": 100,       // 这根K线期间成交笔数
    "x": false,     // 这根K线是否完结(是否已经开始下一根K线)
    "q": "1.0000",  // 这根K线期间成交额
    "V": "500",     // 主动买入的成交量
    "Q": "0.500",   // 主动买入的成交额
    "B": "123456"   // 忽略此参数
  }
}

K线stream逐秒推送所请求的K线种类(最新一根K线)的更新。此更新是基于 UTC+8 时区的。

UTC+8 时区偏移量:

Stream 名称: <symbol>@kline_<interval>@+08:00

更新速度: 1s 1000ms,其它间隔 2000ms

参考 Kline所支持的间隔参数

按 Symbol 的精简Ticker

Payload:

  {
    "e": "24hrMiniTicker",  // 事件类型
    "E": 1672515782136,         // 事件时间
    "s": "BNBBTC",          // 交易对
    "c": "0.0025",          // 最新成交价格
    "o": "0.0010",          // 24小时前开始第一笔成交价格
    "h": "0.0025",          // 24小时内最高成交价
    "l": "0.0010",          // 24小时内最低成交价
    "v": "10000",           // 成交量
    "q": "18"               // 成交额
  }

按Symbol刷新的最近24小时精简ticker信息

Stream 名称: <symbol>@miniTicker

更新速度: 1000ms

全市场所有Symbol的精简Ticker

Payload:

[
  {
    // 数组每一个元素对应一个交易对,内容与 \<symbol\>@miniTicker相同
  }
]

同上,只是推送所有交易对.需要注意的是,只有更新的ticker才会被推送.

Stream 名称: !miniTicker@arr

更新速度: 1000ms

按Symbol的完整Ticker

Payload:

{
  "e": "24hrTicker",  // 事件类型
  "E": 1672515782136,     // 事件时间
  "s": "BNBBTC",      // 交易对
  "p": "0.0015",      // 24小时价格变化
  "P": "250.00",      // 24小时价格变化(百分比)
  "w": "0.0018",      // 平均价格
  "x": "0.0009",      // 整整24小时之前,向前数的最后一次成交价格
  "c": "0.0025",      // 最新成交价格
  "Q": "10",          // 最新成交交易的成交量
  "b": "0.0024",      // 目前最高买单价
  "B": "10",          // 目前最高买单价的挂单量
  "a": "0.0026",      // 目前最低卖单价
  "A": "100",         // 目前最低卖单价的挂单量
  "o": "0.0010",      // 整整24小时前,向后数的第一次成交价格
  "h": "0.0025",      // 24小时内最高成交价
  "l": "0.0010",      // 24小时内最低成交价
  "v": "10000",       // 24小时内成交量
  "q": "18",          // 24小时内成交额
  "O": 0,             // 统计开始时间
  "C": 86400000,      // 统计结束时间
  "F": 0,             // 24小时内第一笔成交交易ID
  "L": 18150,         // 24小时内最后一笔成交交易ID
  "n": 18151          // 24小时内成交数
}

每秒推送单个交易对的过去24小时滚动窗口标签统计信息。

Stream 名称: <symbol>@ticker

更新速度: 1000ms

全市场所有交易对的完整Ticker

Payload:

[
  {
    // Same as <symbol>@ticker payload
  }
]

Stream 名称: !ticker@arr

更新速度: 1000ms

推送全市场所有交易对刷新的24小时完整ticker信息。需要注意的是,没有更新的ticker不会被推送。

按Symbol的最优挂单信息

Payload:

{
  "u":400900217,     // order book updateId
  "s":"BNBUSDT",     // 交易对
  "b":"25.35190000", // 买单最优挂单价格
  "B":"31.21000000", // 买单最优挂单数量
  "a":"25.36520000", // 卖单最优挂单价格
  "A":"40.66000000"  // 卖单最优挂单数量
}

实时推送指定交易对最优挂单信息

多个 <symbol>@bookTicker 可以订阅在一个WebSocket连接上.

Stream 名称: <symbol>@bookTicker

更新速度: 1ms

平均价格

Payload:

{
  "e": "avgPrice",          // Event type
  "E": 1693907033000,       // Event time
  "s": "BTCUSDT",           // Symbol
  "i": "5m",                // Average price interval
  "w": "25776.86000000",    // Average price
  "T": 1693907032213        // Last trade time
}

平均价格流推送在固定时间间隔内的平均价格变动。

Stream 名称: <symbol>@avgPrice

更新速度: 1000ms

有限档深度信息

Payload:

{
  "lastUpdateId": 160,  // Last update ID
  "bids": [             // Bids to be updated
    [
      "0.0024",         // Price level to be updated
      "10"              // Quantity
    ]
  ],
  "asks": [             // Asks to be updated
    [
      "0.0026",         // Price level to be updated
      "100"             // Quantity
    ]
  ]
}

每秒或每100毫秒推送有限档深度信息。levels表示几档买卖单信息, 可选 5/10/20档

Stream 名称: <symbol>@depth<levels><symbol>@depth<levels>@100ms.

更新速度: 1000ms 或 100ms

增量深度信息

Payload:

{
  "e": "depthUpdate", // 事件类型
  "E": 1672515782136,     // 事件时间
  "s": "BNBBTC",      // 交易对
  "U": 157,           // 从上次推送至今新增的第一个 update Id
  "u": 160,           // 从上次推送至今新增的最后一个 update Id
  "b": [              // 变动的买单深度
    [
      "0.0024",       // 变动的价格档位
      "10"            // 数量
    ]
  ],
  "a": [              // 变动的卖单深度
    [
      "0.0026",       // 变动的价格档位
      "100"           // 数量
    ]
  ]
}

每秒或每100毫秒推送orderbook的变化部分(如果有)

Stream 名称: <symbol>@depth<symbol>@depth@100ms

更新速度: 1000ms 或 100ms

按Symbol的滚动窗口统计

Payload:

{
  "e": "1hTicker",    // Event type
  "E": 1672515782136,     // Event time
  "s": "BNBBTC",      // Symbol
  "p": "0.0015",      // Price change
  "P": "250.00",      // Price change percent
  "o": "0.0010",      // Open price
  "h": "0.0025",      // High price
  "l": "0.0010",      // Low price
  "c": "0.0025",      // Last price
  "w": "0.0018",      // Weighted average price
  "v": "10000",       // Total traded base asset volume
  "q": "18",          // Total traded quote asset volume
  "O": 0,             // Statistics open time
  "C": 86400000,      // Statistics close time
  "F": 0,             // First trade ID
  "L": 18150,         // Last trade Id
  "n": 18151          // Total number of trades
}

单个symbol的滚动窗口统计, 支持多个时间窗口。

Stream 名称: <symbol>@ticker_<window_size>

Window Sizes: 1h, 4h,1d

更新速度: 1000ms

注意:

- 该数据流和 <symbol>@ticker 不一样。 - O (open time) 会在每分钟整点开始, 而 C (closing time)是当前更新时间。 - 实际统计的时间范围会比<window_size>多不超过59999ms。

全市场滚动窗口统计

Payload:

[
  {
    // 同 <symbol>@ticker_<window-size> payload,
    // 间隔内更新的每个symbol。
  }
]

全市场symbols的滚动窗口ticker统计,计算于多个窗口。

注意:有变动的ticker才会推送。

Stream 名称: !ticker_<window-size>@arr

Window Size: 1h, 4h,1d

更新速度: 1000ms

如何正确在本地维护一个orderbook副本

  1. 订阅 wss://stream.binance.com:9443/ws/bnbbtc@depth
  2. 开始缓存收到的更新。同一个价位,后收到的更新覆盖前面的。
  3. 访问Rest接口 https://api.binance.com/api/v3/depth?symbol=BNBBTC&limit=1000 获得一个1000档的深度快照
  4. 将目前缓存到的信息中u <= 步骤3中获取到的快照中的lastUpdateId的部分丢弃(丢弃更早的信息,已经过期)。
  5. 将深度快照中的内容更新到本地orderbook副本中,并从websocket接收到的第一个U <= lastUpdateId+1 u >= lastUpdateId+1 的event开始继续更新本地副本。
  6. 每一个新event的U应该恰好等于上一个event的u+1,否则可能出现了丢包,请从step3重新进行初始化。
  7. 每一个event中的挂单量代表这个价格目前的挂单量绝对值,而不是相对变化。
  8. 如果某个价格对应的挂单量为0,表示该价位的挂单已经撤单或者被吃,应该移除这个价位。

注意: 因为深度快照对价格档位数量有限制,初始快照之外的价格档位并且没有数量变化的价格档位不会出现在增量深度的更新信息内。因此,即使应用来自增量深度的所有更新,这些价格档位也不会在本地 order book 中可见,所以本地的 order book 与真实的 order book 可能会有一些差异。 不过对于大多数用例,5000 的深度限制足以有效地了解市场和交易。

现货交易接口

测试下单 (TRADE)

响应

{}

或者

{
  "standardCommissionForOrder": {  // 订单交易的标准佣金率
    "maker": "0.00000112",
    "taker": "0.00000114",
  },
  "taxCommissionForOrder": {       // 订单交易的税率
    "maker": "0.00000112",
    "taker": "0.00000114",
  },
  "discount": {                    // 以BNB支付时的标准佣金折扣。
    "enabledForAccount": true,
    "enabledForSymbol": true,
    "discountAsset": "BNB",
    "discount": "0.25000000"       // 当用BNB支付佣金时,在标准佣金上按此比率打折
  }
}

POST /api/v3/order/test

用于测试订单请求,但不会提交到撮合引擎

权重:

条件 请求权重
没有 computeCommissionRates 1
computeCommissionRates 20

参数:

除了 POST /api/v3/order 所有参数, 下面参数也支持:

参数名 类型 是否必需 描述
computeCommissionRates BOOLEAN NO 默认值: false

数据源: 缓存

下单 (TRADE)

Response ACK:

{
  "symbol": "BTCUSDT",
  "orderId": 28,
  "orderListId": -1, // 订单列表ID,否则为 -1
  "clientOrderId": "6gCrw2kRUAF9CvJDGP16IP",
  "transactTime": 1507725176595
}

Response RESULT:

{
  "symbol": "BTCUSDT",
  "orderId": 28,
  "orderListId": -1, // 订单列表ID,否则为 -1
  "clientOrderId": "6gCrw2kRUAF9CvJDGP16IP",
  "transactTime": 1507725176595,
  "price": "0.00000000",
  "origQty": "10.00000000",
  "executedQty": "10.00000000",
  "cummulativeQuoteQty": "10.00000000",
  "status": "FILLED",
  "timeInForce": "GTC",
  "type": "MARKET",
  "side": "SELL",
  "workingTime": 1507725176595,
  "selfTradePreventionMode": "NONE"
}

Response FULL:

{
  "symbol": "BTCUSDT", // 交易对
  "orderId": 28, // 系统的订单ID
  "orderListId": -1, // 订单列表ID,否则为 -1
  "clientOrderId": "6gCrw2kRUAF9CvJDGP16IP", // 客户自己设置的ID
  "transactTime": 1507725176595, // 交易的时间戳
  "price": "0.00000000", // 订单价格
  "origQty": "10.00000000", // 用户设置的原始订单数量
  "executedQty": "10.00000000", // 交易的订单数量
  "cummulativeQuoteQty": "10.00000000", // 累计交易的金额
  "status": "FILLED", // 订单状态
  "timeInForce": "GTC", // 订单的时效方式
  "type": "MARKET", // 订单类型, 比如市价单,现价单等
  "side": "SELL", // 订单方向,买还是卖
  "workingTime": 1507725176595,  // 订单添加到 order book 的时间
  "selfTradePreventionMode": "NONE", // 自我交易预防模式
  "fills": [ // 订单中交易的信息
    {
      "price": "4000.00000000", // 交易的价格
      "qty": "1.00000000", // 交易的数量
      "commission": "4.00000000", // 手续费金额
      "commissionAsset": "USDT", // 手续费的币种
      "tradeId": 56 // 交易ID
    },
    {
      "price": "3999.00000000",
      "qty": "5.00000000",
      "commission": "19.99500000",
      "commissionAsset": "USDT",
      "tradeId": 57
    },
    {
      "price": "3998.00000000",
      "qty": "2.00000000",
      "commission": "7.99600000",
      "commissionAsset": "USDT",
      "tradeId": 58
    },
    {
      "price": "3997.00000000",
      "qty": "1.00000000",
      "commission": "3.99700000",
      "commissionAsset": "USDT",
      "tradeId": 59
    },
    {
      "price": "3995.00000000",
      "qty": "1.00000000",
      "commission": "3.99500000",
      "commissionAsset": "USDT",
      "tradeId": 60
    }
  ]
}

POST /api/v3/order

发送下单。

权重(UID): 1 权重(IP): 1

参数:

名称 类型 是否必需 描述
symbol STRING YES
side ENUM YES 详见枚举定义:订单方向
type ENUM YES 详见枚举定义:订单类型
timeInForce ENUM NO 详见枚举定义:有效方式
quantity DECIMAL NO
quoteOrderQty DECIMAL NO
price DECIMAL NO
newClientOrderId STRING NO 客户自定义的唯一订单ID。 如果未发送,则自动生成。
stopPrice DECIMAL NO STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFITTAKE_PROFIT_LIMIT 需要此参数。
trailingDelta LONG NO 用于 STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFITTAKE_PROFIT_LIMIT 类型的订单。更多追踪止盈止损订单细节, 请参考 追踪止盈止损(Trailing Stop)订单常见问题
icebergQty DECIMAL NO 仅使用 LIMIT, STOP_LOSS_LIMIT, 和 TAKE_PROFIT_LIMIT 创建新的 iceberg 订单时需要此参数。
newOrderRespType ENUM NO 设置响应JSONACKRESULTFULLMARKETLIMIT 订单类型默认为 FULL,所有其他订单默认为 ACK
selfTradePreventionMode ENUM NO 允许的 ENUM 取决于交易对的配置。支持的值有 EXPIRE_TAKEREXPIRE_MAKEREXPIRE_BOTHNONE
strategyId INT NO
strategyType INT NO 不能低于 1000000
recvWindow LONG NO 赋值不能大于 60000
timestamp LONG YES

基于订单 type不同,强制要求某些参数:

类型 强制要求的参数
LIMIT timeInForce, quantity, price
MARKET quantity 或者 quoteOrderQty
STOP_LOSS quantity, stopPrice 或者 trailingDelta
STOP_LOSS_LIMIT timeInForce, quantity, price, stopPrice 或者 trailingDelta
TAKE_PROFIT quantity, stopPrice 或者 trailingDelta
TAKE_PROFIT_LIMIT timeInForce, quantity, price, stopPrice 或者 trailingDelta
LIMIT_MAKER quantity, price

其他信息:

MARKET版本和LIMIT版本针对市场价格触发订单价格规则:

关于 newOrderRespType 的三种选择

订单响应中的特定条件时才会出现的字段

订单响应中的有一些字段仅在满足特定条件时才会出现。这些订单响应可以来自下订单,查询订单或取消订单,并且可以包括订单列表类型。 下面列出了这些字段:

名称 描述 显示的条件 示例
icebergQty 冰山订单的数量。 只有在请求中发送 icebergQty 参数时才会出现。 "icebergQty": "0.00000000"
preventedMatchId symbol 结合使用时,可用于查询因为 STP 导致订单失效的过期订单。 只有在因为 STP 导致订单失效时可见。 "preventedMatchId": 0
preventedQuantity 因为 STP 导致订单失效的数量。 只有在因为 STP 导致订单失效时可见。 "preventedQuantity": "1.200000"
stopPrice 用于设置逻辑订单中的触发价。 STOP_LOSSTAKE_PROFITSTOP_LOSS_LIMITTAKE_PROFIT_LIMIT 订单时可见。 "stopPrice": "23500.00000000"
strategyId 策略单ID; 用以关联此订单对应的交易策略。 如果在请求中添加了参数,则会出现。 "strategyId": 37463720
strategyType 策略单类型; 用以显示此订单对应的交易策略。 如果在请求中添加了参数,则会出现。 "strategyType": 1000000
trailingDelta 用以定义追踪止盈止损订单被触发的价格差。 出现在追踪止损订单中。 "trailingDelta": 10
trailingTime 追踪单被激活和跟踪价格变化的时间。 出现在追踪止损订单中。 "trailingTime": -1

撤销订单 (TRADE)

响应

{
  "symbol": "LTCBTC",
  "origClientOrderId": "myOrder1",
  "orderId": 4,
  "orderListId": -1, // 订单列表ID,否则为 -1
  "clientOrderId": "cancelMyOrder1",
  "transactTime": 1684804350068,
  "price": "2.00000000",
  "origQty": "1.00000000",
  "executedQty": "0.00000000",
  "cummulativeQuoteQty": "0.00000000",
  "status": "CANCELED",
  "timeInForce": "GTC",
  "type": "LIMIT",
  "side": "BUY",
  "selfTradePreventionMode": "NONE"
}

DELETE /api/v3/order

取消有效订单。

权重(IP): 1

参数:

名称 类型 是否必需 描述
symbol STRING YES
orderId LONG NO
origClientOrderId STRING NO
newClientOrderId STRING NO 用户自定义的本次撤销操作的ID(注意不是被撤销的订单的自定义ID)。如无指定会自动赋值。
cancelRestrictions ENUM NO 支持的值:
ONLY_NEW - 如果订单状态为 NEW,订单取消将成功。
ONLY_PARTIALLY_FILLED - 如果订单状态为 PARTIALLY_FILLED,订单取消将成功。
recvWindow LONG NO 赋值不得大于 60000
timestamp LONG YES

orderIdorigClientOrderId 必须至少发送一个

数据源: 撮合引擎

关于 cancelRestrictions

注意: 响应示例没有显示所有可以出现的字段,更多请看 "订单响应中的特定条件时才会出现的字段" 部分。

撤销单一交易对的所有挂单 (TRADE)

响应

[
  {
    "symbol": "BTCUSDT",
    "origClientOrderId": "E6APeyTJvkMvLMYMqu1KQ4",
    "orderId": 11,
    "orderListId": -1,
    "clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx",
    "transactTime": 1684804350068,
    "price": "0.089853",
    "origQty": "0.178622",
    "executedQty": "0.000000",
    "cummulativeQuoteQty": "0.000000",
    "status": "CANCELED",
    "timeInForce": "GTC",
    "type": "LIMIT",
    "side": "BUY",
    "selfTradePreventionMode": "NONE"
  },
  {
    "symbol": "BTCUSDT",
    "origClientOrderId": "A3EF2HCwxgZPFMrfwbgrhv",
    "orderId": 13,
    "orderListId": -1,
    "clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx",
    "transactTime": 1684804350068,
    "price": "0.090430",
    "origQty": "0.178622",
    "executedQty": "0.000000",
    "cummulativeQuoteQty": "0.000000",
    "status": "CANCELED",
    "timeInForce": "GTC",
    "type": "LIMIT",
    "side": "BUY",
    "selfTradePreventionMode": "NONE"
  },
  {
    "orderListId": 1929,
    "contingencyType": "OCO",
    "listStatusType": "ALL_DONE",
    "listOrderStatus": "ALL_DONE",
    "listClientOrderId": "2inzWQdDvZLHbbAmAozX2N",
    "transactionTime": 1585230948299,
    "symbol": "BTCUSDT",
    "orders": [
      {
        "symbol": "BTCUSDT",
        "orderId": 20,
        "clientOrderId": "CwOOIPHSmYywx6jZX77TdL"
      },
      {
        "symbol": "BTCUSDT",
        "orderId": 21,
        "clientOrderId": "461cPg51vQjV3zIMOXNz39"
      }
    ],
    "orderReports": [
      {
        "symbol": "BTCUSDT",
        "origClientOrderId": "CwOOIPHSmYywx6jZX77TdL",
        "orderId": 20,
        "orderListId": 1929,
        "clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx",
        "transactTime": 1684804350068,
        "price": "0.668611",
        "origQty": "0.690354",
        "executedQty": "0.000000",
        "cummulativeQuoteQty": "0.000000",
        "status": "CANCELED",
        "timeInForce": "GTC",
        "type": "STOP_LOSS_LIMIT",
        "side": "BUY",
        "stopPrice": "0.378131",
        "icebergQty": "0.017083",
        "selfTradePreventionMode": "NONE"
      },
      {
        "symbol": "BTCUSDT",
        "origClientOrderId": "461cPg51vQjV3zIMOXNz39",
        "orderId": 21,
        "orderListId": 1929,
        "clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx",
        "transactTime": 1684804350068,
        "price": "0.008791",
        "origQty": "0.690354",
        "executedQty": "0.000000",
        "cummulativeQuoteQty": "0.000000",
        "status": "CANCELED",
        "timeInForce": "GTC",
        "type": "LIMIT_MAKER",
        "side": "BUY",
        "icebergQty": "0.639962",
        "selfTradePreventionMode": "NONE"
      }
    ]
  }
]

DELETE /api/v3/openOrders

撤销单一交易对下所有挂单, 包括订单列表的挂单。

权重(IP): 1

参数:

名称 类型 是否必需 描述
symbol STRING YES
recvWindow LONG NO 不能大于 60000
timestamp LONG YES

数据源: 撮合引擎

注意: 响应示例没有显示所有可以出现的字段,更多请看 "订单响应中的特定条件时才会出现的字段" 部分。

撤消挂单再下单 (TRADE)

响应:没有超出下单速率限制时的 Response SUCCESS

// 撤单和下单都成功
{
  "cancelResult": "SUCCESS",
  "newOrderResult": "SUCCESS",
  "cancelResponse": {
    "symbol": "BTCUSDT",
    "origClientOrderId": "DnLo3vTAQcjha43lAZhZ0y",
    "orderId": 9,
    "orderListId": -1,
    "clientOrderId": "osxN3JXAtJvKvCqGeMWMVR",
    "transactTime": 1684804350068,
    "price": "0.01000000",
    "origQty": "0.000100",
    "executedQty": "0.00000000",
    "cummulativeQuoteQty": "0.00000000",
    "status": "CANCELED",
    "timeInForce": "GTC",
    "type": "LIMIT",
    "side": "SELL",
    "selfTradePreventionMode": "NONE"
  },
  "newOrderResponse": {
    "symbol": "BTCUSDT",
    "orderId": 10,
    "orderListId": -1,
    "clientOrderId": "wOceeeOzNORyLiQfw7jd8S",
    "transactTime": 1652928801803,
    "price": "0.02000000",
    "origQty": "0.040000",
    "executedQty": "0.00000000",
    "cummulativeQuoteQty": "0.00000000",
    "status": "NEW",
    "timeInForce": "GTC",
    "type": "LIMIT",
    "side": "BUY",
    "workingTime": 1669277163808,
    "fills": [],
    "selfTradePreventionMode": "NONE"
  }
}

响应:选择了 STOP_ON_FAILURE 而且账户没有超出下单速率限制时, 撤单出现错误

{
  "code": -2022,
  "msg": "Order cancel-replace failed.",
  "data": {
    "cancelResult": "FAILURE",
    "newOrderResult": "NOT_ATTEMPTED",
    "cancelResponse": {
      "code": -2011,
      "msg": "Unknown order sent."
    },
    "newOrderResponse": null
  }
}

响应:撤单成功而且账户没有超出下单速率限制时,下单失败

{
  "code": -2021,
  "msg": "Order cancel-replace partially failed.",
  "data": {
    "cancelResult": "SUCCESS",
    "newOrderResult": "FAILURE",
    "cancelResponse": {
      "symbol": "BTCUSDT",
      "origClientOrderId": "86M8erehfExV8z2RC8Zo8k",
      "orderId": 3,
      "orderListId": -1,
      "clientOrderId": "G1kLo6aDv2KGNTFcjfTSFq",
      "transactTime": 1684804350068,
      "price": "0.006123",
      "origQty": "10000.000000",
      "executedQty": "0.000000",
      "cummulativeQuoteQty": "0.000000",
      "status": "CANCELED",
      "timeInForce": "GTC",
      "type": "LIMIT_MAKER",
      "side": "SELL",
      "selfTradePreventionMode": "NONE"
    },
    "newOrderResponse": {
      "code": -2010,
      "msg": "Order would immediately match and take."
    }
  }
}

响应:选择 ALLOW_FAILURE 而且账户没有超出下单速率限制时, 撤单出现错误

{
  "code": -2021,
  "msg": "Order cancel-replace partially failed.",
  "data": {
    "cancelResult": "FAILURE",
    "newOrderResult": "SUCCESS",
    "cancelResponse": {
      "code": -2011,
      "msg": "Unknown order sent."
    },
    "newOrderResponse": {
      "symbol": "BTCUSDT",
      "orderId": 11,
      "orderListId": -1,
      "clientOrderId": "pfojJMg6IMNDKuJqDxvoxN",
      "transactTime": 1648540168818
    }
  }
}

响应:选择 cancelReplaceMode=ALLOW_FAILURE 而且账户没有超出下单速率限制时, 撤单和下单失败

{
  "code": -2022,
  "msg": "Order cancel-replace failed.",
  "data": {
    "cancelResult": "FAILURE",
    "newOrderResult": "FAILURE",
    "cancelResponse": {
      "code": -2011,
      "msg": "Unknown order sent."
    },
    "newOrderResponse": {
      "code": -2010,
      "msg": "Order would immediately match and take."
    }
  }
}

响应:选择 orderRateLimitExceededMode=DO_NOTHING 而且账户超出下单速率限制时

{
  "code": -1015,
  "msg": "Too many new orders; current limit is 1 orders per 10 SECOND." 
}

响应:选择 orderRateLimitExceededMode=CANCEL_ONLY 而且账户超出下单速率限制时

{
  "code": -2021,
  "msg": "Order cancel-replace partially failed.",
  "data": {
    "cancelResult": "SUCCESS",
    "newOrderResult": "FAILURE",
    "cancelResponse": {
      "symbol": "LTCBNB",
      "origClientOrderId": "GKt5zzfOxRDSQLveDYCTkc",
      "orderId": 64,
      "orderListId": -1,
      "clientOrderId": "loehOJF3FjoreUBDmv739R",
      "transactTime": 1715779007228,
      "price": "1.00",
      "origQty": "10.00000000",
      "executedQty": "0.00000000",
      "cummulativeQuoteQty": "0.00",
      "status": "CANCELED",
      "timeInForce": "GTC",
      "type": "LIMIT",
      "side": "SELL",
      "selfTradePreventionMode": "NONE" 
    },
    "newOrderResponse": {
      "code": -1015,
      "msg": "Too many new orders; current limit is 1 orders per 10 SECOND." 
    }
  }
}

POST /api/v3/order/cancelReplace

撤消挂单并在同个交易对上重新下单。

在撤消订单和下单前会判断: 1) 过滤器参数, 以及 2) 目前下单数量。

即使请求中没有尝试发送新订单,比如(newOrderResult: NOT_ATTEMPTED),下单的数量仍然会加1。

Weight(IP): 1

Parameters:

名称 类型 是否必需 描述
symbol STRING YES
side ENUM YES
type ENUM YES
cancelReplaceMode ENUM YES 指定类型:STOP_ON_FAILURE - 如果撤消订单失败将不会继续重新下单。

ALLOW_FAILURE - 不管撤消订单是否成功都会继续重新下单。
timeInForce ENUM NO
quantity DECIMAL NO
quoteOrderQty DECIMAL NO
price DECIMAL NO
cancelNewClientOrderId STRING NO 用户自定义的id,如空缺系统会自动赋值
cancelOrigClientOrderId STRING NO 必须提供cancelOrigClientOrderId 或者 cancelOrderId。 如果两个参数都提供, cancelOrderId 会占优先。
cancelOrderId LONG NO 必须提供cancelOrigClientOrderId 或者 cancelOrderId。 如果两个参数都提供, cancelOrderId 会占优先。
newClientOrderId STRING NO 用于辨识新订单。
strategyId INT NO
strategyType INT NO 不能低于 1000000
stopPrice DECIMAL NO
trailingDelta LONG NO
icebergQty DECIMAL NO
newOrderRespType ENUM NO 指定响应类型:

指定响应类型 ACK, RESULT, 或者 FULL; MARKETLIMIT 订单默认为FULL, 其他默认为ACK.
selfTradePreventionMode ENUM NO 允许的 ENUM 取决于交易对的配置。支持的值有 EXPIRE_TAKEREXPIRE_MAKEREXPIRE_BOTHNONE
cancelRestrictions ENUM NO 支持的值:
ONLY_NEW - 如果订单状态为 NEW,撤销将成功。
ONLY_PARTIALLY_FILLED - 如果订单状态为 PARTIALLY_FILLED,撤销将成功。
orderRateLimitExceededMode ENUM NO 支持的值:
DO_NOTHING (默认值)- 仅在账户未超过未成交订单频率限制时,会尝试取消订单。
CANCEL_ONLY - 将始终取消订单。
recvWindow LONG NO 不能大于 60000
timestamp LONG YES

如同 POST /api/v3/order,额外的强制参数取决于 type

响应格式根据消息的处理是成功、部分成功还是失败而有所不同。

数据来源: 撮合引擎

请求 响应
cancelReplaceMode orderRateLimitExceededMode 下单数 cancelResult newOrderResult status
STOP_ON_FAILURE DO_NOTHING 在限制范围内 SUCCESS SUCCESS 200
FAILURE NOT_ATTEMPTED 400
SUCCESS FAILURE 409
超出限制范围 SUCCESS SUCCESS N/A
FAILURE NOT_ATTEMPTED N/A
SUCCESS FAILURE N/A
CANCEL_ONLY 在限制范围内 SUCCESS SUCCESS 200
FAILURE NOT_ATTEMPTED 400
SUCCESS FAILURE 409
超出限制范围 FAILURE NOT_ATTEMPTED 429
SUCCESS FAILURE 429
ALLOW_FAILURE DO_NOTHING 在限制范围内 SUCCESS SUCCESS 200
FAILURE FAILURE 400
FAILURE SUCCESS 409
SUCCESS FAILURE 409
超出限制范围 SUCCESS SUCCESS N/A
FAILURE FAILURE N/A
FAILURE SUCCESS N/A
SUCCESS FAILURE N/A
CANCEL_ONLY 在限制范围内 SUCCESS SUCCESS 200
FAILURE FAILURE 400
FAILURE SUCCESS 409
SUCCESS FAILURE 409
超出限制范围 SUCCESS SUCCESS 200
FAILURE FAILURE 400
FAILURE SUCCESS N/A
SUCCESS FAILURE 409

注意: 响应示例没有显示所有可以出现的字段,更多请看 "订单响应中的特定条件时才会出现的字段" 部分。

查询订单 (USER_DATA)

响应

{
  "symbol": "LTCBTC", // 交易对
  "orderId": 1, // 系统的订单ID
  "orderListId": -1, // 订单列表的ID,不然就是-1
  "clientOrderId": "myOrder1", // 客户自己设置的ID
  "price": "0.1", // 订单价格
  "origQty": "1.0", // 用户设置的原始订单数量
  "executedQty": "0.0", // 交易的订单数量
  "cummulativeQuoteQty": "0.0", // 累计交易的金额
  "status": "NEW", // 订单状态
  "timeInForce": "GTC", // 订单的时效方式
  "type": "LIMIT", // 订单类型, 比如市价单,现价单等
  "side": "BUY", // 订单方向,买还是卖
  "stopPrice": "0.0", // 止损价格
  "icebergQty": "0.0", // 冰山数量
  "time": 1499827319559, // 订单时间
  "updateTime": 1499827319559, // 最后更新时间
  "isWorking": true, // 订单是否出现在orderbook中
  "workingTime":1499827319559,
  "origQuoteOrderQty": "0.000000", // 原始的交易金额
  "selfTradePreventionMode": "NONE"
}

GET /api/v3/order

查询订单状态。

权重(IP): 4

参数:

名称 类型 是否必需 描述
symbol STRING YES
orderId LONG NO
origClientOrderId STRING NO
recvWindow LONG NO 赋值不得大于 60000
timestamp LONG YES

注意:

数据源: 数据库

当前挂单 (USER_DATA)

响应

[
  {
    "symbol": "LTCBTC",
    "orderId": 1,
    "orderListId": -1, // 订单列表ID,否则为 -1
    "clientOrderId": "myOrder1",
    "price": "0.1",
    "origQty": "1.0",
    "executedQty": "0.0",
    "cummulativeQuoteQty": "0.0",
    "status": "NEW",
    "timeInForce": "GTC",
    "type": "LIMIT",
    "side": "BUY",
    "stopPrice": "0.0",
    "icebergQty": "0.0",
    "time": 1499827319559,
    "updateTime": 1499827319559,
    "isWorking": true,
    "workingTime": 1499827319559,
    "origQuoteOrderQty": "0.000000",
    "selfTradePreventionMode": "NONE"
  }
]

GET /api/v3/openOrders

获取交易对的所有当前挂单, 请小心使用不带交易对参数的调用。

权重(IP): 6 单一交易对;
80 交易对参数缺失;

参数:

名称 类型 是否必需 描述
symbol STRING NO
recvWindow LONG NO 赋值不得大于 60000
timestamp LONG YES

数据源: 数据库

注意: 响应示例没有显示所有可以出现的字段,更多请看 "订单响应中的特定条件时才会出现的字段" 部分。

查询所有订单 (USER_DATA)

响应

[
  {
    "symbol": "LTCBTC",
    "orderId": 1,
    "orderListId": -1, // 订单列表ID,否则为 -1
    "clientOrderId": "myOrder1",
    "price": "0.1",
    "origQty": "1.0",
    "executedQty": "0.0",
    "cummulativeQuoteQty": "0.0",
    "status": "NEW",
    "timeInForce": "GTC",
    "type": "LIMIT",
    "side": "BUY",
    "stopPrice": "0.0",
    "icebergQty": "0.0",
    "time": 1499827319559,
    "updateTime": 1499827319559,
    "isWorking": true,
    "origQuoteOrderQty": "0.000000",
    "workingTime": 1499827319559,
    "selfTradePreventionMode": "NONE"
  }
]

GET /api/v3/allOrders

获取所有帐户订单; 有效,已取消或已完成。

权重(IP): 20

参数:

名称 类型 是否必需 描述
symbol STRING YES
orderId LONG NO
startTime LONG NO
endTime LONG NO
limit INT NO 默认 500; 最大 1000.
recvWindow LONG NO 赋值不得大于 60000
timestamp LONG YES

注意:

数据源: 数据库

OCO下单 - 已弃用 (TRADE)

响应

{
  "orderListId": 0,
  "contingencyType": "OCO",
  "listStatusType": "EXEC_STARTED",
  "listOrderStatus": "EXECUTING",
  "listClientOrderId": "JYVpp3F0f5CAG15DhtrqLp",
  "transactionTime": 1563417480525,
  "symbol": "LTCBTC",
  "orders": [
    {
      "symbol": "LTCBTC",
      "orderId": 2,
      "clientOrderId": "Kk7sqHb9J6mJWTMDVW7Vos"
    },
    {
      "symbol": "LTCBTC",
      "orderId": 3,
      "clientOrderId": "xTXKaGYd4bluPVp78IVRvl"
    }
  ],
  "orderReports": [
    {
      "symbol": "LTCBTC",
      "orderId": 2,
      "orderListId": 0,
      "clientOrderId": "Kk7sqHb9J6mJWTMDVW7Vos",
      "transactTime": 1563417480525,
      "price": "0.000000",
      "origQty": "0.624363",
      "executedQty": "0.000000",
      "cummulativeQuoteQty": "0.000000",
      "status": "NEW",
      "timeInForce": "GTC",
      "type": "STOP_LOSS",
      "side": "BUY",
      "stopPrice": "0.960664",
      "workingTime": -1,
      "selfTradePreventionMode": "NONE"
    },
    {
      "symbol": "LTCBTC",
      "orderId": 3,
      "orderListId": 0,
      "clientOrderId": "xTXKaGYd4bluPVp78IVRvl",
      "transactTime": 1563417480525,
      "price": "0.036435",
      "origQty": "0.624363",
      "executedQty": "0.000000",
      "cummulativeQuoteQty": "0.000000",
      "status": "NEW",
      "timeInForce": "GTC",
      "type": "LIMIT_MAKER",
      "side": "BUY",
      "stopPrice": "0.960664",
      "workingTime": -1,
      "selfTradePreventionMode": "NONE"
    }
  ]
}

POST /api/v3/order/oco

发送新 OCO 订单。

权重(UID): 2 权重(IP): 1

参数:

名称 类型 是否必需 描述
symbol STRING YES
listClientOrderId STRING NO 整个orderList的唯一ID
side ENUM YES 详见枚举定义:订单方向
quantity DECIMAL YES
limitClientOrderId STRING NO 限价单的唯一ID
limitStrategyId INT NO
limitStrategyType INT NO 不能低于 1000000
price DECIMAL YES
limitIcebergQty DECIMAL NO
trailingDelta LONG NO
stopClientOrderId STRING NO 止损/止损限价单的唯一ID
stopPrice DECIMAL YES
stopStrategyId INT NO
stopStrategyType INT NO 不能低于 1000000
stopLimitPrice DECIMAL NO 如果提供,须配合提交stopLimitTimeInForce
stopIcebergQty DECIMAL NO
stopLimitTimeInForce ENUM NO 有效值 GTC/FOK/IOC
newOrderRespType ENUM NO 详见枚举定义:订单返回类型
selfTradePreventionMode ENUM NO 允许的 ENUM 取决于交易对的配置。支持的值有 EXPIRE_TAKEREXPIRE_MAKEREXPIRE_BOTHNONE。|
recvWindow LONG NO 不能大于 60000
timestamp LONG YES

其他信息:

数据源: 撮合引擎

发送新 OCO 订单 (TRADE)

适用 newOrderRespType RESULT 的响应:

{
    "orderListId": 1,
    "contingencyType": "OCO",
    "listStatusType": "EXEC_STARTED",
    "listOrderStatus": "EXECUTING",
    "listClientOrderId": "lH1YDkuQKWiXVXHPSKYEIp",
    "transactionTime": 1710485608839,
    "symbol": "LTCBTC",
    "orders": [
        {
            "symbol": "LTCBTC",
            "orderId": 10,
            "clientOrderId": "44nZvqpemY7sVYgPYbvPih"
        },
        {
            "symbol": "LTCBTC",
            "orderId": 11,
            "clientOrderId": "NuMp0nVYnciDiFmVqfpBqK"
        }
    ],
    "orderReports": [
        {
            "symbol": "LTCBTC",
            "orderId": 10,
            "orderListId": 1,
            "clientOrderId": "44nZvqpemY7sVYgPYbvPih",
            "transactTime": 1710485608839,
            "price": "1.00000000",
            "origQty": "5.00000000",
            "executedQty": "0.00000000",
            "cummulativeQuoteQty": "0.00000000",
            "status": "NEW",
            "timeInForce": "GTC",
            "type": "STOP_LOSS_LIMIT",
            "side": "SELL",
            "stopPrice": "1.00000000",
            "workingTime": -1,
            "icebergQty": "1.00000000",
            "selfTradePreventionMode": "NONE"
        },
        {
            "symbol": "LTCBTC",
            "orderId": 11,
            "orderListId": 1,
            "clientOrderId": "NuMp0nVYnciDiFmVqfpBqK",
            "transactTime": 1710485608839,
            "price": "3.00000000",
            "origQty": "5.00000000",
            "executedQty": "0.00000000",
            "cummulativeQuoteQty": "0.00000000",
            "status": "NEW",
            "timeInForce": "GTC",
            "type": "LIMIT_MAKER",
            "side": "SELL",
            "workingTime": 1710485608839,
            "selfTradePreventionMode": "NONE"
        }
    ]
}

POST /api/v3/orderList/oco

权重(IP): 1

发送新 one-cancels-the-other (OCO) 订单,激活其中一个订单会立即取消另一个订单。

参数:

名称 类型 是否必需 描述
symbol STRING Yes
listClientOrderId STRING No 整个 order list 的唯一ID。 如果未发送则自动生成。
仅当前一个订单已填满或完全过期时,才会接受具有相同的listClientOrderId
listClientOrderIdaboveClientOrderIdbelowCLientOrderId 不同。
side ENUM Yes 订单方向:BUY or SELL
quantity DECIMAL Yes 两个 legs 的数量。
aboveType ENUM Yes 支持值:STOP_LOSS_LIMIT, STOP_LOSS, LIMIT_MAKER
aboveClientOrderId STRING No 上方 leg 的唯一ID。 如果未发送则自动生成。
aboveIcebergQty LONG No 请注意,只有当 aboveTimeInForceGTC 时才能使用。
abovePrice DECIMAL No
aboveStopPrice DECIMAL No 如果 aboveTypeSTOP_LOSSSTOP_LOSS_LIMIT 才能使用。
必须指定 aboveStopPriceaboveTrailingDelta 或两者。
aboveTrailingDelta LONG No 请看 追踪止盈止损(Trailing Stop)订单常见问题
aboveTimeInForce DECIMAL No 如果 aboveTypeSTOP_LOSS_LIMIT,则为必填项。
aboveStrategyId INT No 订单策略中上方 leg 订单的 ID。
aboveStrategyType INT No 上方 leg 订单策略的任意数值。
小于 1000000 的值被保留,无法使用。
belowType ENUM Yes 支持值:STOP_LOSS_LIMIT, STOP_LOSS, LIMIT_MAKER
belowClientOrderId STRING No
belowIcebergQty LONG No 请注意,只有当 belowTimeInForceGTC 时才能使用。
belowPrice DECIMAL No
belowStopPrice DECIMAL No 如果 belowTypeSTOP_LOSSSTOP_LOSS_LIMIT 才能使用。
必须指定 belowStopPricebelowTrailingDelta 或两者。
belowTrailingDelta LONG No 请看 追踪止盈止损(Trailing Stop)订单常见问题
belowTimeInForce ENUM No 如果belowTypeSTOP_LOSS_LIMIT,则为必须配合提交的值。
belowStrategyId INT No 订单策略中下方 leg 订单的 ID。
belowStrategyType INT No 下方 leg 订单策略的任意数值。
小于 1000000 的值被保留,无法使用。
newOrderRespType ENUM No 响应格式可选值: ACK, RESULT, FULL。请参阅 POST /api/v3/order了解更多 orderReports 的响应类型。
selfTradePreventionMode ENUM No 允许的 ENUM 取决于交易对上的配置。 可能支持的值为 EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE
recvWindow LONG No 不能大于 60000
timestamp LONG Yes

数据源: 撮合引擎

发送新订单列表 - OTO订单 (TRADE)

响应

{
    "orderListId": 0,
    "contingencyType": "OTO",
    "listStatusType": "EXEC_STARTED",
    "listOrderStatus": "EXECUTING",
    "listClientOrderId": "yl2ERtcar1o25zcWtqVBTC",
    "transactionTime": 1712289389158,
    "symbol": "ABCDEF",
    "orders": [
        {
            "symbol": "LTCBTC",
            "orderId": 4,
            "clientOrderId": "Bq17mn9fP6vyCn75Jw1xya"
        },
        {
            "symbol": "LTCBTC",
            "orderId": 5,
            "clientOrderId": "arLFo0zGJVDE69cvGBaU0d"
        }
    ],
    "orderReports": [
        {
            "symbol": "LTCBTC",
            "orderId": 4,
            "orderListId": 0,
            "clientOrderId": "Bq17mn9fP6vyCn75Jw1xya",
            "transactTime": 1712289389158,
            "price": "1.00000000",
            "origQty": "1.00000000",
            "executedQty": "0.00000000",
            "cummulativeQuoteQty": "0.00000000",
            "status": "NEW",
            "timeInForce": "GTC",
            "type": "LIMIT",
            "side": "SELL",
            "workingTime": 1712289389158,
            "selfTradePreventionMode": "NONE"
        },
        {
            "symbol": "LTCBTC",
            "orderId": 5,
            "orderListId": 0,
            "clientOrderId": "arLFo0zGJVDE69cvGBaU0d",
            "transactTime": 1712289389158,
            "price": "0.00000000",
            "origQty": "5.00000000",
            "executedQty": "0.00000000",
            "cummulativeQuoteQty": "0.00000000",
            "status": "PENDING_NEW",
            "timeInForce": "GTC",
            "type": "MARKET",
            "side": "BUY",
            "workingTime": -1,
            "selfTradePreventionMode": "NONE"
        }
    ]
}
POST /api/v3/orderList/oto

发送一个新的 OTO 订单。

权重: 1

参数

名称 类型 是否必需 描述
symbol STRING YES
listClientOrderId STRING NO 整个订单列表的唯一ID。 如果未发送则自动生成。
仅当前一个订单列表已填满或完全过期时,才会接受含有相同 listClientOrderId 值的新订单列表。
listClientOrderIdworkingClientOrderIdpendingClientOrderId 不同。
newOrderRespType ENUM NO 用于设置JSON响应的格式。支持的数值: ACK, FULL, RESULT
selfTradePreventionMode ENUM NO 允许的数值取决于交易对上的配置。
workingType ENUM YES 支持的数值: LIMITLIMIT_MAKER
workingSide ENUM YES 支持的数值: BUYSELL
workingClientOrderId STRING NO 用于标识生效订单的唯一ID。
如果未发送则自动生成。
workingPrice DECIMAL YES
workingQuantity DECIMAL YES 用于设置生效订单的数量。
workingIcebergQty DECIMAL YES 只有当 workingTimeInForceGTC 时才能使用。
workingTimeInForce ENUM NO 支持的数值: FOKIOCGTC
workingStrategyId INT NO 订单策略中用于标识生效订单的 ID。
workingStrategyType INT NO 用于标识生效订单策略的任意数值。
小于 1000000 的值被保留,无法使用。
pendingType ENUM YES 系统不支持使用 quoteOrderQtyMARKET 订单。
pendingSide ENUM YES 支持的数值: BUYSELL
pendingClientOrderId STRING NO 用于标识待处理订单的唯一ID。
如果未发送则自动生成。
pendingPrice DECIMAL NO
pendingStopPrice DECIMAL NO
pendingTrailingDelta DECIMAL NO
pendingQuantity DECIMAL YES 用于设置待处理订单的数量。
pendingIcebergQty DECIMAL NO 只有当 pendingTimeInForceGTC 时才能使用。
pendingTimeInForce ENUM NO 支持的数值: FOKIOCGTC
pendingStrategyId INT NO 订单策略中用于标识待处理订单的 ID。
pendingStrategyType INT NO 用于标识待处理订单策略的任意数值。
小于 1000000 的值被保留,无法使用。
recvWindow LONG NO 不能大于 60000
timestamp LONG YES

根据 pendingType 或者workingType的不同值,对于某些参数的强制要求

根据 pendingType 或者workingType的不同值,对于某些可选参数有强制要求,具体如下:

类型 强制要求的参数 其他信息
workingType = LIMIT workingTimeInForce
pendingType = LIMIT pendingPricependingTimeInForce
pendingType = STOP_LOSSTAKE_PROFIT pendingStopPrice 与/或 pendingTrailingDelta
pendingType = STOP_LOSS_LIMITTAKE_PROFIT_LIMIT pendingPricependingStopPrice 与/或 pendingTrailingDeltapendingTimeInForce

数据源: 撮合引擎

发送新订单列表 - OTOCO订单 (TRADE)

响应

{
    "orderListId": 1,
    "contingencyType": "OTO",
    "listStatusType": "EXEC_STARTED",
    "listOrderStatus": "EXECUTING",
    "listClientOrderId": "RumwQpBaDctlUu5jyG5rs0",
    "transactionTime": 1712291372842,
    "symbol": "ABCDEF",
    "orders": [
        {
            "symbol": "LTCBTC",
            "orderId": 6,
            "clientOrderId": "fM9Y4m23IFJVCQmIrlUmMK"
        },
        {
            "symbol": "LTCBTC",
            "orderId": 7,
            "clientOrderId": "6pcQbFIzTXGZQ1e2MkGDq4"
        },
        {
            "symbol": "LTCBTC",
            "orderId": 8,
            "clientOrderId": "r4JMv9cwAYYUwwBZfbussx"
        }
    ],
    "orderReports": [
        {
            "symbol": "LTCBTC",
            "orderId": 6,
            "orderListId": 1,
            "clientOrderId": "fM9Y4m23IFJVCQmIrlUmMK",
            "transactTime": 1712291372842,
            "price": "1.00000000",
            "origQty": "1.00000000",
            "executedQty": "0.00000000",
            "cummulativeQuoteQty": "0.00000000",
            "status": "NEW",
            "timeInForce": "GTC",
            "type": "LIMIT",
            "side": "SELL",
            "workingTime": 1712291372842,
            "selfTradePreventionMode": "NONE"
        },
        {
            "symbol": "LTCBTC",
            "orderId": 7,
            "orderListId": 1,
            "clientOrderId": "6pcQbFIzTXGZQ1e2MkGDq4",
            "transactTime": 1712291372842,
            "price": "1.00000000",
            "origQty": "5.00000000",
            "executedQty": "0.00000000",
            "cummulativeQuoteQty": "0.00000000",
            "status": "PENDING_NEW",
            "timeInForce": "IOC",
            "type": "STOP_LOSS_LIMIT",
            "side": "BUY",
            "stopPrice": "6.00000000",
            "workingTime": -1,
            "selfTradePreventionMode": "NONE"
        },
        {
            "symbol": "LTCBTC",
            "orderId": 8,
            "orderListId": 1,
            "clientOrderId": "r4JMv9cwAYYUwwBZfbussx",
            "transactTime": 1712291372842,
            "price": "3.00000000",
            "origQty": "5.00000000",
            "executedQty": "0.00000000",
            "cummulativeQuoteQty": "0.00000000",
            "status": "PENDING_NEW",
            "timeInForce": "GTC",
            "type": "LIMIT_MAKER",
            "side": "BUY",
            "workingTime": -1,
            "selfTradePreventionMode": "NONE"
        }
    ]
}
POST /api/v3/orderList/otoco

发送一个新的 OTOCO 订单。

权重(IP): 1

参数:

名称 类型 是否必需 描述
symbol STRING YES
listClientOrderId STRING NO 整个订单列表的唯一ID。 如果未发送则自动生成。
仅当前一个订单列表已填满或完全过期时,才会接受含有相同 listClientOrderId 值的新订单列表。
listClientOrderIdworkingClientOrderIdpendingAboveClientOrderId 以及 pendingBelowClientOrderId 不同。
newOrderRespType ENUM NO 用于设置JSON响应的格式。支持的数值: ACK, FULL, RESULT
selfTradePreventionMode ENUM NO 允许的数值取决于交易对上的配置。
workingType ENUM YES 支持的数值: LIMITLIMIT_MAKER
workingSide ENUM YES 支持的数值: BUYSELL
workingClientOrderId STRING NO 用于标识生效订单的唯一ID。
如果未发送则自动生成。
workingPrice DECIMAL YES
workingQuantity DECIMAL YES
workingIcebergQty DECIMAL NO 只有当 workingTimeInForceGTC 时才能使用。
workingTimeInForce ENUM NO 支持的数值: FOKIOCGTC
workingStrategyId INT NO 订单策略中用于标识生效订单的 ID。
workingStrategyType INT NO 用于标识生效订单策略的任意数值。
小于 1000000 的值被保留,无法使用。
pendingSide ENUM YES 支持的数值: BUYSELL
pendingQuantity DECIMAL YES
pendingAboveType ENUM YES 支持的数值: LIMIT_MAKERSTOP_LOSSSTOP_LOSS_LIMIT
pendingAboveClientOrderId STRING NO 用于标识待处理上方订单的唯一ID。
如果未发送则自动生成。
pendingAbovePrice DECIMAL NO
pendingAboveStopPrice DECIMAL NO
pendingAboveTrailingDelta DECIMAL NO
pendingAboveIcebergQty DECIMAL NO 只有当 pendingAboveTimeInForceGTC 时才能使用。
pendingAboveTimeInForce ENUM NO
pendingAboveStrategyId INT NO 订单策略中用于标识待处理上方订单的 ID。
pendingAboveStrategyType INT NO 用于标识待处理上方订单策略的任意数值。
小于 1000000 的值被保留,无法使用。
pendingBelowType ENUM NO 支持的数值: LIMIT_MAKERSTOP_LOSSSTOP_LOSS_LIMIT
pendingBelowClientOrderId STRING NO 用于标识待处理下方订单的唯一ID。
如果未发送则自动生成。
pendingBelowPrice DECIMAL NO
pendingBelowStopPrice DECIMAL NO
pendingBelowTrailingDelta DECIMAL NO
pendingBelowIcebergQty DECIMAL NO 只有当 pendingBelowTimeInForceGTC 时才能使用。
pendingBelowTimeInForce ENUM NO
pendingBelowStrategyId INT NO 订单策略中用于标识待处理下方订单的 ID。
pendingBelowStrategyType INT NO 用于标识待处理下方订单策略的任意数值。
小于 1000000 的值被保留,无法使用。
recvWindow LONG NO 不能大于 60000
timestamp LONG YES

根据 pendingAboveTypependingBelowType 或者workingType的不同值,对于某些参数的强制要求

根据 pendingAboveTypependingBelowType 或者workingType的不同值,对于某些可选参数有强制要求,具体如下:

类型 强制要求的参数 其他信息
workingType = LIMIT workingTimeInForce
pendingAboveType= LIMIT_MAKER pendingAbovePrice
pendingAboveType= STOP_LOSS pendingAboveStopPrice 与/或 pendingAboveTrailingDelta
pendingAboveType=STOP_LOSS_LIMIT pendingAbovePricependingAboveStopPrice 与/或 pendingAboveTrailingDeltapendingAboveTimeInForce
pendingBelowType= LIMIT_MAKER pendingBelowPrice
pendingBelowType= STOP_LOSS pendingBelowStopPrice 与/或 pendingBelowTrailingDelta
pendingBelowType=STOP_LOSS_LIMIT pendingBelowPricependingBelowStopPrice 与/或 pendingBelowTrailingDeltapendingBelowTimeInForce

数据源: 撮合引擎

取消订单列表 (TRADE)

响应

{
  "orderListId": 0,
  "contingencyType": "OCO",
  "listStatusType": "ALL_DONE",
  "listOrderStatus": "ALL_DONE",
  "listClientOrderId": "C3wyj4WVEktd7u9aVBRXcN",
  "transactionTime": 1574040868128,
  "symbol": "LTCBTC",
  "orders": [
    {
      "symbol": "LTCBTC",
      "orderId": 2,
      "clientOrderId": "pO9ufTiFGg3nw2fOdgeOXa"
    },
    {
      "symbol": "LTCBTC",
      "orderId": 3,
      "clientOrderId": "TXOvglzXuaubXAaENpaRCB"
    }
  ],
  "orderReports": [
    {
      "symbol": "LTCBTC",
      "origClientOrderId": "pO9ufTiFGg3nw2fOdgeOXa",
      "orderId": 2,
      "orderListId": 0,
      "clientOrderId": "unfWT8ig8i0uj6lPuYLez6",
      "transactTime": 1688005070874,
      "price": "1.00000000",
      "origQty": "10.00000000",
      "executedQty": "0.00000000",
      "cummulativeQuoteQty": "0.00000000",
      "status": "CANCELED",
      "timeInForce": "GTC",
      "type": "STOP_LOSS_LIMIT",
      "side": "SELL",
      "stopPrice": "1.00000000",
      "selfTradePreventionMode": "NONE"
    },
    {
      "symbol": "LTCBTC",
      "origClientOrderId": "TXOvglzXuaubXAaENpaRCB",
      "orderId": 3,
      "orderListId": 0,
      "clientOrderId": "unfWT8ig8i0uj6lPuYLez6",
      "transactTime": 1688005070874,
      "price": "3.00000000",
      "origQty": "10.00000000",
      "executedQty": "0.00000000",
      "cummulativeQuoteQty": "0.00000000",
      "status": "CANCELED",
      "timeInForce": "GTC",
      "type": "LIMIT_MAKER",
      "side": "SELL",
      "selfTradePreventionMode": "NONE"
    }
  ]
}

DELETE /api/v3/orderList

取消整个订单列表。

权重(IP): 1

参数

名称 类型 是否必需 描述
symbol STRING YES
orderListId LONG NO orderListIdlistClientOrderId 必须被提供
listClientOrderId STRING NO orderListIdlistClientOrderId 必须被提供
newClientOrderId STRING NO 用户自定义的本次撤销操作的ID(注意不是被撤销的订单的自定义ID)。如无指定会自动赋值。
recvWindow LONG NO 不能大于 60000
timestamp LONG YES

其他注意点:

数据源: 撮合引擎

查询订单列表 (USER_DATA)

响应

{
    "orderListId": 27,
    "contingencyType": "OCO",
    "listStatusType": "EXEC_STARTED",
    "listOrderStatus": "EXECUTING",
    "listClientOrderId": "h2USkA5YQpaXHPIrkd96xE",
    "transactionTime": 1565245656253,
    "symbol": "LTCBTC",
    "orders": [
        {
            "symbol": "LTCBTC",
            "orderId": 4,
            "clientOrderId": "qD1gy3kc3Gx0rihm9Y3xwS"
        },
        {
            "symbol": "LTCBTC",
            "orderId": 5,
            "clientOrderId": "ARzZ9I00CPM8i3NhmU9Ega"
        }
    ]
}

GET /api/v3/orderList

根据提供的可选参数检索特定的订单列表。

权重(IP): 4

参数:

名称 类型 是否必需 描述
orderListId LONG NO orderListIdorigClientOrderId 必须提供一个。
origClientOrderId STRING NO orderListIdorigClientOrderId 必须提供一个。
recvWindow LONG NO 赋值不得大于 60000
timestamp LONG YES

数据源: 数据库

查询所有订单列表 (USER_DATA)

响应

[
  {
    "orderListId": 29,
    "contingencyType": "OCO",
    "listStatusType": "EXEC_STARTED",
    "listOrderStatus": "EXECUTING",
    "listClientOrderId": "amEEAXryFzFwYF1FeRpUoZ",
    "transactionTime": 1565245913483,
    "symbol": "LTCBTC",
    "orders": [
      {
        "symbol": "LTCBTC",
        "orderId": 4,
        "clientOrderId": "oD7aesZqjEGlZrbtRpy5zB"
      },
      {
        "symbol": "LTCBTC",
        "orderId": 5,
        "clientOrderId": "Jr1h6xirOxgeJOUuYQS7V3"
      }
    ]
  },
  {
    "orderListId": 28,
    "contingencyType": "OCO",
    "listStatusType": "EXEC_STARTED",
    "listOrderStatus": "EXECUTING",
    "listClientOrderId": "hG7hFNxJV6cZy3Ze4AUT4d",
    "transactionTime": 1565245913407,
    "symbol": "LTCBTC",
    "orders": [
      {
        "symbol": "LTCBTC",
        "orderId": 2,
        "clientOrderId": "j6lFOfbmFMRjTYA7rRJ0LP"
      },
      {
        "symbol": "LTCBTC",
        "orderId": 3,
        "clientOrderId": "z0KCjOdditiLS5ekAFtK81"
      }
    ]
  }
]

GET /api/v3/allOrderList

根据提供的可选参数检索所有的订单列表。

权重(IP): 20

参数

名称 类型 是否必需 描述
fromId LONG NO 提供该项后, startTimeendTime 都不可提供
startTime LONG NO
endTime LONG NO
limit INT NO 默认值: 500; 最大值: 1000
recvWindow LONG NO 赋值不能超过 60000
timestamp LONG YES

数据源: 数据库

查询订单列表挂单 (USER_DATA)

响应

[
  {
    "orderListId": 31,
    "contingencyType": "OCO",
    "listStatusType": "EXEC_STARTED",
    "listOrderStatus": "EXECUTING",
    "listClientOrderId": "wuB13fmulKj3YjdqWEcsnp",
    "transactionTime": 1565246080644,
    "symbol": "LTCBTC",
    "orders": [
      {
        "symbol": "LTCBTC",
        "orderId": 4,
        "clientOrderId": "r3EH2N76dHfLoSZWIUw1bT"
      },
      {
        "symbol": "LTCBTC",
        "orderId": 5,
        "clientOrderId": "Cv1SnyPD3qhqpbjpYEHbd2"
      }
    ]
  }
]

GET /api/v3/openOrderList

权重(IP): 6

参数

名称 类型 是否必需 描述
recvWindow LONG NO 赋值不能大于 60000
timestamp LONG YES

数据源: 数据库

下 SOR 订单 (TRADE)

响应:

{
  "symbol": "BTCUSDT",
  "orderId": 2,
  "orderListId": -1,
  "clientOrderId": "sBI1KM6nNtOfj5tccZSKly",
  "transactTime": 1689149087774,
  "price": "31000.00000000",
  "origQty": "0.50000000",
  "executedQty": "0.50000000",
  "cummulativeQuoteQty": "14000.00000000",
  "status": "FILLED",
  "timeInForce": "GTC",
  "type": "LIMIT",
  "side": "BUY",
  "workingTime": 1689149087774,
  "fills": [
    {
      "matchType": "ONE_PARTY_TRADE_REPORT",
      "price": "28000.00000000",
      "qty": "0.50000000",
      "commission": "0.00000000",
      "commissionAsset": "BTC",
      "tradeId": -1,
      "allocId": 0
    }
  ],
  "workingFloor": "SOR",              
  "selfTradePreventionMode": "NONE",
  "usedSor": true
}

POST /api/v3/sor/order

发送使用智能订单路由 (SOR) 的新订单。

权重(IP): 1

参数

名称 类型 是否必需 描述
symbol STRING YES
side ENUM YES
type ENUM YES
timeInForce ENUM NO
quantity DECIMAL YES
price DECIMAL NO
newClientOrderId STRING NO 用户自定义的orderid,如空缺系统会自动赋值。如果几个订单具有相同的 newClientOrderID 赋值,
那么只有在前一个订单成交后才可以接受下一个订单,否则该订单将被拒绝。
strategyId INT NO
strategyType INT NO 赋值不能小于 1000000.
icebergQty DECIMAL NO 仅有限价单可以使用该参数,含义为创建冰山订单并指定冰山订单的数量。
newOrderRespType ENUM NO 指定响应类型:
指定响应类型 ACK, RESULTFULL; 默认为 FULL
selfTradePreventionMode ENUM NO 允许的 ENUM 取决于交易对的配置。支持的值有 EXPIRE_TAKEREXPIRE_MAKEREXPIRE_BOTHNONE
recvWindow LONG NO 赋值不能大于 60000
timestamp LONG YES

请注意: POST /api/v3/sor/order 只支持 限价市场 单, 并不支持 quoteOrderQty

数据源: 撮合引擎

测试 SOR 下单接口 (TRADE)

响应:

{}

或者

{
  "standardCommissionForOrder": {  // 订单交易的标准佣金率
    "maker": "0.00000112",
    "taker": "0.00000114",
  },
  "taxCommissionForOrder": {       // 订单交易的税率
    "maker": "0.00000112",
    "taker": "0.00000114",
  },
  "discount": {                    // 以BNB支付时的标准佣金折扣。
    "enabledForAccount": true,
    "enabledForSymbol": true,
    "discountAsset": "BNB",
    "discount": "0.25000000"       // 当用BNB支付佣金时,在标准佣金上按此比率打折
  }
}

POST /api/v3/sor/order/test

用于测试使用智能订单路由 (SOR) 的订单请求,但不会提交到撮合引擎

权重:

条件 请求权重
没有 computeCommissionRates 1
computeCommissionRates 20

参数:

除了 POST /api/v3/sor/order 所有参数, 如下参数也接受:

参数名 类型 是否必需 描述
computeCommissionRates BOOLEAN NO 默认值: false

数据源: 缓存

现货账户接口

账户信息 (USER_DATA)

响应

{
  "makerCommission": 15,
  "takerCommission": 15,
  "buyerCommission": 0,
  "sellerCommission": 0,
  "commissionRates": {
    "maker": "0.00150000",
    "taker": "0.00150000",
    "buyer": "0.00000000",
    "seller": "0.00000000"
  },
  "canTrade": true,
  "canWithdraw": true,
  "canDeposit": true,
  "brokered": false,
  "requireSelfTradePrevention": false,
  "preventSor": false,
  "updateTime": 123456789,
  "accountType": "SPOT",
  "balances": [
    {
      "asset": "BTC",
      "free": "4723846.89208129",
      "locked": "0.00000000"
    },
    {
      "asset": "LTC",
      "free": "4763368.68006011",
      "locked": "0.00000000"
    }
  ],
  "permissions": [
    "SPOT"
  ],
  "uid": 354937868
}

GET /api/v3/account

获取当前账户信息。

权重(IP): 20

参数:

名称 类型 是否必需 描述
omitZeroBalances BOOLEAN NO 如果true,将隐藏所有零余额。
默认值:false
recvWindow LONG NO 赋值不能大于 60000
timestamp LONG YES

数据源: 缓存 => 数据库

账户成交历史 (USER_DATA)

响应

[
  {
    "symbol": "BNBBTC", // 交易对
    "id": 28457, // trade ID
    "orderId": 100234, // 订单ID
    "orderListId": -1, // 订单列表的ID,不然就是-1
    "price": "4.00000100", // 成交价格
    "qty": "12.00000000", // 成交量
    "quoteQty": "48.000012", // 成交金额
    "commission": "10.10000000", // 交易费金额
    "commissionAsset": "BNB", // 交易费资产类型
    "time": 1499865549590, // 交易时间
    "isBuyer": true, // 是否是买家
    "isMaker": false, // 是否是挂单方
    "isBestMatch": true
  }
]

GET /api/v3/myTrades

获取账户指定交易对的成交历史

权重(IP): 20

参数:

名称 类型 是否必需 描述
symbol STRING YES
orderId LONG NO 必须要和参数symbol一起使用.
startTime LONG NO
endTime LONG NO
fromId LONG NO 起始Trade id。 默认获取最新交易。
limit INT NO 默认 500; 最大 1000.
recvWindow LONG NO 赋值不能超过 60000
timestamp LONG YES

注意:

数据源: 数据库

查询未成交的订单计数 (USER_DATA)

响应

[
  {
    "rateLimitType": "ORDERS",
    "interval": "SECOND",
    "intervalNum": 10,
    "limit": 10000,
    "count": 0
  },
  {
    "rateLimitType": "ORDERS",
    "interval": "DAY",
    "intervalNum": 1,
    "limit": 20000,
    "count": 0
  }
]

GET /api/v3/rateLimit/order

显示用户在所有时间间隔内的未成交订单计数。

权重(IP): 40

参数:

名称 类型 是否必需 描述
recvWindow LONG NO 赋值不得大于 60000
timestamp LONG YES

数据源: 缓存

获取 Prevented Matches (USER_DATA)

响应:

[
  {
    "symbol": "BTCUSDT",
    "preventedMatchId": 1,
    "takerOrderId": 5,
    "makerOrderId": 3,
    "tradeGroupId": 1,
    "selfTradePreventionMode": "EXPIRE_MAKER",
    "price": "1.100000",
    "makerPreventedQuantity": "1.300000",
    "transactTime": 1669101687094
  }
]

GET /api/v3/myPreventedMatches

获取因 STP 触发而过期的订单列表。

对于什么是"阻止"匹配以及STP的更多相关信息,请参阅我们的 STP FAQ_CN 页面。

这些是支持的组合:

参数:

名称 类型 是否必需 描述
symbol STRING YES
preventedMatchId LONG NO
orderId LONG NO
fromPreventedMatchId LONG NO
limit INT NO 默认:500;最大:1000
recvWindow LONG NO 赋值不得大于 60000
timestamp LONG YES

权重(IP):

情况 权重
如果 symbol 是无效的 2
通过 preventedMatchId 查询 2
通过 orderId 查询 20

数据源:

数据库

查询分配结果 (USER_DATA)

响应:

[
  {
    "symbol": "BTCUSDT",
    "allocationId": 0,
    "allocationType": "SOR",
    "orderId": 1,
    "orderListId": -1,
    "price": "1.00000000",
    "qty": "5.00000000",
    "quoteQty": "5.00000000",
    "commission": "0.00000000",
    "commissionAsset": "BTC",
    "time": 1687506878118,
    "isBuyer": true,
    "isMaker": false,
    "isAllocator": false
  }
]

GET /api/v3/myAllocations

检索由 SOR 订单生成引起的分配结果。

权重: 20

参数:

名称 类型 是否必需 描述
symbol STRING Yes
startTime LONG No
endTime LONG No
fromAllocationId INT No
limit INT No 默认值 500; 最大值 1000
orderId LONG No
recvWindow LONG No 不能大于 60000
timestamp LONG No

支持的参数组合:

参数 响应
symbol 按从最旧到最新排序的分配
symbol + startTime startTime 开始的最旧的分配
symbol + endTime endTime 为止的最新的分配
symbol + startTime + endTime 在指定时间范围内的分配
symbol + fromAllocationId 从指定 AllocationId 开始的分配
symbol + orderId 按从最旧到最新排序并和特定订单关联的分配
symbol + orderId + fromAllocationId 从指定 AllocationId 开始并和特定订单关联的分配

注意: startTimeendTime 之间的时间不能超过 24 小时。

数据源: 数据库

查询佣金费率 (USER_DATA)

响应:

{
  "symbol": "BTCUSDT",
  "standardCommission": {          // 订单交易的标准佣金率
    "maker": "0.00000010",
    "taker": "0.00000020",
    "buyer": "0.00000030",
    "seller": "0.00000040" 
  },
  "taxCommission": {              //  订单交易的税率
    "maker": "0.00000112",
    "taker": "0.00000114",
    "buyer": "0.00000118",
    "seller": "0.00000116" 
  },
  "discount": {                   // 使用BNB支付时的佣金折扣。
    "enabledForAccount": true,
    "enabledForSymbol": true,
    "discountAsset": "BNB",
    "discount": "0.75000000"      // 当用BNB支付佣金时,在标准佣金上按此比率打折
  }
}

GET /api/v3/account/commission

获取当前账户的佣金费率。

权重: 20

参数:

参数名 类型 是否必需 描述
symbol STRING YES

数据源: 数据库

杠杆账户和交易接口

杠杆账户借贷/还款(MARGIN)

响应

{
  //transaction id
  "tranId": 100000001
}

POST /sapi/v1/margin/borrow-repay

杠杆账户借贷/还款

权重(UID): 1500

参数:

名称 类型 是否必需 描述
asset STRING YES
isIsolated STRING YES 是否逐仓杠杆,TRUE, FALSE, 默认 FALSE
symbol STRING YES 逐仓交易对,配合逐仓使用
amount STRING YES
type STRING YES 操作类型:BORROW、REPAY
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

查询借贷/还款记录(USER_DATA)

响应

{
  "rows": [
      {
        "isolatedSymbol": "BNBUSDT",     // 逐仓还款 返回逐仓symbol; 若是全仓不会返回此字段
        "amount": "14.00000000",   // 还款总额
        "asset": "BNB",   
        "interest": "0.01866667",    // 支付的利息
        "principal": "13.98133333",   // 支付的本金
        "status": "CONFIRMED",   //状态: PENDING (等待执行), CONFIRMED (成功还款), FAILED (执行失败);
        "timestamp": 1563438204000,
        "txId": 2970933056
      }
  ],
  "total": 1
}

GET /sapi/v1/margin/borrow-repay 查询借贷/还款记录

权重(IP): 10

参数:

名称 类型 是否必需 描述
asset STRING NO
isolatedSymbol STRING NO 逐仓symbol
txId LONG NO POST /sapi/v1/margin/loan中的tranId
startTime LONG NO
endTime LONG NO
current LONG NO 当前查询页。 开始值 1。 默认:1
size LONG NO 默认:10 最大:100
type STRING YES 操作类型:BORROW、REPAY
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

获取所有杠杆资产信息 (MARKET_DATA)

响应

[
  {
    "assetFullName": "USD coin",
    "assetName": "USDC",
    "isBorrowable": true,
    "isMortgageable": true,
    "userMinBorrow": "0.00000000",
    "userMinRepay": "0.00000000",
    "delistTime": 1704973040
  }
]

GET /sapi/v1/margin/allAssets

权重(IP): 1

参数:

名称 类型 是否必需 描述
asset STRING NO

获取所有全仓杠杆交易对(MARKET_DATA)

响应

[
    {
        "base": "BNB",
        "id": 351637150141315861,
        "isBuyAllowed": true,
        "isMarginTrade": true,
        "isSellAllowed": true,
        "quote": "BTC",
        "symbol": "BNBBTC"
    },
    {
        "base": "TRX",
        "id": 351637923235429141,
        "isBuyAllowed": true,
        "isMarginTrade": true,
        "isSellAllowed": true,
        "quote": "BTC",
        "symbol": "TRXBTC",
        "delistTime": 1704973040
    },
    {
        "base": "XRP",
        "id": 351638112213990165,
        "isBuyAllowed": true,
        "isMarginTrade": true,
        "isSellAllowed": true,
        "quote": "BTC",
        "symbol": "XRPBTC"
    },
    {
        "base": "ETH",
        "id": 351638524530850581,
        "isBuyAllowed": true,
        "isMarginTrade": true,
        "isSellAllowed": true,
        "quote": "BTC",
        "symbol": "ETHBTC"
    }
]

GET /sapi/v1/margin/allPairs

权重(IP): 1

参数:

名称 类型 是否必需 描述
symbol STRING NO

查询杠杆价格指数 (MARKET_DATA)

响应

{
   "calcTime": 1562046418000,
   "price": "0.00333930",
   "symbol": "BNBBTC"
}

GET /sapi/v1/margin/priceIndex

权重(IP): 10

参数:

名称 类型 是否必需 描述
symbol STRING YES

杠杆账户下单 (TRADE)

Response ACK:

{
  "symbol": "BTCUSDT",
  "orderId": 28,
  "clientOrderId": "6gCrw2kRUAF9CvJDGP16IP",
  "isIsolated": true,       // 是否是逐仓symbol交易
  "transactTime": 1507725176595
}

Response RESULT:

{
  "symbol": "BTCUSDT",
  "orderId": 28,
  "clientOrderId": "6gCrw2kRUAF9CvJDGP16IP",
  "transactTime": 1507725176595,
  "price": "1.00000000",
  "origQty": "10.00000000",
  "executedQty": "10.00000000",
  "cummulativeQuoteQty": "39983.00000000",
  "status": "FILLED",
  "timeInForce": "GTC",
  "type": "MARKET",
  "isIsolated": true,       // 是否是逐仓symbol交易
  "side": "SELL",
  "selfTradePreventionMode": "NONE"
}

Response FULL:

{
  "symbol": "BTCUSDT",
  "orderId": 28,
  "clientOrderId": "6gCrw2kRUAF9CvJDGP16IP",
  "transactTime": 1507725176595,
  "price": "0.00000000",
  "origQty": "10.00000000",
  "executedQty": "10.00000000",
  "cummulativeQuoteQty": "39983.00000000",
  "status": "FILLED",
  "timeInForce": "GTC",
  "type": "MARKET",
  "side": "SELL",
  "marginBuyBorrowAmount": 5,       // 下单后没有发生借款则不返回该字段
  "marginBuyBorrowAsset": "BTC",    // 下单后没有发生借款则不返回该字段
  "isIsolated": true,       // 是否是逐仓symbol交易
  "selfTradePreventionMode": "NONE",
  "fills": [
    {
      "price": "4000.00000000",
      "qty": "1.00000000",
      "commission": "4.00000000",
      "commissionAsset": "USDT"
    },
    {
      "price": "3999.00000000",
      "qty": "5.00000000",
      "commission": "19.99500000",
      "commissionAsset": "USDT"
    },
    {
      "price": "3998.00000000",
      "qty": "2.00000000",
      "commission": "7.99600000",
      "commissionAsset": "USDT"
    },
    {
      "price": "3997.00000000",
      "qty": "1.00000000",
      "commission": "3.99700000",
      "commissionAsset": "USDT"
    },
    {
      "price": "3995.00000000",
      "qty": "1.00000000",
      "commission": "3.99500000",
      "commissionAsset": "USDT"
    }
  ]
}

POST /sapi/v1/margin/order

权重(UID): 6

参数:

名称 类型 是否必需 描述
symbol STRING YES
isIsolated STRING NO 是否逐仓杠杆,"TRUE", "FALSE", 默认 "FALSE"
side ENUM YES BUY

SELL
type ENUM YES 详见枚举定义:订单类型
quantity DECIMAL NO
quoteOrderQty DECIMAL NO
price DECIMAL NO
stopPrice DECIMAL NO STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, 和 TAKE_PROFIT_LIMIT 订单一起使用.
newClientOrderId STRING NO 客户自定义的唯一订单ID。若未发送自动生成。
icebergQty DECIMAL NO LIMIT, STOP_LOSS_LIMIT, 和 TAKE_PROFIT_LIMIT 一起使用创建 iceberg 订单.
newOrderRespType ENUM NO 设置响应: JSON. ACK, RESULT, 或 FULL; MARKET 和 LIMIT 订单类型默认为 FULL, 所有其他订单默认为 ACK.
sideEffectType ENUM NO NO_SIDE_EFFECT, MARGIN_BUY, AUTO_REPAY,AUTO_BORROW_REPAY;默认为 NO_SIDE_EFFECT. 详见FAQ
timeInForce ENUM NO GTC,IOC,FOK
selfTradePreventionMode ENUM NO 允许的 ENUM 取决于交易对的配置。支持的值有 EXPIRE_TAKER,EXPIRE_MAKER,EXPIRE_BOTH,NONE
autoRepayAtCancel BOOLEAN NO 只有在自动借款单或者自动借还单生效,true表示的是撤单后需要把订单产生的借款归还,默认为true
recvWindow LONG NO 赋值不能大于 60000
timestamp LONG YES

杠杆账户撤销订单 (TRADE)

响应

{
  "symbol": "LTCBTC",
  "orderId": "28",
  "origClientOrderId": "myOrder1",
  "clientOrderId": "cancelMyOrder1",
  "price": "1.00000000",
  "origQty": "10.00000000",
  "executedQty": "8.00000000",
  "cummulativeQuoteQty": "8.00000000",
  "status": "CANCELED",
  "timeInForce": "GTC",
  "type": "LIMIT",
  "side": "SELL",
  "isIsolated": true       // 是否是逐仓symbol交易 
}

DELETE /sapi/v1/margin/order

杠杆账户撤销有效订单。

权重(IP): 10

参数:

名称 类型 是否必需 描述
symbol STRING YES
isIsolated STRING NO 是否逐仓杠杆,"TRUE", "FALSE", 默认 "FALSE"
orderId LONG NO
origClientOrderId STRING NO
newClientOrderId STRING NO 用于唯一识别此撤销订单,默认自动生成。
recvWindow LONG NO T赋值不能大于 60000
timestamp LONG YES

杠杆账户撤销单一交易对的所有挂单 (TRADE)

响应:

[
  {
    "symbol": "BTCUSDT",
    "isIsolated": true,       // 是否是逐仓symbol交易 
    "origClientOrderId": "E6APeyTJvkMvLMYMqu1KQ4",
    "orderId": 11,
    "orderListId": -1,
    "clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx",
    "price": "0.089853",
    "origQty": "0.178622",
    "executedQty": "0.000000",
    "cummulativeQuoteQty": "0.000000",
    "status": "CANCELED",
    "timeInForce": "GTC",
    "type": "LIMIT",
    "side": "BUY",
    "selfTradePreventionMode": "NONE"
  },
  {
    "symbol": "BTCUSDT",
    "isIsolated": false,       // 是否是逐仓symbol交易 
    "origClientOrderId": "A3EF2HCwxgZPFMrfwbgrhv",
    "orderId": 13,
    "orderListId": -1,
    "clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx",
    "price": "0.090430",
    "origQty": "0.178622",
    "executedQty": "0.000000",
    "cummulativeQuoteQty": "0.000000",
    "status": "CANCELED",
    "timeInForce": "GTC",
    "type": "LIMIT",
    "side": "BUY",
    "selfTradePreventionMode": "NONE"
  },
  {
    "orderListId": 1929,
    "contingencyType": "OCO",
    "listStatusType": "ALL_DONE",
    "listOrderStatus": "ALL_DONE",
    "listClientOrderId": "2inzWQdDvZLHbbAmAozX2N",
    "transactionTime": 1585230948299,
    "symbol": "BTCUSDT",
    "isIsolated": true,       // 是否是逐仓symbol交易 
    "orders": [
      {
        "symbol": "BTCUSDT",
        "orderId": 20,
        "clientOrderId": "CwOOIPHSmYywx6jZX77TdL"
      },
      {
        "symbol": "BTCUSDT",
        "orderId": 21,
        "clientOrderId": "461cPg51vQjV3zIMOXNz39"
      }
    ],
    "orderReports": [
      {
        "symbol": "BTCUSDT",
        "origClientOrderId": "CwOOIPHSmYywx6jZX77TdL",
        "orderId": 20,
        "orderListId": 1929,
        "clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx",
        "price": "0.668611",
        "origQty": "0.690354",
        "executedQty": "0.000000",
        "cummulativeQuoteQty": "0.000000",
        "status": "CANCELED",
        "timeInForce": "GTC",
        "type": "STOP_LOSS_LIMIT",
        "side": "BUY",
        "stopPrice": "0.378131",
        "icebergQty": "0.017083"
      },
      {
        "symbol": "BTCUSDT",
        "origClientOrderId": "461cPg51vQjV3zIMOXNz39",
        "orderId": 21,
        "orderListId": 1929,
        "clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx",
        "price": "0.008791",
        "origQty": "0.690354",
        "executedQty": "0.000000",
        "cummulativeQuoteQty": "0.000000",
        "status": "CANCELED",
        "timeInForce": "GTC",
        "type": "LIMIT_MAKER",
        "side": "BUY",
        "icebergQty": "0.639962"
      }
    ]
  }
]

DELETE /sapi/v1/margin/openOrders

杠杆账户撤销单一交易对下所有挂单, 包括订单列表的挂单。

权重(IP): 1

参数:

名称 类型 是否必需 描述
symbol STRING YES
isIsolated STRING NO 是否逐仓杠杆,"TRUE", "FALSE", 默认 "FALSE"
recvWindow LONG NO 赋值不能大于 60000
timestamp LONG YES

调整全仓最大杠杆 (USER_DATA)

响应:

{
    "success": true
}

POST /sapi/v1/margin/max-leverage

调整全仓最大杠杆倍数

权重(UID): 3000

访问限制: 1次/分钟/UID

参数:

名称 类型 是否必需 描述
maxLeverage Integer YES 只能调整3, 5 或者10,举例: maxLeverage=10 就是选择切换成全仓 Pro 模式,maxLeverage = 5 或者3是选择全仓Classic模式

获取全仓杠杆划转历史 (USER_DATA)

响应

 {
  "rows": [
    {
      "amount": "0.10000000",
      "asset": "BNB",
      "status": "CONFIRMED",
      "timestamp": 1566898617,
      "txId": 5240372201,
      "type": "ROLL_IN",
      "transFrom": "SPOT",//SPOT,FUTURES,FIAT,DELIVERY,MINING,ISOLATED_MARGIN,FUNDING,MOTHER_SPOT,OPTION,SUB_SPOT,SUB_MARGIN,CROSS_MARGIN
      "transTo": "ISOLATED_MARGIN",//SPOT,FUTURES,FIAT,DELIVERY,MINING,ISOLATED_MARGIN,FUNDING,MOTHER_SPOT,OPTION,SUB_SPOT,SUB_MARGIN,CROSS_MARGIN
    },
    {
      "amount": "5.00000000",
      "asset": "USDT",
      "status": "CONFIRMED",
      "timestamp": 1566888436,
      "txId": 5239810406,
      "type": "ROLL_OUT",
      "transFrom": "ISOLATED_MARGIN",//SPOT,FUTURES,FIAT,DELIVERY,MINING,ISOLATED_MARGIN,FUNDING,MOTHER_SPOT,OPTION,SUB_SPOT,SUB_MARGIN,CROSS_MARGIN
      "transTo": "ISOLATED_MARGIN",//SPOT,FUTURES,FIAT,DELIVERY,MINING,ISOLATED_MARGIN,FUNDING,MOTHER_SPOT,OPTION,SUB_SPOT,SUB_MARGIN,CROSS_MARGIN
      "fromSymbol": "BNBUSDT",
      "toSymbol": "BTCUSDT"
    },
    {
      "amount": "1.00000000",
      "asset": "EOS",
      "status": "CONFIRMED",
      "timestamp": 1566888403,
      "txId": 5239808703,
      "type": "ROLL_IN"
    }
  ],
  "total": 3
}

GET /sapi/v1/margin/transfer

权重(IP): 1

参数:

名称 类型 是否必需 描述
asset STRING NO
type STRING NO 划转类型: ROLL_IN, ROLL_OUT
startTime LONG NO
endTime LONG NO
current LONG NO 当前查询页。 从 1开始。 默认:1
size LONG NO 默认:10 最大:100
isolatedSymbol STRING NO 逐仓交易对,适用于逐仓查询
recvWindow LONG NO 赋值不能大于 60000
timestamp LONG YES

获取利息历史 (USER_DATA)

响应

{
  "rows": [
    {            
      "txId": 1352286576452864727,           
      "interestAccuredTime": 1672160400000,            
      "asset": "USDT", 
      "rawAsset": "USDT",  // 逐仓不会返回此字段          
      "principal": "45.3313",            
      "interest": "0.00024995",            
      "interestRate": "0.00013233",            
      "type": "ON_BORROW",           
      "isolatedSymbol": "BNBUSDT"  // 返回逐仓symbol; 若是全仓不会返回此字段    
    }
  ],
  "total": 1
}

GET /sapi/v1/margin/interestHistory

权重(IP): 1

参数:

名称 类型 是否必需 描述
asset STRING NO
isolatedSymbol STRING NO 逐仓symbol
startTime LONG NO 精确到秒,忽略毫秒的数值
如XXXXXXXXXX000ms
endTime LONG NO 精确到秒,忽略毫秒的数值
如XXXXXXXXXX000ms
current LONG NO 当前查询页。 开始值 1. 默认:1
size LONG NO 默认:10 最大:100
recvWindow LONG NO 赋值不能大于 60000
timestamp LONG YES

获取账户强制平仓记录(USER_DATA)

响应

  {
      "rows": [
          {
              "avgPrice": "0.00388359",
              "executedQty": "31.39000000",
              "orderId": 180015097,
              "price": "0.00388110",
              "qty": "31.39000000",
              "side": "SELL",
              "symbol": "BNBBTC",
              "timeInForce": "GTC",
              "isIsolated": ture,         // 是否是逐仓
              "updatedTime": 1558941374745
          }
      ],
      "total": 1
  }

GET /sapi/v1/margin/forceLiquidationRec

权重(IP): 1

参数:

名称 类型 是否必需 描述
startTime LONG NO
endTime LONG NO
isolatedSymbol STRING NO
current LONG NO 当前查询页。 开始值 1. 默认:1
size LONG NO 默认:10 最大:100
recvWindow LONG NO 赋值不能大于 60000
timestamp LONG YES

查询全仓杠杆账户详情 (USER_DATA)

响应

{
      "created" : true, // true 表示已开户, false 表示未开户
      "borrowEnabled": true,
      "marginLevel": "11.64405625",
      "collateralMarginLevel" : "3.2",
      "totalAssetOfBtc": "6.82728457",
      "totalLiabilityOfBtc": "0.58633215",
      "totalNetAssetOfBtc": "6.24095242",
      "totalCollateralValueInUSDT": "5.82728457",
      "tradeEnabled": true,
      "transferEnabled": true,
      "accountType": "MARGIN_1", // MARGIN_1 全仓Classic模式账户, MARGIN_2 全仓Pro模式账户
      "userAssets": [
          {
              "asset": "BTC",
              "borrowed": "0.00000000",
              "free": "0.00499500",
              "interest": "0.00000000",
              "locked": "0.00000000",
              "netAsset": "0.00499500"
          },
          {
              "asset": "BNB",
              "borrowed": "201.66666672",
              "free": "2346.50000000",
              "interest": "0.00000000",
              "locked": "0.00000000",
              "netAsset": "2144.83333328"
          },
          {
              "asset": "ETH",
              "borrowed": "0.00000000",
              "free": "0.00000000",
              "interest": "0.00000000",
              "locked": "0.00000000",
              "netAsset": "0.00000000"
          },
          {
              "asset": "USDT",
              "borrowed": "0.00000000",
              "free": "0.00000000",
              "interest": "0.00000000",
              "locked": "0.00000000",
              "netAsset": "0.00000000"
          }
      ]
}

GET /sapi/v1/margin/account

权重(IP): 10

参数:

名称 类型 是否必需 描述
recvWindow LONG NO 赋值不能大于 60000
timestamp LONG YES

查询杠杆账户订单 (USER_DATA)

响应

{
   "clientOrderId": "ZwfQzuDIGpceVhKW5DvCmO",
   "cummulativeQuoteQty": "0.00000000",
   "executedQty": "0.00000000",
   "icebergQty": "0.00000000",
   "isWorking": true,
   "orderId": 213205622,
   "origQty": "0.30000000",
   "price": "0.00493630",
   "side": "SELL",
   "status": "NEW",
   "stopPrice": "0.00000000",
   "symbol": "BNBBTC",
   "isIsolated": true,       // 是否是逐仓symbol交易
   "time": 1562133008725,
   "timeInForce": "GTC",
   "type": "LIMIT",
   "selfTradePreventionMode": "NONE",
   "updateTime": 1562133008725
}

GET /sapi/v1/margin/order

权重(IP): 10

参数:

名称 类型 是否必需 描述
symbol STRING YES
isIsolated STRING NO 是否逐仓杠杆,"TRUE", "FALSE", 默认 "FALSE"
orderId LONG NO
origClientOrderId STRING NO
recvWindow LONG NO 赋值不能大于 60000
timestamp LONG YES

查询杠杆账户挂单记录 (USER_DATA)

响应

[
   {
       "clientOrderId": "qhcZw71gAkCCTv0t0k8LUK",
       "cummulativeQuoteQty": "0.00000000",
       "executedQty": "0.00000000",
       "icebergQty": "0.00000000",
       "isWorking": true,
       "orderId": 211842552,
       "origQty": "0.30000000",
       "price": "0.00475010",
       "side": "SELL",
       "status": "NEW",
       "stopPrice": "0.00000000",
       "symbol": "BNBBTC",
       "isIsolated": true,       // 是否是逐仓symbol交易
       "time": 1562040170089,
       "timeInForce": "GTC",
       "type": "LIMIT",
       "selfTradePreventionMode": "NONE",
       "updateTime": 1562040170089
    }
]

GET /sapi/v1/margin/openOrders

权重(IP): 10

参数:

名称 类型 是否必需 描述
symbol STRING NO
isIsolated STRING NO 是否逐仓杠杆,"TRUE", "FALSE", 默认 "FALSE"
recvWindow LONG NO 赋值不能大于 60000
timestamp LONG YES

查询杠杆账户的所有订单 (USER_DATA)

响应

[
      {
          "clientOrderId": "D2KDy4DIeS56PvkM13f8cP",
          "cummulativeQuoteQty": "0.00000000",
          "executedQty": "0.00000000",
          "icebergQty": "0.00000000",
          "isWorking": false,
          "orderId": 41295,
          "origQty": "5.31000000",
          "price": "0.22500000",
          "side": "SELL",
          "status": "CANCELED",
          "stopPrice": "0.18000000",
          "symbol": "BNBBTC",
          "isIsolated": false,       // 是否是逐仓symbol交易 
          "time": 1565769338806,
          "timeInForce": "GTC",
          "type": "TAKE_PROFIT_LIMIT",
          "selfTradePreventionMode": "NONE",
          "updateTime": 1565769342148
      },
      {
          "clientOrderId": "gXYtqhcEAs2Rn9SUD9nRKx",
          "cummulativeQuoteQty": "0.00000000",
          "executedQty": "0.00000000",
          "icebergQty": "1.00000000",
          "isWorking": true,
          "orderId": 41296,
          "origQty": "6.65000000",
          "price": "0.18000000",
          "side": "SELL",
          "status": "CANCELED",
          "stopPrice": "0.00000000",
          "symbol": "BNBBTC",
          "isIsolated": false,       // 是否是逐仓symbol交易 
          "time": 1565769348687,
          "timeInForce": "GTC",
          "type": "LIMIT",
          "selfTradePreventionMode": "NONE",
          "updateTime": 1565769352226
      }

]

GET /sapi/v1/margin/allOrders

权重(IP): 200

访问限制
60次/分钟/IP

参数:

名称 类型 是否必需 描述
symbol STRING YES
isIsolated STRING NO 是否逐仓杠杆,"TRUE", "FALSE", 默认 "FALSE"
orderId LONG NO
startTime LONG NO
endTime LONG NO
limit INT NO 默认 500;最大500.
recvWindow LONG NO 赋值不能大于 60000
timestamp LONG YES

杠杆账户 OCO 下单(TRADE)

响应

{
  "orderListId": 0,
  "contingencyType": "OCO",
  "listStatusType": "EXEC_STARTED",
  "listOrderStatus": "EXECUTING",
  "listClientOrderId": "JYVpp3F0f5CAG15DhtrqLp",
  "transactionTime": 1563417480525,
  "symbol": "LTCBTC",
  "marginBuyBorrowAmount": "5",       // 下单后没有发生借款则不返回该字段
  "marginBuyBorrowAsset": "BTC",    // 下单后没有发生借款则不返回该字段
  "isIsolated": false,       // 是否是逐仓symbol交易
  "orders": [
    {
      "symbol": "LTCBTC",
      "orderId": 2,
      "clientOrderId": "Kk7sqHb9J6mJWTMDVW7Vos"
    },
    {
      "symbol": "LTCBTC",
      "orderId": 3,
      "clientOrderId": "xTXKaGYd4bluPVp78IVRvl"
    }
  ],
  "orderReports": [
    {
      "symbol": "LTCBTC",
      "orderId": 2,
      "orderListId": 0,
      "clientOrderId": "Kk7sqHb9J6mJWTMDVW7Vos",
      "transactTime": 1563417480525,
      "price": "0.000000",
      "origQty": "0.624363",
      "executedQty": "0.000000",
      "cummulativeQuoteQty": "0.000000",
      "status": "NEW",
      "timeInForce": "GTC",
      "type": "STOP_LOSS",
      "side": "BUY",
      "stopPrice": "0.960664",
      "selfTradePreventionMode": "NONE"
    },
    {
      "symbol": "LTCBTC",
      "orderId": 3,
      "orderListId": 0,
      "clientOrderId": "xTXKaGYd4bluPVp78IVRvl",
      "transactTime": 1563417480525,
      "price": "0.036435",
      "origQty": "0.624363",
      "executedQty": "0.000000",
      "cummulativeQuoteQty": "0.000000",
      "status": "NEW",
      "timeInForce": "GTC",
      "type": "LIMIT_MAKER",
      "side": "BUY",
      "selfTradePreventionMode": "NONE"
    }
  ]
}

POST /sapi/v1/margin/order/oco

杠杆账户发送新 OCO 订单。

权重(UID): 6

参数:

名称 类型 是否必需 描述
symbol STRING YES
isIsolated STRING NO 是否逐仓杠杆,"TRUE", "FALSE", 默认 "FALSE"
listClientOrderId STRING NO 整个orderList的唯一ID
side ENUM YES 详见枚举定义:订单方向
quantity DECIMAL YES
limitClientOrderId STRING NO 限价单的唯一ID
price DECIMAL YES
limitIcebergQty DECIMAL NO
stopClientOrderId STRING NO 止损/止损限价单的唯一ID
stopPrice DECIMAL YES
stopLimitPrice DECIMAL NO 如果提供,须配合提交stopLimitTimeInForce
stopIcebergQty DECIMAL NO
stopLimitTimeInForce ENUM NO 有效值 GTC/FOK/IOC
newOrderRespType ENUM NO 详见枚举定义:订单返回类型
sideEffectType ENUM NO NO_SIDE_EFFECT, MARGIN_BUY, AUTO_REPAY,AUTO_BORROW_REPAY; 默认为 NO_SIDE_EFFECT;详见FAQ
selfTradePreventionMode ENUM NO 允许的 ENUM 取决于交易对的配置。支持的值有 EXPIRE_TAKER,EXPIRE_MAKER,EXPIRE_BOTH,NONE
autoRepayAtCancel BOOLEAN NO 只有在自动借款单或者自动借还单生效,true表示的是撤单后需要把订单产生的借款归还,默认为true
recvWindow LONG NO 不能大于 60000
timestamp LONG YES

其他信息:

取消杠杆账户 OCO 订单(TRADE)

响应

{
  "orderListId": 0,
  "contingencyType": "OCO",
  "listStatusType": "ALL_DONE",
  "listOrderStatus": "ALL_DONE",
  "listClientOrderId": "C3wyj4WVEktd7u9aVBRXcN",
  "transactionTime": 1574040868128,
  "symbol": "LTCBTC",
  "isIsolated": false,       // 是否是逐仓symbol交易 
  "orders": [
    {
      "symbol": "LTCBTC",
      "orderId": 2,
      "clientOrderId": "pO9ufTiFGg3nw2fOdgeOXa"
    },
    {
      "symbol": "LTCBTC",
      "orderId": 3,
      "clientOrderId": "TXOvglzXuaubXAaENpaRCB"
    }
  ],
  "orderReports": [
    {
      "symbol": "LTCBTC",
      "origClientOrderId": "pO9ufTiFGg3nw2fOdgeOXa",
      "orderId": 2,
      "orderListId": 0,
      "clientOrderId": "unfWT8ig8i0uj6lPuYLez6",
      "price": "1.00000000",
      "origQty": "10.00000000",
      "executedQty": "0.00000000",
      "cummulativeQuoteQty": "0.00000000",
      "status": "CANCELED",
      "timeInForce": "GTC",
      "type": "STOP_LOSS_LIMIT",
      "side": "SELL",
      "stopPrice": "1.00000000",
      "selfTradePreventionMode": "NONE"
    },
    {
      "symbol": "LTCBTC",
      "origClientOrderId": "TXOvglzXuaubXAaENpaRCB",
      "orderId": 3,
      "orderListId": 0,
      "clientOrderId": "unfWT8ig8i0uj6lPuYLez6",
      "price": "3.00000000",
      "origQty": "10.00000000",
      "executedQty": "0.00000000",
      "cummulativeQuoteQty": "0.00000000",
      "status": "CANCELED",
      "timeInForce": "GTC",
      "type": "LIMIT_MAKER",
      "side": "SELL",
      "selfTradePreventionMode": "NONE"
    }
  ]
}

DELETE /sapi/v1/margin/orderList

取消杠杆账户订单列表。

权重(UID): 1

参数

名称 类型 是否必需 描述
symbol STRING YES
isIsolated STRING NO 是否逐仓杠杆,"TRUE", "FALSE", 默认 "FALSE"
orderListId LONG NO orderListIdlistClientOrderId 必须被提供
listClientOrderId STRING NO orderListIdlistClientOrderId 必须被提供
newClientOrderId STRING NO 用户自定义的本次撤销操作的ID(注意不是被撤销的订单的自定义ID)。如无指定会自动赋值。
recvWindow LONG NO 不能大于 60000
timestamp LONG YES

其他注意点:

查询杠杆账户 OCO (USER_DATA)

响应

{
    "orderListId": 27,
    "contingencyType": "OCO",
    "listStatusType": "EXEC_STARTED",
    "listOrderStatus": "EXECUTING",
    "listClientOrderId": "h2USkA5YQpaXHPIrkd96xE",
    "transactionTime": 1565245656253,
    "symbol": "LTCBTC",
    "isIsolated": true,       // 是否是逐仓symbol交易 
    "orders": [
        {
            "symbol": "LTCBTC",
            "orderId": 4,
            "clientOrderId": "qD1gy3kc3Gx0rihm9Y3xwS"
        },
        {
            "symbol": "LTCBTC",
            "orderId": 5,
            "clientOrderId": "ARzZ9I00CPM8i3NhmU9Ega"
        }
    ]
}

GET /sapi/v1/margin/orderList

根据提供的可选参数检索特定的杠杆账户的订单列表。

权重(IP): 10

参数:

名称 类型 是否必需 描述
isIsolated STRING NO 是否逐仓杠杆,"TRUE", "FALSE", 默认 "FALSE"
symbol STRING NO 逐仓杠杆必填,全仓杠杆不支持该参数
orderListId LONG NO orderListIdorigClientOrderId 必须提供一个。
origClientOrderId STRING NO orderListIdorigClientOrderId 必须提供一个。
recvWindow LONG NO 赋值不得大于 60000
timestamp LONG YES

查询特定杠杆账户所有的订单列表 (USER_DATA)

响应

[
  {
    "orderListId": 29,
    "contingencyType": "OCO",
    "listStatusType": "EXEC_STARTED",
    "listOrderStatus": "EXECUTING",
    "listClientOrderId": "amEEAXryFzFwYF1FeRpUoZ",
    "transactionTime": 1565245913483,
    "symbol": "LTCBTC",
    "isIsolated": true,       // 是否是逐仓symbol交易 
    "orders": [
      {
        "symbol": "LTCBTC",
        "orderId": 4,
        "clientOrderId": "oD7aesZqjEGlZrbtRpy5zB"
      },
      {
        "symbol": "LTCBTC",
        "orderId": 5,
        "clientOrderId": "Jr1h6xirOxgeJOUuYQS7V3"
      }
    ]
  },
  {
    "orderListId": 28,
    "contingencyType": "OCO",
    "listStatusType": "EXEC_STARTED",
    "listOrderStatus": "EXECUTING",
    "listClientOrderId": "hG7hFNxJV6cZy3Ze4AUT4d",
    "transactionTime": 1565245913407,
    "symbol": "LTCBTC",
    "orders": [
      {
        "symbol": "LTCBTC",
        "orderId": 2,
        "clientOrderId": "j6lFOfbmFMRjTYA7rRJ0LP"
      },
      {
        "symbol": "LTCBTC",
        "orderId": 3,
        "clientOrderId": "z0KCjOdditiLS5ekAFtK81"
      }
    ]
  }
]

GET /sapi/v1/margin/allOrderList

根据提供的可选参数检索特定杠杆账户所有的订单列表。

权重(IP): 200

参数

名称 类型 是否必需 描述
isIsolated STRING NO 是否逐仓杠杆,"TRUE", "FALSE", 默认 "FALSE"
symbol STRING NO 逐仓杠杆必填,全仓杠杆不支持该参数
fromId LONG NO 提供该项后, startTimeendTime 都不可提供
startTime LONG NO
endTime LONG NO
limit INT NO 默认值: 500; 最大值: 1000
recvWindow LONG NO 赋值不能超过 60000
timestamp LONG YES

查询杠杆账户的订单列表挂单 (USER_DATA)

响应

[
  {
    "orderListId": 31,
    "contingencyType": "OCO",
    "listStatusType": "EXEC_STARTED",
    "listOrderStatus": "EXECUTING",
    "listClientOrderId": "wuB13fmulKj3YjdqWEcsnp",
    "transactionTime": 1565246080644,
    "symbol": "LTCBTC",
    "isIsolated": true,       // 是否是逐仓symbol交易 
    "orders": [
      {
        "symbol": "LTCBTC",
        "orderId": 4,
        "clientOrderId": "r3EH2N76dHfLoSZWIUw1bT"
      },
      {
        "symbol": "LTCBTC",
        "orderId": 5,
        "clientOrderId": "Cv1SnyPD3qhqpbjpYEHbd2"
      }
    ]
  }
]

GET /sapi/v1/margin/openOrderList

权重(IP): 10

参数

名称 类型 是否必需 描述
isIsolated STRING NO 是否逐仓杠杆,"TRUE", "FALSE", 默认 "FALSE"
symbol STRING NO 逐仓杠杆必填,全仓杠杆不支持该参数
recvWindow LONG NO 赋值不能大于 60000
timestamp LONG YES

查询杠杆账户交易历史 (USER_DATA)

响应

[
    {
        "commission": "0.00006000",
        "commissionAsset": "BTC",
        "id": 34,
        "isBestMatch": true,
        "isBuyer": false,
        "isMaker": false,
        "orderId": 39324,
        "price": "0.02000000",
        "qty": "3.00000000",
        "symbol": "BNBBTC",
        "isIsolated": false,      // 是否是逐仓symbol交易
        "time": 1561973357171
    },
    {
        "commission": "0.00002950",
        "commissionAsset": "BTC",
        "id": 32,
        "isBestMatch": true,
        "isBuyer": false,
        "isMaker": true,
        "orderId": 39319,
        "price": "0.00590000",
        "qty": "5.00000000",
        "symbol": "BNBBTC",
        "isIsolated": false,      // 是否是逐仓symbol交易
        "time": 1561964645345
    }
]

GET /sapi/v1/margin/myTrades

权重(IP): 10

参数:

名称 类型 是否必需 描述
symbol STRING YES
isIsolated STRING NO 是否逐仓杠杆,"TRUE", "FALSE", 默认 "FALSE"
orderId LONG NO
startTime LONG NO
endTime LONG NO
fromId LONG NO 获取TradeId,默认获取近期交易历史。
limit INT NO 默认 500; 最大 1000.
recvWindow LONG NO 默认值不能大于 60000
timestamp LONG YES

查询账户最大可借贷额度(USER_DATA)

响应

{
    "amount": "1.69248805", // 系统可借充足情况下用户账户当前最大可借额度
    "borrowLimit": "60" // 平台限制的用户当前等级可以借的额度
}

GET /sapi/v1/margin/maxBorrowable

权重(IP): 50

参数:

名称 类型 是否必需 描述
asset STRING YES
isolatedSymbol STRING NO 逐仓交易对,适用于逐仓查询
recvWindow LONG NO 默认值不能大于 60000
timestamp LONG YES

查询最大可转出额 (USER_DATA)

响应

 {
      "amount": "3.59498107"
 }

GET /sapi/v1/margin/maxTransferable

权重(IP): 50

参数:

名称 类型 是否必需 描述
asset STRING YES
isolatedSymbol STRING NO 逐仓交易对,适用于逐仓查询
recvWindow LONG NO 默认值不能大于 60000
timestamp LONG YES

查询Margin账户信息汇总 (USER_DATA)

响应:

{
  "normalBar": "1.5",
  "marginCallBar": "1.3",
  "forceLiquidationBar": "1.1"
}

GET /sapi/v1/margin/tradeCoeff

获取用户个人杠杆账户信息汇总

权重(IP): 10

参数:

名称 类型 是否必需 描述
recvWindow LONG NO
timestamp LONG YES

查询杠杆逐仓账户信息 (USER_DATA)

响应:

不传"symbols"的返回内容

{
   "assets":[
      {
        "baseAsset": 
          {
          "asset": "BTC",
          "borrowEnabled": true,
          "borrowed": "0.00000000",
          "free": "0.00000000",
          "interest": "0.00000000",
          "locked": "0.00000000",
          "netAsset": "0.00000000",
          "netAssetOfBtc": "0.00000000",
          "repayEnabled": true,
          "totalAsset": "0.00000000"
        },
        "quoteAsset": 
        {
          "asset": "USDT",
          "borrowEnabled": true,
          "borrowed": "0.00000000",
          "free": "0.00000000",
          "interest": "0.00000000",
          "locked": "0.00000000",
          "netAsset": "0.00000000",
          "netAssetOfBtc": "0.00000000",
          "repayEnabled": true,
          "totalAsset": "0.00000000"
        },
        "symbol": "BTCUSDT"
        "isolatedCreated": true, 
        "enabled": true, // 账户是否启用,true-启用,false-停用
        "marginLevel": "0.00000000", 
        "marginLevelStatus": "EXCESSIVE", // "EXCESSIVE", "NORMAL", "MARGIN_CALL", "PRE_LIQUIDATION", "FORCE_LIQUIDATION"
        "marginRatio": "0.00000000",
        "indexPrice": "10000.00000000",
        "liquidatePrice": "1000.00000000",
        "liquidateRate": "1.00000000",
        "tradeEnabled": true
      }
    ],
    "totalAssetOfBtc": "0.00000000",
    "totalLiabilityOfBtc": "0.00000000",
    "totalNetAssetOfBtc": "0.00000000" 
}

传"symbols"的返回内容

{
   "assets":[
      {
        "baseAsset": 
        {
          "asset": "BTC",
          "borrowEnabled": true,
          "borrowed": "0.00000000",
          "free": "0.00000000",
          "interest": "0.00000000",
          "locked": "0.00000000",
          "netAsset": "0.00000000",
          "netAssetOfBtc": "0.00000000",
          "repayEnabled": true,
          "totalAsset": "0.00000000"
        },
        "quoteAsset": 
        {
          "asset": "USDT",
          "borrowEnabled": true,
          "borrowed": "0.00000000",
          "free": "0.00000000",
          "interest": "0.00000000",
          "locked": "0.00000000",
          "netAsset": "0.00000000",
          "netAssetOfBtc": "0.00000000",
          "repayEnabled": true,
          "totalAsset": "0.00000000"
        },
        "symbol": "BTCUSDT"
        "isolatedCreated": true, 
        "enabled": true, // 账户是否启用,true-启用,false-停用
        "marginLevel": "0.00000000", 
        "marginLevelStatus": "EXCESSIVE", // "EXCESSIVE", "NORMAL", "MARGIN_CALL", "PRE_LIQUIDATION", "FORCE_LIQUIDATION"
        "marginRatio": "0.00000000",
        "indexPrice": "10000.00000000",
        "liquidatePrice": "1000.00000000",
        "liquidateRate": "1.00000000",
        "tradeEnabled": true
      }
    ]
}

GET /sapi/v1/margin/isolated/account

权重(IP): 10

参数:

名称 类型 是否必需 描述
symbols STRING NO 最多可以传5个symbol; 由","分隔的字符串表示. e.g. "BTCUSDT,BNBUSDT,ADAUSDT"
recvWindow LONG NO 赋值不能大于 60000
timestamp LONG YES

杠杆逐仓账户停用 (TRADE)

响应

{
  "success": true,
  "symbol": "BTCUSDT"
}

DELETE /sapi/v1/margin/isolated/account

停用特定交易对的杠杆逐仓账户。每个交易对 24 小时内仅可停用一次。

权重(UID): 300

参数:

名称 类型 是否必需 描述
symbol STRING YES
recvWindow LONG NO 不能大于 60000
timestamp LONG YES

杠杆逐仓账户启用 (TRADE)

响应

{
  "success": true,
  "symbol": "BTCUSDT"
}

POST /sapi/v1/margin/isolated/account

启用特定交易对的杠杆逐仓账户(仅支持启用之前停用的账户)。

权重(UID): 300

参数

名称 类型 是否必需 描述
symbol STRING YES
recvWindow LONG NO 不能大于 60000
timestamp LONG YES

查询杠杆逐仓账户启用限制 (USER_DATA)

响应

{
  "enabledAccount": 5,
  "maxAccount": 20
}

GET /sapi/v1/margin/isolated/accountLimit

查询杠杆逐仓账户启用限制。

权重(IP): 1

参数:

名称 类型 是否必需 描述
recvWindow LONG NO 不能大于 60000
timestamp LONG YES

获取所有逐仓杠杆交易对(MARKET_DATA)

响应:

[
    {
        "base": "BNB",
        "isBuyAllowed": true,
        "isMarginTrade": true,
        "isSellAllowed": true,
        "quote": "BTC",
        "symbol": "BNBBTC"
    },
    {
        "base": "TRX",
        "isBuyAllowed": true,
        "isMarginTrade": true,
        "isSellAllowed": true,
        "quote": "BTC",
        "symbol": "TRXBTC",
        "delistTime": 1704973040
    },
    {
        "base": "XRP",
        "isBuyAllowed": true,
        "isMarginTrade": true,
        "isSellAllowed": true,
        "quote": "BTC",
        "symbol": "XRPBTC"
    },
    {
        "base": "ETH",
        "isBuyAllowed": true,
        "isMarginTrade": true,
        "isSellAllowed": true,
        "quote": "BTC",
        "symbol": "ETHBTC"
    }   
]

GET /sapi/v1/margin/isolated/allPairs

权重(IP): 10

参数:

名称 类型 是否必需 描述
symbol STRING NO

现货交易和杠杆利息BNB抵扣开关(USER_DATA)

响应:

{
   "spotBNBBurn":true,
   "interestBNBBurn": false   
}

POST /sapi/v1/bnbBurn

权重(IP): 1

参数:

名称 类型 是否必需 描述
spotBNBBurn STRING NO "true" 或 "false", 是否使用BNB支付现货交易的手续费
interestBNBBurn STRING NO "true" 或 "false", 是否使用BNB支付杠杆贷款的利息
recvWindow LONG NO 赋值不能大于 60000
timestamp LONG YES

获取BNB抵扣开关状态 (USER_DATA)

响应:

{
   "spotBNBBurn":true,
   "interestBNBBurn": false   
}

GET /sapi/v1/bnbBurn

权重(IP): 1

参数:

名称 类型 是否必需 描述
recvWindow LONG NO 赋值不能大于 60000
timestamp LONG YES

获取杠杆利率历史 (USER_DATA)

响应:

[
    {
        "asset": "BTC",
        "dailyInterestRate": "0.00025000",
        "timestamp": 1611544731000,
        "vipLevel": 1    
    },
    {
        "asset": "BTC",
        "dailyInterestRate": "0.00035000",
        "timestamp": 1610248118000,
        "vipLevel": 1    
    }
]

GET /sapi/v1/margin/interestRateHistory

权重(IP): 1

参数:

名称 类型 是否必需 描述
asset STRING YES
vipLevel INT NO 默认用户当前等级
startTime LONG NO 默认7天前
endTime LONG NO 默认当天,时间间隔最大为1个月
recvWindow LONG NO 赋值不能大于 60000
timestamp LONG YES

获取全仓杠杆利率及限额 (USER_DATA)

响应:

[
    {
        "vipLevel": 0,
        "coin": "BTC",
        "transferIn": true,
        "borrowable": true,
        "dailyInterest": "0.00026125",
        "yearlyInterest": "0.0953",
        "borrowLimit": "180",
        "marginablePairs": [
            "BNBBTC",
            "TRXBTC",
            "ETHBTC",
            "BTCUSDT"
        ]
    }
]

GET /sapi/v1/margin/crossMarginData

通过VIP等级或用户当前VIP等级获取全仓杠杆利率及限额, 如:https://www.binance.com/en/margin-fee

权重: 1 指定币种; 5 币种参数缺失

参数(IP):

名称 类型 是否必须 描述
vipLevel INT NO 当未发送参数vipLevel时,将返回用户当前vip等级的数据;当发送参数vipLevel时,将返回对应vip等级的数据
coin STRING NO
recvWindow LONG NO 赋值不能大于 60000
timestamp LONG YES

获取逐仓杠杆利率及限额 (USER_DATA)

响应:

[
    {
        "vipLevel": 0,
        "symbol": "BTCUSDT",
        "leverage": "10",
        "data": [
            {
                "coin": "BTC",
                "dailyInterest": "0.00026125",
                "borrowLimit": "270"
            },
            {
                "coin": "USDT",
                "dailyInterest": "0.000475",
                "borrowLimit": "2100000"
            }
        ]
    }
]

GET /sapi/v1/margin/isolatedMarginData

通过VIP等级或用户当前VIP等级获取逐仓杠杆利率及限额, 如: https://www.binance.com/en/margin-fee

权重(IP): 1 指定交易对; 10 交易对参数缺失

参数:

名称 类型 是否必须 描述
vipLevel INT NO 默认为用户当前VIP等级
symbol STRING NO
recvWindow LONG NO 赋值不能大于 60000
timestamp LONG YES

获取逐仓档位信息 (USER_DATA)

响应:

[
    {
        "symbol": "BTCUSDT",
        "tier": 1,
        "effectiveMultiple": "10",
        "initialRiskRatio": "1.111",
        "liquidationRiskRatio": "1.05",
        "baseAssetMaxBorrowable": "9",
        "quoteAssetMaxBorrowable": "70000"
    }
]

GET /sapi/v1/margin/isolatedMarginTier

通过档位获取逐仓杠杆档位数据, 如: https://www.binance.com/en/margin-data

权重(IP): 1

参数:

名称 类型 是否必须 描述
symbol STRING YES
tier INTEGER NO 不传则返回所有逐仓杠杆档位
recvWindow LONG NO 赋值不能大于 60000
timestamp LONG YES

查询目前杠杆账户下单数 (TRADE)

响应:

[

  {
    "rateLimitType": "ORDERS",
    "interval": "SECOND",
    "intervalNum": 10,
    "limit": 10000,
    "count": 0
  },
  {
    "rateLimitType": "ORDERS",
    "interval": "DAY",
    "intervalNum": 1,
    "limit": 20000,
    "count": 0
  }
]

GET /sapi/v1/margin/rateLimit/order

获取用户在当前时间区间内的杠杆账户下单总数。

权重(IP): 20

参数:

名称 类型 是否必需 描述
isIsolated STRING NO 是否逐仓杠杆,"TRUE", "FALSE", 默认 "FALSE"
symbol STRING NO 逐仓交易对,查询逐仓杠杆账户必需
recvWindow LONG NO 赋值不能大于 60000
timestamp LONG YES

全仓币种质押率 (MARKET_DATA)

响应:

[
  {
    "collaterals": [
      {
        "minUsdValue": "0",
        "maxUsdValue": "13000000",
        "discountRate": "1"
      },
      {
        "minUsdValue": "13000000",
        "maxUsdValue": "20000000",
        "discountRate": "0.975"
      },
      {
        "minUsdValue": "20000000",
        "discountRate": "0"
      }
    ],
    "assetNames": [
      "BNX"
    ]
  },
  {
    "collaterals": [
      {
        "minUsdValue": "0",
        "discountRate": "1"
      }
    ],
    "assetNames": [
      "BTC",
      "BUSD",
      "ETH",
      "USDT"
    ]
  }
]

GET /sapi/v1/margin/crossMarginCollateralRatio

权重(IP): 100

参数: None

查询可小额负债转换的资产 (USER_DATA)

查询可小额负债转换的币种

响应:

[
    {
      "asset": "ETH",
      "interest": "0.00083334",
      "principal": "0.001",
      "liabilityAsset": "USDT",
      "liabilityQty": 0.3552
    }
]

GET /sapi/v1/margin/exchange-small-liability

权重(IP): 100

参数:

名称 类型 是否必需 描述
recvWindow LONG NO
timestamp LONG YES

全仓杠杆小额负债转换 (MARGIN)

全仓杠杆小额负债转换

POST /sapi/v1/margin/exchange-small-liability

权重(UID): 3000

参数:

名称 类型 是否必需 描述
assetNames ARRAY YES 小额转换的资产列表,举例: assetNames = BTC,ETH
recvWindow LONG NO
timestamp LONG YES

查询全仓杠杆小额负债转换历史 (USER_DATA)

查询全仓杠杆小额负债转换历史

响应:

{
    "total": 1,
    "rows": [
      {
        "asset": "ETH",
        "amount": "0.00083434",
        "targetAsset": "BUSD",
        "targetAmount": "1.37576819",
        "bizType": "EXCHANGE_SMALL_LIABILITY",
        "timestamp": 1672801339253
      }
    ]
}

GET /sapi/v1/margin/exchange-small-liability-history

权重(UID): 100

参数:

名称 类型 是否必需 描述
current INT YES 当前页面,默认1,最小值为1
size INT YES 页面大小,默认10,最大值为100
startTime LONG NO 默认当前时间30天前的时间戳
endTime LONG NO 默认当前时间戳
recvWindow LONG NO
timestamp LONG YES

查询下小时预估利率 (USER_DATA)

GET /sapi/v1/margin/next-hourly-interest-rate

查询用户币种下小时预估利率

响应:

[
    {
        "asset": "BTC",
        "nextHourlyInterestRate": "0.00000571"
    },
    {
        "asset": "ETH",
        "nextHourlyInterestRate": "0.00000578"
    }
]

权重(IP): 100

参数:

名称 类型 是否必需 描述
assets String YES 资产列表,以逗号分隔,最多20个
isIsolated Boolean YES 是否逐仓杠杆,"TRUE", "FALSE"

查询全仓/逐仓资金流水(USER_DATA)

GET /sapi/v1/margin/capital-flow

查询全仓/逐仓资金流水

响应:

[
  { 
    "id": 123456,
    "tranId": 123123,
    "timestamp": 1691116657000,
    "asset": "USDT",
    "symbol": "BTCUSDT",
    "type": "BORROW",
    "amount": "101"
  },
  {
    "id": 123457,
    "tranId": 123124,
    "timestamp": 1691116658000,
    "asset": "BTC",
    "symbol": "BTCUSDT",
    "type": "REPAY",
    "amount": "10"
  }
]

权重(IP): 100

参数:

名称 类型 是否必需 描述
asset STRING NO
symbol STRING NO 查询逐仓数据时必填
type STRING NO
startTime LONG NO 只支持查询最近90天的数据
endTime LONG NO
fromId LONG NO 如设置fromId, 将返回id > fromId的数据。否则将返回最新数据
limit LONG NO 每次返回的数据条数限制。默认 500; 最大 1000.
recvWindow LONG NO
timestamp LONG YES

查询全仓和逐仓的币种或币对的下架计划 (MARKET_DATA)

GET /sapi/v1/margin/delist-schedule

查询全仓和逐仓的币种或币对的下架计划

响应:

[
  {
    "delistTime": 1686161202000,
    "crossMarginAssets": [
      "BTC",
      "USDT"
    ],
    "isolatedMarginSymbols": [
      "ADAUSDT",
      "BNBUSDT"
    ]
  },
  {
    "delistTime": 1686222232000,
    "crossMarginAssets": [
      "ADA"
    ],
    "isolatedMarginSymbols": []
  }
]

权重(IP): 100

参数:

名称 类型 是否必需 描述
recvWindow LONG NO
timestamp LONG YES

杠杆可用放贷库存查询(USER_DATA)

GET /sapi/v1/margin/available-inventory

杠杆可用放贷库存查询

响应:

{
    "assets": {
        "MATIC": "100000000",
        "STPT": "100000000",
        "TVK": "100000000",
        "SHIB": "97409653"
    },
    "updateTime": 1699272487
}

权重(UID): 50

参数:

名称 类型 是否必需 描述
type STRING YES MARGIN,ISOLATED
recvWindow LONG NO
timestamp LONG YES

杠杆手动强平(MARGIN)

POST /sapi/v1/margin/manual-liquidation

杠杆手动强平

响应:

[
    {
      "asset": "ETH",
      "interest": "0.00083334",
      "principal": "0.001",
      "liabilityAsset": "USDT",
      "liabilityQty": 0.3552
    }
]

权重(UID): 3000

参数:

名称 类型 是否必需 描述
type STRING YES MARGIN,ISOLATED
symbol STRING NO type选择ISOLATED后,symbol需要填入
recvWindow LONG NO
timestamp LONG YES

查询全仓杠杆Pro模式下的负债币种杠杆与保证金率(MARKET_DATA)

GET /sapi/v1/margin/leverageBracket

查询全仓杠杆Pro模式下的负债币种杠杆与保证金率

响应:

[
  {
     "assetNames":[
        "SHIB",
        "FDUSD",
        "BTC",
        "ETH",
        "USDC"
     ],          
     "rank":1,
     "brackets":[
        {
           "leverage":10,
           "maxDebt":1000000.00000000,
           "maintenanceMarginRate":0.02000000,
           "initialMarginRate":0.1112,
           "fastNum":0
        },
        {
           "leverage":3,
           "maxDebt":4000000.00000000,
           "maintenanceMarginRate":0.07000000,
           "initialMarginRate":0.5000,
           "fastNum":60000.0000000000000000
        }
     ]
  }
]

权重(IP): 1

Websocket账户信息推送

Listen Key(现货账户)

生成 Listen Key (USER_STREAM)

响应

{
  "listenKey": "pqia91ma19a5s61cv6a81va65sdf19v8a65a1a5s61cv6a81va65sdf19v8a65a1"
}

POST /api/v3/userDataStream

开始一个新的数据流。除非发送 keepalive,否则数据流于60分钟后关闭。如果该帐户具有有效的listenKey,则将返回该listenKey并将其有效期延长60分钟。 权重: 2

参数:

NONE

数据源: 缓存

延长 Listen Key 有效期 (USER_STREAM)

响应

{}

PUT /api/v3/userDataStream

有效期延长至本次调用后60分钟,建议每30分钟发送一个 ping 。

权重: 2

参数:

名称 类型 是否必需 描述
listenKey STRING YES

数据源: 缓存

关闭 Listen Key (USER_STREAM)

响应

{}

DELETE /api/v3/userDataStream

关闭用户数据流。

权重: 2

参数:

名称 类型 是否必需 描述
listenKey STRING YES

数据源: 缓存

Listen Key(杠杆账户)

生成 Listen Key (USER_STREAM)

响应

{"listenKey":  "T3ee22BIYuWqmvne0HNq2A2WsFlEtLhvWCtItw6ffhhdmjifQ2tRbuKkTHhr"}

POST /sapi/v1/userDataStream

权重: 1

参数:

NONE

延长 Listen Key 有效期 (USER_STREAM)

响应

{}

PUT /sapi/v1/userDataStream

权重: 1

参数:

名称 类型 是否必需 描述
listenKey STRING YES

关闭 ListenKey (USER_STREAM)

响应

{}

DELETE /sapi/v1/userDataStream

权重: 1

参数:

名称 类型 是否必需 描述
listenKey STRING YES

Listen Key(逐仓杠杆账户)

生成 Listen Key (USER_STREAM)

响应:

{
    "listenKey":  "T3ee22BIYuWqmvne0HNq2A2WsFlEtLhvWCtItw6ffhhdmjifQ2tRbuKkTHhr"
}

POST /sapi/v1/userDataStream/isolated

权重: 1

参数:

名称 类型 是否必需 描述
symbol STRING YES

延长 Listen Key 有效期 (USER_STREAM)

响应:

{}

PUT /sapi/v1/userDataStream/isolated

权重: 1

参数:

名称 类型 是否必需 描述
symbol STRING YES
listenKey STRING YES

关闭 ListenKey (USER_STREAM)

响应:

{}

DELETE /sapi/v1/userDataStream/isolated

权重: 1

参数:

名称 类型 是否必需 描述
symbol STRING YES
listenKey STRING YES

Payload: 账户更新

每当帐户余额发生更改时,都会发送一个事件outboundAccountPosition,其中包含可能由生成余额变动的事件而变动的资产。

Payload

{
  "e": "outboundAccountPosition", // 事件类型
  "E": 1564034571105,             // 事件时间
  "u": 1564034571073,             // 账户末次更新时间戳
  "B": [                          // 余额
    {
      "a": "ETH",                 // 资产名称
      "f": "10000.000000",        // 可用余额
      "l": "0.000000"             // 冻结余额
    }
  ]
}

Payload: 余额更新

Payload

{
  "e": "balanceUpdate",         //Event Type
  "E": 1573200697110,           //Event Time
  "a": "ABC",                   //Asset
  "d": "100.00000000",          //Balance Delta
  "T": 1573200697068            //Clear Time
}

当下列情形发生时更新:

Payload: 订单更新

订单通过executionReport事件进行更新。

执行类型:

请查阅公开API参数文档获取更多枚举定义。

Payload

{
  "e": "executionReport",        // 事件类型
  "E": 1499405658658,            // 事件时间
  "s": "ETHBTC",                 // 交易对
  "c": "mUvoqJxFIILMdfAW5iGSOW", // clientOrderId
  "S": "BUY",                    // 订单方向
  "o": "LIMIT",                  // 订单类型
  "f": "GTC",                    // 有效方式
  "q": "1.00000000",             // 订单原始数量
  "p": "0.10264410",             // 订单原始价格
  "P": "0.00000000",             // 止盈止损单触发价格
  "F": "0.00000000",             // 冰山订单数量
  "g": -1,                       // 订单列表 OrderListId
  "C": "",                       // 原始订单自定义ID(原始订单,指撤单操作的对象。撤单本身被视为另一个订单)
  "x": "NEW",                    // 本次事件的具体执行类型
  "X": "NEW",                    // 订单的当前状态
  "r": "NONE",                   // 订单被拒绝的原因
  "i": 4293153,                  // orderId
  "l": "0.00000000",             // 订单末次成交量
  "z": "0.00000000",             // 订单累计已成交量
  "L": "0.00000000",             // 订单末次成交价格
  "n": "0",                      // 手续费数量
  "N": null,                     // 手续费资产类别
  "T": 1499405658657,            // 成交时间
  "t": -1,                       // 成交ID
  "v": 3,                        // 被阻止撮合交易的ID; 这仅在订单因 STP 触发而过期时可见
  "I": 8641984,                  // 请忽略
  "w": true,                     // 订单是否在订单簿上?
  "m": false,                    // 该成交是作为挂单成交吗?
  "M": false,                    // 请忽略
  "O": 1499405658657,            // 订单创建时间
  "Z": "0.00000000",             // 订单累计已成交金额
  "Y": "0.00000000",             // 订单末次成交金额
  "Q": "0.00000000",             // Quote Order Quantity
  "W": 1499405658657,            // Working Time; 订单被添加到 order book 的时间
  "V": "NONE"                    // SelfTradePreventionMode
}

备注: 通过将Z除以z可以找到平均价格。

如果订单是订单列表,则除了显示executionReport事件外,还将显示一个名为ListStatus的事件。

executionReport 中的仅在满足特定条件时才会出现的字段:

字段 名称 描述 示例
d Trailing Delta 出现在追踪止损订单中。 "d": 4
D Trailing Time "D": 1668680518494
j Strategy Id 如果在请求中添加了strategyId参数,则会出现。 "j": 1
J Strategy Type 如果在请求中添加了strategyType参数,则会出现。 "J": 1000000
v Prevented Match Id 只有在因为 STP 导致订单失效时可见。 "v": 3
A Prevented Quantity "A":"3.000000"
B Last Prevented Quantity "B":"3.000000"
u Trade Group Id "u":1
U Counter Order Id "U":37
Cs Counter Symbol "Cs": "BTCUSDT"
pl Prevented Execution Quantity "pl":"2.123456"
pL Prevented Execution Price "pL":"0.10000001"
pY Prevented Execution Quote Qty "pY":"0.21234562"
W Working Time 只有在订单在订单簿上时可见 "W": 1668683798379
b Match Type 只有在订单有分配时可见 "b":"ONE_PARTY_TRADE_REPORT"
a Allocation ID "a":1234
k Working Floor 只有在订单可能有分配时可见 "k":"SOR"
uS UsedSor 只有在订单使用 SOR 时可见 "uS":true

Payload

{
  "e": "listStatus",                // 事件类型
  "E": 1564035303637,               // 事件时间
  "s": "ETHBTC",                    // 交易对
  "g": 2,                           // OrderListId
  "c": "OCO",                       // Contingency Type
  "l": "EXEC_STARTED",              // List Status Type
  "L": "EXECUTING",                 // List Order Status
  "r": "NONE",                      // List 被拒绝的原因
  "C": "F4QN4G8DlFATFlIUQ0cjdD",    // List Client Order ID
  "T": 1564035303625,               // 成交时间
  "O": [                           
    {
      "s": "ETHBTC",                // 交易对
      "i": 17,                      // orderId
      "c": "AJYsMjErWJesZvqlJCTUgL" // clientOrderId
    },
    {
      "s": "ETHBTC",
      "i": 18,
      "c": "bfYPSQdLoqAJeNrOr9adzq"
    }
  ]
}

Listen Key 已过期

当监听 listen key 过期时会发送此事件。此后不会再发送任何事件,直到创建新的 listenKey

正常关闭流时不会推送该事件。

响应

{
  "e": "listenKeyExpired",  // 事件类型
  "E": 1699596037418,     // 事件时间
  "listenKey": "OfYGbUzi3PraNagEkdKuFwUHn48brFsItTdsuiIXrucEvD0rhRXZ7I6URWfE8YE8" 
}

Margin 账户信息推送

Listen Key

获取杠杆账户websocket的Listen Key(USER_STREAM)

响应

{
  "listenKey": "T3ee22BIYuWqmvne0HNq2A2WsFlEtLhvWCtItw6ffhhd"
}

POST /sapi/v1/margin/listen-key

开始一个新的杠杆数据流。

权重(UID): 1

参数:

NONE

延长 Listen Key 有效期 (USER_STREAM)

响应

{}

PUT /sapi/v1/margin/listen-key

有效期延长至本次调用后24小时。

权重(UID): 1

参数:

名称 类型 是否必需 描述
listenKey STRING YES

删除杠杆Listen Key (USER_STREAM)

响应

{}

DELETE /sapi/v1/margin/listen-key

关闭用户数据流。

权重(UID): 3000

参数:

名称 类型 是否必需 描述
listenKey STRING YES

Payload: 负债变化事件

当下列情形发生时,会推送此事件:

Payload

{
   "e": "USER_LIABILITY_CHANGE", // 事件类型
   "E": 1701949801133, // 事件时间
   "a": "BTC", // 资产
   "t": "BORROW", // 负债变更类型
   "p": "0.00000100", // 负债本金数量
   "i": "0.00000000" // 利息数量
}

Payload: Margin Call事件

在用户 margin 账户发生 margin call 事件时,会推送此事件

Payload

{
  "e": "MARGIN_LEVEL_STATUS_CHANGE", // 事件类型
  "E": 1701949763462, // 事件时间
  "l": "1.1", // 杠杆账户风险率
  "s": "MARGIN_CALL" // 杠杆账户状态为Margin Call
}

赚币接口

查询赚币活期产品列表 (USER_DATA)

响应:

{
  "rows": [
    {
      "asset": "BTC",
      "latestAnnualPercentageRate": "0.05000000",  // 实时年化收益率
      "tierAnnualPercentageRate": {               // 额外分级年化收益率
        "0-5BTC": 0.05,
        "5-10BTC": 0.03
      },
      "airDropPercentageRate": "0.05000000",      // 空投年利率
      "canPurchase": true,
      "canRedeem": true,
      "isSoldOut": true,
      "hot": true,                                // 是否热推
      "minPurchaseAmount": "0.01000000",
      "productId": "BTC001",
      "subscriptionStartTime": "1646182276000",
      "status": "PURCHASING"                      // 预热,申购中,申购结束
    }
  ],
  "total": 1
}

GET /sapi/v1/simple-earn/flexible/list

权重(IP): 150

参数:

名称 类型 是否必需 描述
asset STRING NO
current LONG NO 当前查询页。 开始值 1,默认:1
size LONG NO 默认:10,最大:100
recvWindow LONG NO
timestamp LONG YES

查询赚币定期产品列表(USER_DATA)

响应:

{
  "rows": [
    {
      "projectId": "Axs*90",
      "detail": {
        "asset": "AXS",                //锁仓资产
        "rewardAsset": "AXS",          //收益资产
        "duration": 90,                //锁仓周期(天)
        "renewable": true,             //项目支持续期锁仓
        "isSoldOut": true,
        "apr": "1.2069",
        "status": "CREATED",           //CREATED新创建;PURCHASING申购中;
        "subscriptionStartTime": "1646182276000",
        "extraRewardAsset": "BNB",
        "extraRewardAPR": "0.23"
      },
      "quota": {
        "totalPersonalQuota": "2",     //个人总额度
        "minimum": "0.001"              //单笔最小
      }
    }
  ],
  "total": 1
}

GET /sapi/v1/simple-earn/locked/list

权重(IP): 150

参数:

名称 类型 是否必需 描述
asset STRING NO
current LONG NO 当前查询页。 开始值 1,默认:1
size LONG NO 默认:10,最大:100
recvWindow LONG NO
timestamp LONG YES

申购活期产品 (TRADE)

响应:

{
  "purchaseId": 40607,
  "success": true
}

POST /sapi/v1/simple-earn/flexible/subscribe

权重(IP): 1

频次限制:每个账户最多三秒一次

参数:

名称 类型 是否必需 描述
productId STRING YES
amount DECIMAL YES
autoSubscribe BOOLEAN NO true 或者 false, 默认 true.
sourceAccount ENUM NO SPOT,FUND,ALL, 默认 SPOT
recvWindow LONG NO
timestamp LONG YES

申购定期产品(TRADE)

响应:

{
  "purchaseId": 40607,
  "positionId": "12345",
  "success": true
}

POST /sapi/v1/simple-earn/locked/subscribe

权重(IP): 1

频次限制:每个账户最多三秒一次

参数:

名称 类型 是否必需 描述
projectId STRING YES
amount DECIMAL YES
autoSubscribe BOOLEAN NO true 或者 false, 默认 true.
sourceAccount ENUM NO SPOT,FUND,ALL, 默认 SPOT
recvWindow LONG NO
timestamp LONG YES

赎回活期产品 (TRADE)

响应:

{
  "redeemId": 40607,
  "success": true
}

POST /sapi/v1/simple-earn/flexible/redeem

权重(IP): 1

频次限制:每个账户最多三秒一次

参数:

名称 类型 是否必需 描述
productId STRING YES
redeemAll BOOLEAN NO true 或者 false, 默认 false
amount DECIMAL NO 当redeemAll为false时必填
destAccount ENUM NO SPOT,FUND, 默认 SPOT
recvWindow LONG NO
timestamp LONG YES

赎回定期产品(TRADE)

响应:

{
  "redeemId": 40607,
  "success": true
}

POST /sapi/v1/simple-earn/locked/redeem

权重(IP): 1

频次限制:每个账户最多三秒一次

参数:

名称 类型 是否必需 描述
positionId STRING YES "1234"
recvWindow LONG NO
timestamp LONG YES

获取活期产品持仓(USER_DATA)

响应:

{
  "rows": [
    {
      "totalAmount": "75.46000000",
      "tierAnnualPercentageRate": {
        "0-5BTC": 0.05,
        "5-10BTC": 0.03
      },
      "latestAnnualPercentageRate": "0.02599895",
      "yesterdayAirdropPercentageRate": "0.02599895",
      "asset": "USDT",
      "airDropAsset": "BETH",
      "canRedeem": true,
      "collateralAmount": "232.23123213",
      "productId": "USDT001",
      "yesterdayRealTimeRewards": "0.10293829",
      "cumulativeBonusRewards": "0.22759183",
      "cumulativeRealTimeRewards": "0.22759183",
      "cumulativeTotalRewards": "0.45459183",
      "autoSubscribe": true
    }
  ],
  "total": 1
}

GET /sapi/v1/simple-earn/flexible/position

权重(IP): 150

参数:

名称 类型 是否必需 描述
asset STRING NO
productId STRING NO
current LONG NO 当前查询页。 开始值 1,默认:1
size LONG NO 默认:10,最大:100
recvWindow LONG NO
timestamp LONG YES

获取定期产品持仓 (USER_DATA)

响应:

{
  "rows": [
    {
      "positionId": "123123",
      "projectId": "Axs*90",
      "asset": "AXS",
      "amount": "122.09202928",
      "purchaseTime": "1646182276000",
      "duration": "60",
      "accrualDays": "4",
      "rewardAsset": "AXS",
      "APY": "0.2032",
      "rewardAmt": "5.17181528",
      "extraRewardAsset": "BNB",
      "extraRewardAPR": "0.0203",
      "estExtraRewardAmt": "5.17181528",
      "nextPay": "1.29295383",
      "nextPayDate": "1646697600000",
      "payPeriod": "1",
      "redeemAmountEarly": "2802.24068892",
      "rewardsEndDate": "1651449600000",
      "deliverDate": "1651536000000",
      "redeemPeriod": "1",
      "redeemingAmt": "232.2323",
      "partialAmtDeliverDate": "1651536000000",
      "canRedeemEarly": true,
      "canFastRedemption": true,
      "autoSubscribe": true,
      "type": "AUTO",
      "status": "HOLDING",
      "canReStake": true,
      "reStakeInfo": {
        "reStakeRate": "0.05",
        "reStakeAmount": "0.02321232",
        "reStakeDuration": "90",
        "reStakeApr": "0.29",
        "estRewards": "0.00232382",
        "reStakeRewardsEndDate": "1651449600000",
        "reStakeDeliverDate": "1651536000000"
      }
    }
  ],
  "total": 1
}

GET /sapi/v1/simple-earn/locked/position

权重(IP): 150

参数:

名称 类型 是否必需 描述
asset STRING NO
positionId STRING NO
projectId STRING NO
current LONG NO 当前查询页。 开始值 1,默认:1
size LONG NO 默认:10,最大:100
recvWindow LONG NO
timestamp LONG YES

赚币账户(USER_DATA)

响应:

{
  "totalAmountInBTC": "0.01067982",
  "totalAmountInUSDT": "77.13289230",
  "totalFlexibleAmountInBTC": "0.00000000",
  "totalFlexibleAmountInUSDT": "0.00000000",
  "totalLockedInBTC": "0.01067982",
  "totalLockedInUSDT": "77.13289230"
}

GET /sapi/v1/simple-earn/account

权重(IP): 150

参数:

名称 类型 是否必需 描述
recvWindow LONG NO
timestamp LONG YES

查询活期申购记录(USER_DATA)

响应:

{
  "rows": [
    {
      "amount": "100.00000000",
      "asset": "USDT",
      "time": 1575018510000,
      "purchaseId": 26055,
      "type": "AUTO", // AUTO为自动申购,NORMAL为普通申购,CONVERT为定期转活期,LOAN为活期质押借币抵押物申购,AI为定投后申购,TRANSFER为币安宝定期转活期
      "sourceAccount": "SPOT", // SPOT为现货账户, FUNDING为资金账户, SPOTANDFUNDING为现货和资金账户 
      "amtFromSpot": "30", // 仅当sourceAccount为SPOTANDFUNDING时展示
      "amtFromFunding": "70", // 仅当sourceAccount为SPOTANDFUNDING时展示
      "status": "SUCCESS" // PURCHASING 申购中/SUCCESS 申购成功/FAILED 申购失败
    }
  ],
  "total": 1
}

GET /sapi/v1/simple-earn/flexible/history/subscriptionRecord

权重(IP): 150

参数:

名称 类型 是否必需 描述
productId STRING NO
purchaseId STRING NO
asset STRING NO
startTime LONG NO
endTime LONG NO
current LONG NO 当前查询页。 开始值 1, 默认:1
size LONG NO 默认:10,最大:100
recvWindow LONG NO
timestamp LONG YES

查询定期申购记录 (USER_DATA)

响应:

{
  "rows":[
    {
      "positionId": "123123",
      "purchaseId": 26055,
      "time": 1575018510000,
      "asset": "BNB",
      "amount": "21312.23223",
      "lockPeriod": "30",
      "type": "AUTO", // NORMAL为普通申购,AUTO为自动续期,ACTIVITY为活动类型申购,TRIAL为体验金申购,RESTAKE为续申购活动
      "sourceAccount": "SPOT", //SPOT为现货账户, FUNDING为资金账户, SPOTANDFUNDING为现货和资金账户
      "amtFromSpot": "30",     //仅当sourceAccount为SPOTANDFUNDING时展示
      "amtFromFunding": "70",  //仅当sourceAccount为SPOTANDFUNDING时展示
      "status": "SUCCESS" // PURCHASING 申购中/SUCCESS 申购成功/FAILED申购失败
    }
  ],
  "total": 1
}

GET /sapi/v1/simple-earn/locked/history/subscriptionRecord

权重(IP): 150

参数:

名称 类型 是否必需 描述
purchaseId STRING NO
asset STRING NO
startTime LONG NO
endTime LONG NO
current LONG NO 当前查询页。 开始值 1, 默认:1
size LONG NO 默认:10,最大:100
recvWindow LONG NO
...

查询活期赎回记录 (USER_DATA)

响应:

{
  "rows": [
    {
      "amount": "10.54000000",
      "asset": "USDT",
      "time": 1577257222000,
      "productId": "USDT001",
      "redeemId": 40607,
      "destAccount":"SPOT", // SPOT, FUNDING
      "status": "PAID"
    }
  ],
  "total": 1
}

GET /sapi/v1/simple-earn/flexible/history/redemptionRecord

权重(IP): 150

参数:

名称 类型 是否必需 描述
productId STRING NO
redeemId STRING NO
asset STRING NO
startTime LONG NO
endTime LONG NO
current LONG NO 当前查询页。 开始值 1, 默认:1
size LONG NO 默认:10,最大:100
recvWindow LONG NO
timestamp LONG YES

...

查询定期赎回记录 (USER_DATA)

响应:

{
"rows": [
  {
    "positionId":"123123",
    "redeemId": 40607,
    "time":1575018510000,
    "asset":"BNB",
    "lockPeriod":"30",
    "amount":"21312.23223",
    "type": "MATURE", //MATURE为赎回至现货账户,NEW_TRANSFERRED为赎回至活期产品,AHEAD为提前赎回类型
    "deliverDate":"1575018510000",  // 赎回到账时间
    "status":"PAID" // CREATED赎回中,PAID赎回成功,FAILED赎回失败
  }
]
"total": 1
}

GET /sapi/v1/simple-earn/locked/history/redemptionRecord

权重(IP): 150

参数:

名称 类型 是否必需 描述
positionId STRING NO
redeemId STRING NO
asset STRING NO
startTime LONG NO
endTime LONG NO
current LONG NO 当前查询页。 开始值 1, 默认:1
size LONG NO 默认:10,最大:100
recvWindow LONG NO
timestamp LONG YES

查询活期收益记录 (USER_DATA)

响应:

{
  "rows": [
    {
      "asset": "BUSD",
      "rewards": "0.00006408",
      "projectId": "USDT001",
      "type": "BONUS",
      "time": 1577233578000
    },
    {
      "asset": "USDT",
      "rewards": "0.00687654",
      "projectId": "USDT001",
      "type": "REALTIME",
      "time": 1577233562000
    }
  ],
  "total": 2
}

GET /sapi/v1/simple-earn/flexible/history/rewardsRecord

权重(IP): 150

参数:

名称 类型 是否必需 描述
productId STRING NO
asset STRING NO
startTime LONG NO
endTime LONG NO
type ENUM YES "BONUS"额外分级收益,"REALTIME"实时收益,"REWARDS"历史收益
current LONG NO 当前查询页。 开始值 1, 默认:1
size LONG NO 默认:10,最大:100
recvWindow LONG NO
timestamp LONG YES

查询定期收益记录 (USER_DATA)

响应:

{
  "rows": [
    {
      "positionId": "123123",
      "time": 1575018510000,
      "asset": "BNB",
      "lockPeriod": "30",
      "amount": "21312.23223"
    }
  ],
  "total": 1
}

GET /sapi/v1/simple-earn/locked/history/rewardsRecord

权重(IP): 150

参数:

名称 类型 是否必需 描述
positionId STRING NO
asset STRING NO
startTime LONG NO
endTime LONG NO
current LONG NO 当前查询页。 开始值 1, 默认:1
size LONG NO 默认:10,最大:100
recvWindow LONG NO
timestamp LONG YES

设置活期自动申购 (USER_DATA)

响应:

{
  "success": true
}

POST /sapi/v1/simple-earn/flexible/setAutoSubscribe

为活期产品设置自动申购功能

权重(IP): 150

参数:

名称 类型 是否必需 描述
productId STRING YES
autoSubscribe BOOLEAN YES true 或者 false
recvWindow LONG NO
timestamp LONG

设置定期自动申购 (USER_DATA)

响应:

{
  "success": true
}

POST /sapi/v1/simple-earn/locked/setAutoSubscribe

为定期产品设置自动申购功能

权重(IP): 150

参数:

名称 类型 是否必需 描述
positionId STRING YES
autoSubscribe BOOLEAN YES true 或者 false
recvWindow LONG NO
timestamp LONG YES

查询活期个人剩余额度 (USER_DATA)

响应:

{
  "leftPersonalQuota": "1000"
}

GET /sapi/v1/simple-earn/flexible/personalLeftQuota

权重(IP): 150

参数:

名称 类型 是否必需 描述
productId STRING YES
recvWindow LONG NO
timestamp LONG YES

查询定期个人剩余额度 (USER_DATA)

响应:

{
  "leftPersonalQuota": "1000"
}

GET /sapi/v1/simple-earn/locked/personalLeftQuota

权重(IP): 150

参数:

名称 类型 是否必需 描述
projectId STRING YES
recvWindow LONG NO
timestamp LONG YES

活期申购预览(USER_DATA)

响应:

{
  "totalAmount": "1232.32230982",
  "rewardAsset": "BUSD",
  "airDropAsset": "BETH",
  "estDailyBonusRewards": "0.22759183",
  "estDailyRealTimeRewards": "0.22759183",
  "estDailyAirdropRewards": "0.22759183"
}

GET /sapi/v1/simple-earn/flexible/subscriptionPreview

权重(IP): 150

参数:

名称 类型 是否必需 描述
productId STRING YES
amount DECIMAL YES
recvWindow LONG NO
timestamp LONG YES

定期申购预览(USER_DATA)

响应:

[
  {
    "rewardAsset": "AXS",
    "totalRewardAmt": "5.17181528",
    "extraRewardAsset": "BNB",
    "estTotalExtraRewardAmt": "5.17181528",
    "nextPay": "1.29295383",
    "nextPayDate": "1646697600000",
    "valueDate": "1646697600000",
    "rewardsEndDate": "1651449600000",
    "deliverDate": "1651536000000",
    "nextSubscriptionDate": "1651536000000"
  }
]

GET /sapi/v1/simple-earn/locked/subscriptionPreview

权重(IP): 150

参数:

名称 类型 是否必需 描述
projectId STRING YES
amount DECIMAL YES
autoSubscribe BOOLEAN NO true 或者 false,默认true
recvWindow LONG NO
timestamp LONG YES

获取利率历史(USER_DATA)

响应:

{
  "rows": [
    {
      "productId": "BUSD001",
      "asset": "BUSD",
      "annualPercentageRate": "0.00006408",
      "time": 1577233578000
    }
  ],
  "total": "1"
}

GET /sapi/v1/simple-earn/flexible/history/rateHistory

权重(IP): 150

参数:

名称 类型 是否必需 描述
productId STRING YES
startTime LONG NO
endTime LONG NO
current LONG NO 当前查询页。 开始值 1, 默认:1
size LONG NO 默认:10,最大:100
recvWindow LONG NO
timestamp LONG YES

获取抵押物记录(USER_DATA)

响应:

{
  "rows": [
    {
      "amount": "100.00000000",
      "productId": "BUSD001",
      "asset": "USDT",
      "createTime": 1575018510000,
      "type": "REPAY",
      "productName": "USDT",
      "orderId": 26055
    }
  ],
  "total": "1"
}

GET /sapi/v1/simple-earn/flexible/history/collateralRecord

权重(IP): 150

参数:

名称 类型 是否必需 描述
productId STRING NO
startTime LONG NO
endTime LONG NO
current LONG NO 当前查询页。 开始值 1, 默认:1
size LONG NO 默认:10,最大:100
recvWindow LONG NO
timestamp LONG YES

双币投资接口

获得双币产品列表(USER_DATA)

响应:

{
    "total": 1,
    "list": [
        {
            "id": "741590",
            "investCoin": "USDT",
            "exercisedCoin": "BNB",
            "strikePrice": "380",
            "duration": 4,
            "settleDate": 1709020800000,
            "purchaseDecimal": 8,
            "purchaseEndTime": 1708934400000,
            "canPurchase": true, //true, false
            "apr": "0.6076",
            "orderId": 8257205859,
            "minAmount": "0.1",
            "maxAmount": "25265.7",
            "createTimestamp": 1708560084000,
            "optionType": "PUT",
            "isAutoCompoundEnable": true, //true, false
            "autoCompoundPlanList": [
                "STANDARD",
                "ADVANCE"
            ]
        }
    ]
}

GET /sapi/v1/dci/product/list

获得双币产品列表

权重(IP): 1

参数:

名称 类型 是否必需 描述
optionType STRING YES 输入CALL 或者 PUT
exercisedCoin STRING YES 行权币种,例如:如果您认购高卖产品(看涨期权),您应该输入:optionType:CALL,exercisedCoin:USDT,investCoin:BNB; 如果您认购低买产品(看跌期权),您应该输入: optionType:PUT,exercisedCoin:BNB,investCoin:USDT
investCoin STRING YES 申购币种,例如:如果您认购高卖产品(看涨期权),您应该输入:optionType:CALL,exercisedCoin:USDT,investCoin:BNB; 如果您认购低买产品(看跌期权),您应该输入: optionType:PUT,exercisedCoin:BNB,investCoin:USDT
pageSize LONG NO 默认: 10, 最大:100
pageIndex INT NO 默认:1
recvWindow LONG NO 该值不能大于 60000
timestamp LONG YES

申购双币产品(USER_DATA)

响应:

{
  "positionId": 10208824,
  "investCoin": "BNB",
  "exercisedCoin": "USDT",
  "subscriptionAmount": "0.002",
  "duration": 4,
  "autoCompoundPlan": "STANDARD", //基础计划, 进阶计划;autoCompoundPlan为None时此字段不显示
  "strikePrice": "380",
  "settleDate": 1709020800000,
  "purchaseStatus": "PURCHASE_SUCCESS",
  "apr": "0.7397",
  "orderId": 8259117597,
  "purchaseTime": 1708677583874,
  "optionType": "CALL"
}

POST /sapi/v1/dci/product/subscribe

申购双币产品

权重(IP): 1

参数:

名称 类型 是否必需 描述
id STRING YES /sapi/v1/dci/product/list 获得id
orderId STRING YES /sapi/v1/dci/product/list 获得orderId
depositAmount DECIMAL YES 申购金额
autoCompoundPlan ENUM YES 输入参数:NONE, STANDARD, ADVANCED, NONE=关闭自动复投计划,STANDARD= 基础计划,ADVANCED= 进阶计划
recvWindow LONG NO 该值不能大于 60000
timestamp LONG YES

失败消息: * Products are not available. 代表APR变小或者订单不可用。 * Failed. 代表系统或者网络错误。

获得双币产品持仓状态(USER_DATA)

响应:

{
    "total": 1,
    "list": [
        {
            "id": "10160533", //positionId
            "investCoin": "USDT",
            "exercisedCoin": "BNB",
            "subscriptionAmount": "0.5",
            "strikePrice": "330",
            "duration": 4,
            "settleDate": 1708416000000,
            "purchaseStatus": "PURCHASE_SUCCESS",
            "apr": "0.0365",
            "orderId": 7973677530,
            "purchaseEndTime": 1708329600000, //PENDING, PURCHASE_SUCCESS, SETTLED, PURCHASE_FAIL, REFUNDING, REFUND_SUCCESS, SETTLING
            "optionType": "PUT",
            "autoCompoundPlan": "STANDARD" //NULL, STANDARD, ADVANCED
        }
    ]
}

GET /sapi/v1/dci/product/positions

获得双币产品持仓状态(批量接口)

权重(IP): 1

参数:

名称 类型 是否必需 描述
status ENUM NO PENDING:产品申购中,将稍后给出结果;PURCHASE_SUCCESS:申购成功;SETTLED: 产品已经结算;PURCHASE_FAIL:申购失败;REFUNDING:退款中;REFUND_SUCCESS:退款成功,资金返回现货账户; SETTLING:产品正在结算中,如果不填写该字段,则返回所有持仓信息。
pageSize LONG NO 默认: 10, 最大:100
pageIndex INT NO 默认:1
recvWindow LONG NO 该值不能大于 60000
timestamp LONG YES

查询双币产品账户(USER_DATA)

响应:

{
   "totalAmountInBTC": "0.01067982",   //BTC总值
   "totalAmountInUSDT": "77.13289230" //USDT等价于BTC的总值
}

GET /sapi/v1/dci/product/accounts

查询双币产品账户

权重(IP): 1

参数:

名称 类型 是否必需 描述
recvWindow LONG NO 该值不能大于 60000
timestamp LONG YES

改变自动复投状态(USER_DATA)

响应:

{
    "positionId":"123456789"
    "autoCompoundPlan":"ADVANCED", //NONE,STANDARD,ADVANCED
}

POST /sapi/v1/dci/product/auto_compound/edit-status

改变自动复投状态

权重(IP): 1

限频: 每个账户最多1次/秒

参数:

名称 类型 是否必需 描述
positionId STRING YES /sapi/v1/dci/product/positions获得持仓id
AutoCompoundPlan STRING YES NONE:关闭自动复投计划;STANDARD:基础计划;ADVANCED:进阶计划
recvWindow LONG NO 该值不能大于 60000
timestamp LONG YES

注意:

定投接口

查询允许申购币种列表 (USER_DATA)

响应:

{
    "targetAssets": [
        "BTC"
    ],
    "autoInvestAssetList": [
        {
            "targetAsset": "BTC",
            "roiAndDimensionTypeList": [
                {
                    "simulateRoi": "5.004",
                    "dimensionValue": "3",
                    "dimensionUnit": "year"
                },
                {
                    "simulateRoi": "2.004",
                    "dimensionValue": "1",
                    "dimensionUnit": "year"
                },
                {
                    "simulateRoi": "1.004",
                    "dimensionValue": "6",
                    "dimensionUnit": "month"
                },
                {
                    "simulateRoi": "0.904",
                    "dimensionValue": "3",
                    "dimensionUnit": "month"
                },
                {
                    "simulateRoi": "0.14",
                    "dimensionValue": "7",
                    "dimensionUnit": "day"
                }
            ]
        }
    ]
}

GET /sapi/v1/lending/auto-invest/target-asset/list

权重(IP): 1

参数:

名称 类型 是否必需 描述
targetAsset STRING NO
size LONG NO 默认: 8, 最多:100
current LONG NO 当前查询页。 从 1开始。 默认:1
recvWindow LONG NO 不能大于 60000
timestamp LONG YES

查询申购币种投资回报率(USER_DATA)

响应:

[
    {
        "date": "1648378800000", // ROI计算开始日期
        "simulateRoi": "1.75" 
    },
    {
        "date": "1648478800000",
        "simulateRoi": "2.9"
    }
]

GET /sapi/v1/lending/auto-invest/target-asset/roi/list

查询定投允许申购的币种的投资回报率列表

权重(IP): 1

参数:

名称 类型 是否必需 描述
targetAsset STRING YES e.g "BTC"
hisRoiType ENUM YES FIVE_YEAR,THREE_YEAR,ONE_YEAR,SIX_MONTH,THREE_MONTH,SEVEN_DAY
recvWindow LONG NO 不能大于 60000
timestamp LONG YES

查询申购币种和投资币种列表(USER_DATA)

响应:

{    
    "targetAssets": [
        "BTC",
        "BNB"
    ],    
   "sourceAssets": [
        "USDT",
        "BUSD"
    ],
}

GET /sapi/v1/lending/auto-invest/all/asset

查询定投申购币种和投资币种列表

权重(IP): 1

参数:

名称 类型 是否必需 描述
recvWindow LONG NO 不能大于 60000
timestamp LONG YES

查询投资币种列表(USER_DATA)

响应:

{
    "feeRate": "0.002",
    "taxRate": "0.001",
    "sourceAssets": [
        {
            "sourceAsset": "USDT",
            "assetMinAmount": "0.1" ,
            "assetMaxAmount": "1000000",
            "scale": "2",
            "flexibleAmount":"1111"       
        },
        {
            "sourceAsset": "BUSD",
            "assetMinAmount": "0.1" ,
            "assetMaxAmount": "1000000",
            "scale": "2",
            "flexibleAmount":"1111"              
        }
    ]
}

GET /sapi/v1/lending/auto-invest/source-asset/list

查询定投投资的币种列表

权重(IP): 1

参数:

名称 类型 是否必需 描述
targetAsset Array<STRING> NO BTC、ETH、BNB
indexId Long NO 指数identifier, value = 1
usageType STRING YES "RECURRING", "ONE_TIME"
flexibleAllowedToUse BOOLEAN NO
sourceType ENUM NO MAIN_SITE Binance用户,TRBinance Turkey用户
recvWindow LONG NO 不能大于 60000
timestamp LONG YES

创建定投计划 (TRADE)

响应:

{
  "planId": 12345, //成功创建后planId不变
  "nextExecutionDateTime":1648378800000, //计划下次执行时间
}

POST /sapi/v1/lending/auto-invest/plan/add

创建定投计划

权重(IP): 1

参数:

名称 类型 是否必需 描述
sourceType ENUM YES "MAIN_SITE" 币安,“TR”为币安土耳其
requestId STRING NO 若不为空, 字段规则为 sourceType + unique string e.g: TR12354859
planType ENUM YES “SINGLE”,”PORTFOLIO”,”INDEX”
indexId LONG NO 只有当 planType = INDEX , value = 1
subscriptionAmount DECIMAL YES Fiat&stablecoin: 2dp, BNB/ETH/BTC: 4dp
subscriptionCycle ENUM YES "H1", "H4", "H8","H12", "WEEKLY","DAILY","MONTHLY","BI_WEEKLY"
subscriptionStartDay INTEGER NO “1”,...”31”; 如果 “subscriptionCycleNumberUnit” = “MONTHLY”则必填,数值必须为 UTC+0
subscriptionStartWeekday ENUM NO “MON”,”TUE”,”WED”,”THU”,”FRI”,”SAT”,”SUN”; 如果 “subscriptionCycleNumberUnit” = “MONTHLY”则必填,数值必须为 UTC+0
subscriptionStartTime INTEGER YES “0,1,2,3,4,5,6,7,8,..23”;数值必须为 UTC+0
sourceAsset STRING YES 如 “USDT”
flexibleAllowedToUse BOOLEAN NO true/false;true:使用 flexible wallet
details Array<PortfolioDetail> YES sum(all node's percentage) == 100,若作为请求参数发送, 可参考以下格式details[0].targetAsset=BTC,请求参数的式例:details[0].targetAsset=BTC details[0].percentage=60 details[1].targetAsset=ETH details[1].percentage=40
recvWindow LONG NO 不超过 60000
timestamp LONG YES

编辑定投计划 (TRADE)

响应:

{
  "planId": 12345, //成功创建后planId不变
  "nextExecutionDateTime":1648378800000, //计划下次执行时间
}

POST /sapi/v1/lending/auto-invest/plan/edit

编辑定投计划

权重(IP): 1

参数:

名称 类型 是否必需 描述
planId LONG YES 计划编号
subscriptionAmount DECIMAL YES Fiat&Stablecoin: 2dp, BNB/ETH/BTC: 4dp
subscriptionCycle ENUM YES "H1", "H4", "H8","H12", "WEEKLY","DAILY","MONTHLY","BI_WEEKLY"
subscriptionStartDay INTEGER NO “1”,...”31”; 如果 “subscriptionCycleNumberUnit” = “MONTHLY”则必填,数值必须为 UTC+0
subscriptionStartWeekday ENUM NO “MON”,”TUE”,”WED”,”THU”,”FRI”,”SAT”,”SUN”; 如果 “subscriptionCycleNumberUnit” = “MONTHLY”则必填,数值必须为 UTC+0
subscriptionStartTime INTEGER YES “0,1,2,3,4,5,6,7,8,..23”;Must be sent in form of UTC+0
sourceAsset STRING YES 如 “USDT”
flexibleAllowedToUse BOOLEAN NO true/false;true:使用 flexible wallet
details Array<PortfolioDetail> YES sum(all node's percentage) == 100,若作为请求参数发送, 可参考以下格式details[0].targetAsset=BTC,请求参数的式例:details[0].targetAsset=BTC details[0].percentage=60 details[1].targetAsset=ETH details[1].percentage=40
recvWindow LONG NO no more than 60000
timestamp LONG YES

定投计划状态管理 (TRADE)

响应:

{
  "planId": 12345, 
  "nextExecutionDateTime":1648378800000,
  "status":"ONGOING" //状态
}

POST /sapi/v1/lending/auto-invest/plan/edit-status

定投计划状态管理

权重(IP): 1

参数:

名称 类型 是否必需 描述
planId LONG YES 计划编号
status ENUM YES “ONGOING”,”PAUSED","REMOVED"
recvWindow LONG NO no more than 60000
timestamp LONG YES

查询定投计划列表 (USER_DATA)

响应:

当planType为 SINGLE/PORTFOLIO

{
        "planValueInUSD": "123",
        "planValueInBTC":"0.1",
        "pnlInUSD":"120",
        "roi":"2.3",
        "plans": [
            {
                "planId": 12345,
                "planType": "SINGLE",
                "editAllowed": "true",
                "creationDateTime": 1648378800000,
                "firstExecutionDateTime": 1648378800000, //first subscription date time
                "nextExecutionDateTime": 1648378800000,
                "status": "ONGOING", // ONGOING,PAUSED
                "lastUpdatedDateTime": 1648378800000,
                "targetAsset": "BTC",
                "totalTargetAmount":"0.111",
                "sourceAsset": "BUSD",
                "totalInvestedInUSD":"4.555",
                "subscriptionAmount": "0.1",
                "subscriptionCycle": "WEEKLY",
                "subscriptionStartDay": null,
                "subscriptionStartWeekday" : "MON",
                "subscriptionStartTime": "1",
                "sourceWallet": "SPOT_WALLET",
                "flexibleAllowedToUse": "false",
                "planValueInUSD": "101.2",
                "pnlInUSD": "101.2",
                "roi": "1.02"
            }
        ]
}  

当planType为 INDEX

{
    "planValueInUSD": "123",
    "planValueInBTC": "0.1",
     "plans": [
        {
            "planId": 12345,
            "planType": "INDEX",
            "editAllowed": "true",
            "creationDateTime": 1648378800000,
            "firstExecutionDateTime": 1648378800000, //first subscription date time
            "nextExecutionDateTime": 1648378800000,
            "status": "ONGOING",
            "lastUpdatedDateTime": 1648378800000,
            "targetAsset": "BTC",
            "sourceAsset": "BUSD",
            "totalInvestedInUSD":"4.555",
            "subscriptionAmount": "0.1",
            "subscriptionCycle": "DAILY",
            "subscriptionStartDay": "1",
            "subscriptionStartWeekday" : null,
            "subscriptionStartTime": "2",
            "sourceWallet": "SPOT",
            "flexibleAllowedToUse": "false",

        }
    ]
}  

GET /sapi/v1/lending/auto-invest/plan/list

查询定投计划列表

权重(IP): 1

参数:

名称 类型 是否必需 描述
planType STRING YES “SINGLE”,”PORTFOLIO”,”INDEX”用以区分查询计划类型
recvWindow LONG NO 不超过60000
timestamp LONG YES

查询定投计划详情 (USER_DATA)

响应:

{    
    "planId": 111212,
    "planType": "INDEX", // this is the plan type: "SINGLE","PORTFOLIO","INDEX"
    "editAllowed": "true",  //whether this plan is allowed to be modified
    "flexibleAllowedToUse": "false",
    "creationDateTime": 1648378800000,  // date time that this plan is created. YYYY-MM-DD HH:mm:SS e.g 2022-01-07 08:00:00
    "firstExecutionDateTime": 1648378800000, //first subscription date time
    "nextExecutionDateTime": 1648378800000, //next subscription date time
    "status": "ONGOING", //plan status of the selected plan
    "targetAsset": "BTC",
    "sourceAsset": "BUSD", //source asset of the plan created
    "planValueInUSD": "101.2",  //market value of the plan
    "pnlInUSD": "101.2",    // PNL of the plan in USD
    "roi": "1.023",         //ROI of the plan
    "totalInvestedInUSD": "122",  //total source asset invested in equivilent of USD
    "details": [
        {
            "targetAsset": "ADA",
            "averagePriceInUSD": "3.4",  //average price of the asset in USD
            "totalInvestedInUSD": "222.21", //total source asset invested for this target asset in equivilent of USD
            "purchasedAmount": "122.12345678", //purchased amount of target asset
            "purchasedAmountUnit": "ADA",
            "pnlInUSD": "109.2",   //PNL denominated in USD
            "roi": "0.1",    //ROI calculated in decimal
            "percentage": "50", //asset allocation in the plan. If it's single plan, then it's 100
            "assetStatus":"ACTIVE", // ACTIVE / INACTIVE whether this asset is still being subscribed in this plan
            "availableAmount": "122.12345678", // Only for planType = INDEX
            "availableAmountUnit": "ADA",      // Only for planType = INDEX
            "redeemedAmout": "122.12345678",   // Only for planType = INDEX
            "redeemedAmoutUnit": "ADA",        // Only for planType = INDEX
            "assetValueInUSD": "101.2"         // Only for planType = INDEX
        }
    ]
}  

GET /sapi/v1/lending/auto-invest/plan/id

查询计划详情

权重(IP): 1

参数:

名称 类型 是否必需 描述
planId LONG NO 计划编号
requestId STRING NO 创建时requestId
recvWindow LONG NO 不超过 60000
timestamp LONG YES

查询申购历史 (USER_DATA)

响应:

[
  {
    "id":1111,
    "targetAsset":"BTC", //name of the asset
    "planType":"SINGLE", //plan type of which this transaction is from
    "planName":"BTC", // plan name of which this transaction is from
    "planId":1234, // plan identifier of which this transaction is from
    "transactionDateTime":1648378800000, //transaction timestamp
    "transactionStatus":"SUCCESS", //status of the transaction: "SUCCESS","FAILED","PENDING"
    "failedType":"INSUFFICIENT_BALANCE",// only show when transactionStatus = FAILED,  INSUFFICIENT_BALANCE,TRANSACTION_REJECT/GCC_RJECT
    "sourceAsset":"BUSD", //source asset of the transaction
    "sourceAssetAmount":"297.12345", //amount of source asset used
    "targetAssetAmount":"0.005", //purchased amount of the asset
    "sourceWallet":"SPOT_WALLET", // SPOT_WALLET,FLEXIBLE_SAVINGS,SPOT_WALLET_FLEXIBLE_SAVINGS,REWARDS    
    "flexibleUsed":"false", //whether simple earn wallet is used
    "transactionFee":"0.002", //transaction fee amount
    "transactionFeeUnit":"BUSD", //denominated coin of the transaction fee
    "executionPrice":"2342" //price of the subscription price. It's amount of source asset equivilent of 1 unit of target asset
    "executionType":"RECURRING" //ONE_TIME,RECURRING
    "subscriptionCycle": "WEEKLY"
  }
] 

GET /sapi/v1/lending/auto-invest/history/list

查询申购历史

权重(IP): 1

参数:

名称 类型 是否必需 描述
planId LONG NO 计划id
startTime LONG NO
endTime LONG NO
targetAsset STRING NO
planType ENUM NO SINGLE, PORTFOLIO, INDEX, ALL
size LONG NO 默认10, 最大100
current LONG NO 当前查询页。 默认为1
recvWindow LONG NO 不超过60000
timestamp LONG YES

查询指数信息(USER_DATA)

响应:

{    
    "indexId": 1,
    "indexName":"BINANCE TOP 10 EW ",
    "status": "RUNNING",        //RUNNING/REBALANCING/PAUSED
    "assetAllocation": [
         {
          "targetAsset": "ADA", // for pie chart
          "allocation":"10"
         },
         {
          "targetAsset": "BTC",
          "allocation":"10"
         } 
    ]
}

GET /sapi/v1/lending/auto-invest/index/info

查询指数信息

权重(IP): 1

参数:

名称 类型 是否必需 描述
indexId LONG YES
recvWindow LONG NO 不超过 60000
timestamp LONG YES

查询指数关连计划详情(USER_DATA)

响应:

{    
    "indexId": 1,                     // 指数id
    "totalInvestedInUSD":"114.555",   // 总投资额USD单位
    "currentInvestedInUSD": "101.2",  // 当前投资额USD单位
    "pnlInUSD": "101.2",              // PNL(USD)单位
    "roi": "1.023",                   // ROI数值
    "assetAllocation": [
         {
          "targetAsset": "ADA",       // 申购币种,饼状图显示可使用
          "allocation":"10"           // 资产占比
         },
         {
          "targetAsset": "BTC",
          "allocation":"10"
         } 
    ]
    "details": [
        {
            "targetAsset": "ADA",              //申购币种
            "averagePriceInUSD": "3.4",        //平均投资价格USD单位
            "totalInvestedInUSD": "222.21",    //总投资额USD单位
            "currentInvestedInUSD": "101.2",   //当前投资USD单位
            "purchasedAmount": "122.12345678", //购买的资产
            "pnlInUSD": "109.2",               //以USD计量的PNL
            "roi": "0.1",                      //ROI以小数位计算
            "percentage": "10",                //币种的占比,如果是单币计划, 占比为100%
            "availableAmount": "122.12345678", //资产数额
            "redeemedAmount": "122.12345678",  //赎回数额
            "assetValueInUSD": "101.2"         //资产价值USD价值
        },
        {
            "targetAsset": "MATIC",
            "averagePriceInUSD": "3.4",  
            "totalInvestedInUSD": "222.21", 
            "currentInvestedInUSD": "101.2", 
            "purchasedAmount": "122.12345678", 
            "pnlInUSD": "109.2",   
            "roi": "0.1",    
            "percentage": "10", 
            "availableAmount": "122.12345678",
            "redeemedAmount": "122.12345678", 
            "assetValueInUSD": "101.2"
        }
    ]
}

GET /sapi/v1/lending/auto-invest/index/user-summary

查询指数关连计划详情

权重(IP): 1

参数:

名称 类型 是否必需 描述
indexId LONG YES
recvWindow LONG NO 不超过 60000
timestamp LONG YES

单次申购(TRADE)

响应:

{
  "transactionId": 12345, //交易id
  "waitSecond": 5 // 需停留5秒,查询结果
}

POST /sapi/v1/lending/auto-invest/one-off

单次申购

权重(IP): 1

频次限制: 每个账户最多三秒一次

参数:

名称 类型 是否必需 描述
sourceType STRING YES "MAIN_SITE",“TR” 只有Binance Turkey使用TR入参
requestId STRING NO if not null, must follow businessReference + unique string, e.g: TR12354859
subscriptionAmount DECIMAL YES
sourceAsset STRING YES “USDT”,”BUSD”
flexibleAllowedToUse BOOLEAN NO true/false,True:使用flexible wallet,TR业务使用false
planId LONG NO PORTFOLIO plan Id
indexId LONG NO 目前只有 1
details Array<PortfolioDetail> YES sum(all node's percentage) == 100,若作为请求参数发送, 可参考以下格式details[0].targetAsset=BTC,请求参数的式例:details[0].targetAsset=BTC details[0].percentage=60 details[1].targetAsset=ETH details[1].percentage=40
recvWindow LONG NO 不超过 60000
timestamp LONG YES

单次申购交易结果查询(USER_DATA)

响应:

{
  "transactionId": 12345, //交易id
  "status": "SUCCESS" //交易状态"成功“或”进行中“("SUCCESS"/"CONVERTING")
}

GET /sapi/v1/lending/auto-invest/one-off/status

单次申购交易结果查询

权重(IP): 1

参数:

名称 类型 是否必需 描述
transactionId LONG YES PORTFOLIO plan Id
requestId STRING NO TR1212123123, sourceType + unique, transactionId and requestId 不能同时为空
recvWindow LONG NO 不超过 60000
timestamp LONG YES

指数关连计划赎回交易(TRADE)

响应:

{
  "redemptionId":19, //赎回请求id
}

POST /sapi/v1/lending/auto-invest/redeem

指数关连计划赎回交易

权重(IP): 1

频次限制: 每个账户最多三秒一次

参数:

名称 类型 是否必需 描述
indexId LONG YES 指数id
requestId STRING NO TR1212123123, sourceType + unique, transactionId and requestId 不能同时为空
redemptionPercentage LONG YES 赎回的占比, 10/20/100..
recvWindow LONG NO 不超过 60000
timestamp LONG YES

指数关连计划赎回交易历史查询(USER_DATA)

响应:

[
  {
    "indexId":1,                        //指数id
    "indexName":"BINANCE TOP 10 EW",    //指数名称
    "redemptionId":11,                  //赎回交易id
    "status":"SUCCESS",                 //赎回结果(成功/失败 SUCCESS/FAILED  )
    "asset":"BTC",                      //赎回资产
    "amount":"0.005",                   //赎回数额
    "redemptionDateTime":1648378800000, //赎回时间
    "transactionFee":"0",               //赎回手续费
    "transactionFeeUnit":"USDT"         //赎回数额USD单位
  },
  {
    "indexId":1, 
    "indexName":"BINANCE TOP 10 EW",
    "redemptionId":12 ,
    "status":"SUCCESS",  
    "asset":"BNB", 
    "amount":"0.005",
    "redemptionDateTime":1648378800000,
    "transactionFee":"0",
    "transactionFeeUnit":"USDT" 
  }
]

GET /sapi/v1/lending/auto-invest/redeem/history

指数关连计划赎回交易历史查询

权重(IP): 1

参数:

名称 类型 是否必需 描述
requestId LONG YES 请求id
startTime LONG NO
endTime LONG NO
current LONG NO 当前查询页,从1开始,1位默认值
asset STRING NO
size LONG NO 默认:10, 最大:100
recvWindow LONG NO 不超过 60000
timestamp LONG YES

指数关连计划调仓历史记录(USER_DATA)

响应:

[
  {
    "indexId":1,                     //指数id
    "indexName":"BINANCE TOP 10 EW", //指数名称
    "rebalanceId":11,                //调仓请求id
    "status":"SUCCESS",              //调仓结果(成功/进行中 SUCCESS/INIT)
    "rebalanceFee":"10",             //调仓手续费
    "rebalanceFeeUnit":"USDT",       //调仓手续费单位   
    "transactionDetails":[
      {
        "asset":"BTC",               //调仓资产
        "transactionDateTime":1648378800000, //调仓交易时间
        "rebalanceDirection":"BUY",  //调仓交易方向
        "rebalanceAmount":"0.005",   //调仓数额
      },                                     
      {
        "asset":"ETH",
        "transactionDateTime":1648378800000,
        "rebalanceDirection":"BUY",
        "rebalanceAmount":"0.005",
      }
    ]
  }
]

GET /sapi/v1/lending/auto-invest/rebalance/history

指数关连计划赎回交易历史查询

权重(IP): 1

参数:

名称 类型 是否必需 描述
startTime LONG NO
endTime LONG NO
current LONG NO 当前查询页,从1开始,1位默认值
size LONG NO 默认:10, 最大:100
recvWindow LONG NO 不超过 60000
timestamp LONG YES

Staking 接口

以下接口适用于币安Staking产品。更多细节, 请参考币安Staking页面

质押 ETH (TRADE)

响应:

{
  "success": true
}

POST /sapi/v1/eth-staking/eth/stake

权重(IP): 150

频次限制:每个账户最多三秒一次

参数:

名称 类型 是否必需 描述
amount DECIMAL YES ETH 数量,限制4位小数
recvWindow LONG NO
timestamp LONG YES

质押 ETH V2(TRADE)

响应:

{
  "success": true,
  "wbethAmount":"0.23092091",
  "conversionRatio": "1.001212342342"  // 每1WBETH的ETH数量
}

POST /sapi/v2/eth-staking/eth/stake

质押ETH获得WBETH

权重(IP): 150

频次限制:每个账户最多三秒一次

参数:

名称 类型 是否必需 描述
amount DECIMAL YES ETH 数量,限制4位小数
recvWindow LONG NO
timestamp LONG YES

赎回 ETH (TRADE)

响应:

{
  "success": true,
  "arrivalTime": 1575018510000,
  "ethAmount":"0.23092091",
  "conversionRatio": "1.00121234"
}

POST /sapi/v1/eth-staking/eth/redeem

赎回WBETH或BETH并获得ETH

权重(IP):

150

频次限制:

每个账户最多三秒一次

参数:

名称 类型 是否必需 描述
asset STRING NO WBETH 或 BETH, 默认 BETH
amount DECIMAL YES BETH 数量,限制8位小数
recvWindow LONG NO
timestamp LONG YES

查询 ETH 质押记录 (USER_DATA)

响应:

{
  "rows": [
    {
      "time": 1575018510000,
      "asset": "ETH",
      "amount": "21312.23223",
      "status": "SUCCESS", //PENDING,SUCCESS,FAILED
      "distributeAmount":"21286.42584",
      "conversionRatio":"1.00121234"
    }
  ],
  "total": 1
}

GET /sapi/v1/eth-staking/eth/history/stakingHistory

权重(IP):

150

参数:

名称 类型 是否必需 描述
startTime LONG NO
endTime LONG NO
current LONG NO 当前查询页。开始值 1, 默认 1
size LONG NO 默认 10,最大 100
recvWindow LONG NO
timestamp LONG YES

查询 ETH 赎回记录 (USER_DATA)

响应:

{
  "rows":[
    {
      "time":1575018510000,
      "arrivalTime":1575018510000,
      "amount":"21312.23223",
      "status":"SUCCESS",
      "asset":"WBETH", 
      "distributeAsset": "ETH", //PENDING,SUCCESS,FAILED
      "distributeAmount": "21338.0699",
      "conversionRatio": "1.00121234"
    }
  ]
  "total": 1
}

GET /sapi/v1/eth-staking/eth/history/redemptionHistory

权重(IP):

150

参数:

名称 类型 是否必需 描述
startTime LONG NO
endTime LONG NO
current LONG NO 当前查询页。开始值 1, 默认 1
size LONG NO 默认 10,最大 100
recvWindow LONG NO
timestamp LONG YES

查询 BETH 质押收益记录 (USER_DATA)

响应:

{
  "rows": [
    {
      "time": 1575018510000,
      "asset": "BETH",
      "holding": "2.3223",
      "amount": "0.23223",
      "annualPercentageRate": "0.5",
      "status": "SUCCESS"
    }
  ],
  "total": 1
}

GET /sapi/v1/eth-staking/eth/history/rewardsHistory

权重(IP):

150

参数:

名称 类型 是否必需 描述
startTime LONG NO
endTime LONG NO
current LONG NO 当前查询页。开始值 1, 默认 1
size LONG NO 默认 10,最大 100
recvWindow LONG NO
timestamp LONG YES

查询当前 ETH 质押限额 (USER_DATA)

响应:

{
  "leftStakingPersonalQuota": "1000", // Show min(Daily available limit, total personal staking quota)
  "leftRedemptionPersonalQuota": "1000" // Show min(Daily personal redeem quota, total redemption limit)
}

GET /sapi/v1/eth-staking/eth/quota

权重(IP):

150

参数:

名称 类型 是否必需 描述
recvWindow LONG NO
timestamp LONG YES

查询 WBETH 汇率历史 (USER_DATA)

响应:

{
  "rows": [
    {
      "annualPercentageRate": "0.00006408", // BETH APR
      "exchangeRate": "1.00121234", // 1 WBETH等价的BETH数量
      "time": 1577233578000
    }
  ],
  "total": "1"
}

GET /sapi/v1/eth-staking/eth/history/rateHistory

权重(IP):

150

参数:

名称 类型 是否必需 描述
startTime LONG NO
endTime LONG NO
current LONG NO 当前查询页。开始值 1,默认 1
size LONG NO 默认 10,最大 100
recvWindow LONG NO
timestamp LONG YES

ETH 质押账户(USER_DATA)

响应:

{
  "cumulativeProfitInBETH": "0.01067982",
  "lastDayProfitInBETH": "0.01067982"
}

GET /sapi/v1/eth-staking/account

权重(IP):

150

参数:

名称 类型 是否必需 描述
recvWindow LONG NO
timestamp LONG YES

ETH 质押账户V2(USER_DATA)

响应:

{
  "holdingInETH":"1.22330928",
  "holdings":{
    wbethAmount="1.10928781",
    bethAmount="1.90002112"
  },
  "thirtyDaysProfitInETH":"0.22330928",  
  "profit":{
    amountFromWBETH="0.12330928", //收益累计在WBETH中
    amountFromBETH="0.1"  //BETH发放至现货钱包
  }
}

GET /sapi/v2/eth-staking/account

权重(IP):

150

参数:

名称 类型 是否必需 描述
recvWindow LONG NO
timestamp LONG YES

封装 BETH(TRADE)

响应:

{
  "success": true,
  "wbethAmount": "0.23092091",
  "exchangeRate": "1.001212343432"
}

POST /sapi/v1/eth-staking/wbeth/wrap

权重(IP):

150

频次限制: 每个账户最多三秒一次

参数:

名称 类型 是否必需 描述
amount DECIMAL YES BETH 数量,限制 4 位小数
recvWindow LONG NO
timestamp LONG YES

查询 WBETH 封装记录 (USER_DATA)

响应:

{
  "rows": [
    {
      "time": 1575018510000,
      "fromAsset": "BETH",
      "fromAmount": "21312.23223",
      "toAsset": "WBETH",
      "toAmount": "21312.23223",
      "exchangeRate": "1.01243253", // 每1个WBETH对应BETH数量
      "status": "SUCCESS"           //PENDING,SUCCESS,FAILED
    }
  ],
  "total": 1
}

GET /sapi/v1/eth-staking/wbeth/history/wrapHistory

权重(IP):

150

参数:

名称 类型 是否必需 描述
startTime LONG NO
endTime LONG NO
current LONG NO 当前查询页。开始值 1,默认 1
size LONG NO 默认 10,最大 100
recvWindow LONG NO
timestamp LONG YES

查询WBETH去封装记录(USER_DATA)

响应:

{
  "rows": [
    {
      "time": 1575018510000,
      "fromAsset": "WBETH",
      "fromAmount": "21312.23223",
      "toAsset": "BETH",
      "toAmount": "21312.23223",
      "exchangeRate": "1.01243253", // BETH value per 1 WBETH
      "status": "SUCCESS"   //PENDING,SUCCESS,FAILED
    }
  ],
  "total": 1
}

GET /sapi/v1/eth-staking/wbeth/history/unwrapHistory

权重(IP):

150

参数:

名称 类型 是否必需 描述
startTime LONG NO
endTime LONG NO
current LONG NO 当前查询页。开始值 1,默认 1
size LONG NO 默认 10,最大 100
recvWindow LONG NO
timestamp LONG YES

查询WBETH去封装记录(USER_DATA)

响应:

{
  "estRewardsInETH":"1.23230920",
  "rows":[
    {
      "time":1575018510000,
      "amountInETH":"0.23223", // Estimated rewards accrued within WBETH
      "holding":"2.3223", // WBETH holding balance
      "holdingInETH":"2.4231",
      "annualPercentageRate":"0.5", 
    }
  ],
  "total": 1
}

GET /sapi/v1/eth-staking/eth/history/wbethRewardsHistory

权重(IP):

150

参数:

名称 类型 是否必需 描述
startTime LONG NO
endTime LONG NO
current LONG NO 当前查询页。开始值 1,默认 1
size LONG NO 默认 10,最大 100
recvWindow LONG NO
timestamp LONG YES

矿池接口

获取算法(MARKET_DATA)

响应:

{
  "code": 0,
  "msg": "",
  "data": [
    {
      "algoName": "sha256",                        //  算法名称
      "algoId": 1,                                 // 算法id
      "poolIndex": 0,                              // 序列 
      "unit": "h/s"                                //   单位
    }
  ]
}

GET /sapi/v1/mining/pub/algoList

权重(IP): 1

参数:

None

获取币种(MARKET_DATA)

响应:

{
  "code": 0,
  "msg": "",
  "data": [
    {
      "coinName": "BTC",                      //  币种名称
      "coinId": 1,                            // id
      "poolIndex": 0,                         // 排序
      "algoId": 1,                            // 所属算法
      "algoName": "sha256"                    //所属算法名称
    }
  ]
}

GET /sapi/v1/mining/pub/coinList

权重(IP): 1

参数:

None

请求矿工列表明细 (USER_DATA)

响应:

{
  "code": 0,
  "msg": "",
  "data": [
    {
      "workerName": "bhdc1.16A10404B",     //挖矿用户名
      "type": "H_hashrate",               // 小时算力类型
      "hashrateDatas": [
        {
          "time": 1587902400000,         //  时间
          "hashrate": "0",               // 算力 
          "reject": 0                    //拒绝率
        },
        {
          "time": 1587906000000,
          "hashrate": "0",
          "reject": 0
        },
        .......
      ]
    },
    {
      "workerName": "bhdc1.16A10404B",    //挖矿用户名
      "type": "D_hashrate",                //日均算力类型
      "hashrateDatas": [
        {
          "time": 1587902400000,          //  时间
          "hashrate": "0",                // 算力 
          "reject": 0                     //拒绝率
        },
        {
          "time": 1587906000000,
          "hashrate": "0",
          "reject": 0
        },
        .......
      ]
    }
  ]
}

GET /sapi/v1/mining/worker/detail

权重(IP): 5

参数:

名称 类型 是否必需 描述 例子
algo STRING YES 算法名称(sha256) sha256
userName STRING YES 挖矿用户名 test
workerName STRING YES 矿工用户名,必传 bhdc1.16A10404B
recvWindow LONG NO
timestamp LONG YES

请求矿工列表 (USER_DATA)

响应:

{
  "code": 0,
  "msg": "",
  "data": {
    "workerDatas": [
      {
        "workerId": "1420554439452400131",  //矿工id
        "workerName": "2X73",               //矿工姓名  
        "status": 3,                        // 状态:1 有效, 2 无效, 3 失效
        "hashRate": 0,                      // 实时速率
        "dayHashRate": 0,                   //日均算力
        "rejectRate": 0,                    //实时拒绝率
        "lastShareTime": 1587712919000      // 最后提交时间  
      },
      {
        "workerId": "7893926126382807951",
        "workerName": "AZDC1.1A10101",
        "status": 2,
        "hashRate": 29711247541680,
        "dayHashRate": 12697781298013.66,
        "rejectRate": 0,
        "lastShareTime": 1587969727000
      },
     ......
    ],
    "totalNum": 18530,           // 总数量
    "pageSize": 20               // 每页条数
  }
}

GET /sapi/v1/mining/worker/list

权重(IP): 5

参数:

名称 类型 是否必需 描述 例子
algo STRING YES 算法名称(sha256) sha256
userName STRING YES 挖矿用户名 test
pageIndex INTEGER NO 页码,为空默认第一页,从1开始
sort INTEGER NO 排序方向(为空默认为0): 0 正序,1 倒序
sortColumn INTEGER NO 排序字段(默认为1):

1: 根据矿工名称排序,

2: 根据实时算力排序,

3: 根据日均算力排序,

4: 根据实时拒绝率排序,5最后提交时间
workerStatus INTEGER NO 矿机状态(默认为0):0 全部,1 有效, 2 无效, 3 失效
recvWindow LONG NO
timestamp LONG YES

收益列表 (USER_DATA)

响应:

{
  "code": 0,
  "msg": "",
  "data": {
    "accountProfits": [
      {
        "time": 1586188800000,            // 时间
        "type": 31, // 0:矿池钱包,5:地址挖矿,7:矿池宝,8:已转让,31:收益转让 ,32:算力转让-矿池钱包 33:算力转让-矿池宝
        "hashTransfer": null,            // 已转让算力
        "transferAmount": null,          // 已转让收益   
        "dayHashRate": 129129903378244,  // 算力
        "profitAmount": 8.6083060304,   //奖励数量
        "coinName":"BTC",              // 奖励币种
        "status": 2    //支付状态:0:待支付, 1:支付中  2:已支付
      },
      {
        "time": 1607529600000,
        "coinName": "BTC",
        "type": 0,
        "dayHashRate": 9942053925926,
        "profitAmount": 0.85426469,
        "hashTransfer": 200000000000,
        "transferAmount": 0.02180958,
        "status": 2
      },
      {
        "time": 1607443200000,
        "coinName": "BTC",
        "type": 31,
        "dayHashRate": 200000000000,
        "profitAmount": 0.02905916,
        "hashTransfer": null,
        "transferAmount": null,
        "status": 2
      }
    ],
    "totalNum": 3,          // 总条数
    "pageSize": 20          // 每页数量
  }
}

GET /sapi/v1/mining/payment/list

权重(IP): 5

参数:

名称 类型 是否必需 描述 例子
algo STRING YES 算法名称(sha256) sha256
userName STRING YES 挖矿用户名 test
coin STRING NO 币种名称
startDate Long NO 搜索日期 毫秒时间戳,同时为空查询所有
endDate Long NO 搜索日期 毫秒时间戳,同时为空查询所有
pageIndex INTEGER NO 页码,为空默认第一页,从1开始
pageSize INTEGER NO 分页数量,最小10,最大200
recvWindow LONG NO
timestamp LONG YES

其他收益列表 (USER_DATA)

响应:

{
  "code": 0,
  "msg": "",
  "data": {
    "otherProfits": [
      {
        "time": 1607443200000,      // 时间
        "coinName": "BTC",    // 奖励币种
        "type": 4,            // 1: 联合挖矿, 2: 活动奖励, 3:返点 4:机枪奖励 6:收益转让 7:矿池宝
        "profitAmount": 0.0011859,  //奖励数量
        "status": 2         //支付状态:0:待支付, 1:支付中  2:已支付
      }
    ],
    "totalNum": 3,          // 总条数
    "pageSize": 20          // 每页数量
  }
}

GET /sapi/v1/mining/payment/other

权重(IP): 5

参数:

名称 类型 是否必需 描述 例子
algo STRING YES 算法名称(sha256) sha256
userName STRING YES 挖矿用户名 test
coin STRING NO 币种名称
startDate Long NO 搜索日期 毫秒时间戳,同时为空查询所有
endDate Long NO 搜索日期 毫秒时间戳,同时为空查询所有
pageIndex INTEGER NO 页码,为空默认第一页,从1开始
pageSize INTEGER NO 分页数量,最小10,最大200
recvWindow LONG NO
timestamp LONG YES

算力转让详情列表 (USER_DATA)

响应:

{
  "code": 0,
  "msg": "",
  "data": {
    "configDetails": [
      {
        "configId": 168,     // 该配置的id
        "poolUsername": "123",  //转出子账户
        "toPoolUsername": "user1", //  转入子账户
        "algoName": "Ethash",     // 转让算法名称
        "hashRate": 5000000,     //  转让算力
        "startDay": 20201210,   // 开始时间
        "endDay": 20210405,   //结束时间 
        "status": 1       //状态:0 进行中,1:已取消,2:已终止 
      },
      {
        "configId": 166,
        "poolUsername": "pop",
        "toPoolUsername": "111111",
        "algoName": "Ethash",
        "hashRate": 3320000,
        "startDay": 20201226,
        "endDay": 20201227,
        "status": 0
      }
    ],
    "totalNum": 21,
    "pageSize": 200
  }
}

GET /sapi/v1/mining/hash-transfer/config/details

权重(IP): 5

参数:

名称 类型 是否必需 描述 例子
pageIndex INTEGER NO 页码,为空默认第一页,从1开始
pageSize INTEGER NO 分页数量,最小10,最大200
recvWindow LONG NO
timestamp LONG YES

算力转让列表 (USER_DATA)

响应:

{
  "code": 0,
  "msg": "",
  "data": {
    "configDetails": [
      {
        "configId": 168,     // 该配置的id
        "poolUsername": "123",  //转出子账户
        "toPoolUsername": "user1", //  转入子账户
        "algoName": "Ethash",     // 转让算法名称
        "hashRate": 5000000,     //  转让算力
        "startDay": 20201210,   // 开始时间
        "endDay": 20210405,   //结束时间 
        "status": 1,       //状态:0 进行中,1:已取消,2:已终止 
        "type": 0        //状态:0 算力转让记录,1 算力接收记录
      },
      {
        "configId": 166,
        "poolUsername": "pop",
        "toPoolUsername": "111111",
        "algoName": "Ethash",
        "hashRate": 3320000,
        "startDay": 20201226,
        "endDay": 20201227,
        "status": 0,
        "type": 0
      }
    ],
    "totalNum": 21,
    "pageSize": 200
  }
}

GET /sapi/v1/mining/hash-transfer/config/details/list

权重(IP): 5

参数:

名称 类型 是否必需 描述 例子
pageIndex INTEGER NO 页码,为空默认第一页,从1开始
pageSize INTEGER NO 分页数量,最小10,最大200
recvWindow LONG NO
timestamp LONG YES

算力转让详情 (USER_DATA)

响应:

{
    "code": 0,
    "msg": "",
    "data": {
        "profitTransferDetails": [{
                "poolUsername": "test4001",  // 转出子账户
                "toPoolUsername": "pop",    // 转入子账户
                "algoName": "sha256",      //转让算法名称
                "hashRate": 200000000000,  // 转让算力
                "day": 20201213,          //转让日期
                "amount": 0.2256872,     // 转让收益
                "coinName": "BTC"        // 收益币种
            },
            {
                "poolUsername": "test4001",
                "toPoolUsername": "pop",
                "algoName": "sha256",
                "hashRate": 200000000000,
                "day": 20201213,
                "amount": 0.2256872,
                "coinName": "BTC"
            }
        ],
        "totalNum": 8,
        "pageSize": 200
    }
}

GET /sapi/v1/mining/hash-transfer/profit/details

权重(IP): 5

参数:

名称 类型 是否必需 描述 例子
configId INTEGER YES 配置的id 168
pageIndex INTEGER NO 页码,为空默认第一页,从1开始
pageSize INTEGER NO 分页数量,最小10,最大200
recvWindow LONG NO
timestamp LONG YES

算力转让请求 (USER_DATA)

响应:

{
  "code": 0,
  "msg": "",
  "data": 171  // 该配置的id
}

POST /sapi/v1/mining/hash-transfer/config

权重(IP): 5

参数:

名称 类型 是否必需 描述 例子
userName STRING YES 挖矿用户名 test
algo STRING YES 算法名称(sha256) sha256
endDate Long YES 转让结束时间(毫秒时间戳) 1617659086000
startDate Long YES 转让结束时间(毫秒时间戳) 1607659086000
toPoolUser STRING YES 挖矿用户名 S19pro
hashRate Long YES 转让算力h/s必传(BTC 大于 500000000000 ETH大于 500000) 100000000
recvWindow LONG NO
timestamp LONG YES

取消算力转让设置 (USER_DATA)

响应:

{
  "code": 0,
  "msg": "",
  "data": true
}

POST /sapi/v1/mining/hash-transfer/config/cancel

权重(IP): 5

参数:

名称 类型 是否必需 描述 例子
configId INTEGER YES 配置的id 168
userName STRING YES 挖矿用户名 test
recvWindow LONG NO
timestamp LONG YES

统计列表 (USER_DATA)

响应:

{
  "code": 0,
  "msg": "",
  "data": {
    "fifteenMinHashRate": "457835490067496409.00000000",          // 15分钟算力
    "dayHashRate": "214289268068874127.65000000",                 //  日均算力
    "validNum": 0,                                                // 有效数量
    "invalidNum": 17562,                                          // 无效数量
    "profitToday":{                                              // 今日预估
      "BTC":"0.00314332",       
      "BSV":"56.17055953",
      "BCH":"106.61586001"
     },
    "profitYesterday":{                                       //  昨日收益
      "BTC":"0.00314332",
       "BSV":"56.17055953",
       "BCH":"106.61586001"
     },

    "userName": "test",                                    // 挖矿账户
    "unit": "h/s",                                        //  算力单位
    "algo": "sha256"                                      // 所属算法
  }
}

GET /sapi/v1/mining/statistics/user/status

权重(IP): 5

参数:

名称 类型 是否必需 描述 例子
algo STRING YES 算法名称(sha256) sha256
userName STRING YES 挖矿用户名 test
recvWindow LONG NO
timestamp LONG YES

账号列表 (USER_DATA)

响应:

{
  "code": 0,
  "msg": "",
  "data": [
    {
      "type": "H_hashrate",        //小时算力类型
      "userName": "test",         // 账户名
      "list": [
        {
          "time": 1585267200000,    // 时间
          "hashrate": "0.00000000", // 算力
          "reject": "0.00000000"    //拒绝率
        },
        {
          "time": 1585353600000,
          "hashrate": "0.00000000",
          "reject": "0.00000000"
        }
        ......
      ]
    },
    {
      "type": "D_hashrate",        //日均算力类型
      "userName": "test",          // 账户名
      "list": [
        {
          "time": 1587906000000,     // 时间
          "hashrate": "0.00000000", // 算力
          "reject": "0.00000000"    //拒绝率
        },
        {
          "time": 1587909600000,
          "hashrate": "0.00000000",
          "reject": "0.00000000"
        }    ......
      ]
    }
  ]
}

GET /sapi/v1/mining/statistics/user/list

权重(IP): 5

参数:

名称 类型 是否必需 描述 例子
algo STRING YES 算法名称(sha256) sha256
userName STRING YES 挖矿用户名 test
recvWindow LONG NO
timestamp LONG YES

矿池账户收益列表 (USER_DATA)

响应:

{
  "code": 0,
  "msg": "",
  "data": {
    "accountProfits": [
      {
        "time": 1607443200000,      // 时间
        "coinName": "BTC",   // 币种
        "type": 2,           // 0:邀请返佣 1:邀请返现 2:返点
        "puid": 59985472,    //挖矿子账户id
        "subName": "vdvaghani", //挖矿账户名
        "amount": 0.09186957    //数量
      }
    ],
    "totalNum": 3,          // 总条数
    "pageSize": 20          // 每页数量
  }
}

GET /sapi/v1/mining/payment/uid

权重(IP): 5

参数:

名称 类型 是否必需 描述 例子
algo STRING YES 算法名称(sha256) sha256
startDate Long NO 搜索日期 毫秒时间戳,同时为空查询所有
endDate Long NO 搜索日期 毫秒时间戳,同时为空查询所有
pageIndex INTEGER NO 页码,为空默认第一页,从1开始
pageSize INTEGER NO 分页数量,最小10,最大200
recvWindow LONG NO
timestamp LONG YES

合约接口

合约资金划转 (USER_DATA)

响应:

{
    "tranId": 100000001    // 划转 ID 
}

POST /sapi/v1/futures/transfer

执行现货账户与合约账户之间的划转

权重(IP): 1

参数:

名称 类型 是否必需 描述
asset STRING YES The asset being transferred, e.g., USDT
amount DECIMAL YES The amount to be transferred
type INT YES 1: 现货账户向USDT合约账户划转

2: USDT合约账户向现货账户划转

3: 现货账户向币本位合约账户划转

4: 币本位合约账户向现货账户划转
recvWindow LONG NO
timestamp LONG YES

获取合约资金划转历史 (USER_DATA)

响应:

{
  "rows": [
    {
      "asset": "USDT",          // 资产
      "tranId": 100000001,      // 划转ID         
      "amount": "40.84624400",  // 数量
      "type": "1",              // 划转方向: 1( 现货向USDT本位合约), 2( USDT本位合约向现货), 3( 现货向币本位合约), and 4( 币本位合约向现货)
      "timestamp": 1555056425000,   // 时间戳
      "status": "CONFIRMED"         // PENDING (等待执行), CONFIRMED (成功划转), FAILED (执行失败);
    }
  ],
  "total": 1
}

GET /sapi/v1/futures/transfer

权重(IP): 10

参数:

名称 类型 是否必需 描述
asset STRING NO
startTime LONG YES
endTime LONG NO
current LONG NO 当前页面. 起始计数为1. 默认值1
size LONG NO 单页数据条目数,默认:10 最大:100
recvWindow LONG NO
timestamp LONG YES

获取合约订单薄历史数据下载地址(USER_DATA)

响应:

{
    "data": [
        {
            "day": "2023-06-30",
            "url": "https://bin-prod-user-rebate-bucket.s3.ap-northeast-1.amazonaws.com/future-data-symbol-update/2023-06-30/BTCUSDT_T_DEPTH_2023-06-30.tar.gz?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20230925T025710Z&X-Amz-SignedHeaders=host&X-Amz-Expires=86399&X-Amz-Credential=AKIAVL364M5ZNFZ74IPP%2F20230925%2Fap-northeast-1%2Fs3%2Faws4_request&X-Amz-Signature=5fffcb390d10f34d71615726f81f99e42d80a11532edeac77b858c51a88cbf59"
        }
    ]
}

GET /sapi/v1/futures/histDataLink

权重(IP): 200

参数:

名称 类型 是否必需 描述
symbol STRING YES 交易对,如BTCUSDT或BTCUSD_PERP |
dataType ENUM YES T_DEPTH for ticklevel orderbook data, S_DEPTH for orderbook snapshot data
startTime LONG YES
endTime LONG YES
recvWindow LONG NO
timestamp LONG YES

合约策略交易接口

币安合约算法交易API服务,旨在为用户提供一整套的算法交易解决方案,包括:自动执行订单,提高执行透明度和提供智能接口直达市场。

FAQ: 成交量份额参与算法(VP) 介绍

FAQ: 时间加权平均价格策略(Twap) 介绍

成交量份额参与算法(VP)下单 (TRADE)

响应:

{
    "clientAlgoId": "00358ce6a268403398bd34eaa36dffe7", //用户自定义策略订单ID
    "success": true, 
    "code": 0,
    "msg": "OK"
}

POST /sapi/v1/algo/futures/newOrderVp

发送VP下单 仅支持U本位合约

权重(UID): 3000

注意:

参数:

名称 类型 是否必需 描述
symbol STRING YES 交易对 eg. BTCUSDT
side ENUM YES 买卖方向 ( BUY or SELL )
positionSide ENUM NO 持仓方向,单向持仓模式下非必填,默认且仅可填BOTH;在双向持仓模式下必填,且仅可选择 LONG 或 SHORT
quantity DECIMAL YES 下单数量, 以合约币种(base asset)个数下单; 名义价值 (quantity * 标记价格(base asset)) 需要大于 1,000 USDT,且不超过 1,000,000 USDT
urgency ENUM YES 代表当前执行的相对速率; ENUM: LOW(慢), MEDIUM(中等), HIGH(快)
clientAlgoId STRING NO 必须传入32位,如果未发送,则自动生成
reduceOnly BOOLEAN NO true, false; 非双开模式下默认false;双开模式下不接受此参数; 开仓不接受此参数
limitPrice DECIMAL NO 限价单价格; 若未发送,则以市场价下单
recvWindow LONG NO
timestamp LONG YES

其他信息:

时间加权平均价格策略(Twap)下单 (TRADE)

响应:

{
    "clientAlgoId": "65ce1630101a480b85915d7e11fd5078", //用户自定义策略订单ID
    "success": true, 
    "code": 0,
    "msg": "OK"
}

POST /sapi/v1/algo/futures/newOrderTwap

发送Twap下单 仅支持U本位合约

权重(UID): 3000

注意:

参数:

名称 类型 是否必需 描述
symbol STRING YES 交易对 eg. BTCUSDT
side ENUM YES 买卖方向 ( BUY or SELL )
positionSide ENUM NO 持仓方向,单向持仓模式下非必填,默认且仅可填BOTH;在双向持仓模式下必填,且仅可选择 LONG 或 SHORT
quantity DECIMAL YES 下单数量, 以合约币种(base asset)个数下单; 名义价值 (quantity * 标记价格(base asset)) 需要大于 1,000 USDT,且不超过 1,000,000 USDT
duration LONG YES 请以秒为单位发送[300,86400]
clientAlgoId STRING NO 必须传入32位,如果未发送,则自动生成
reduceOnly BOOLEAN NO true, false; 非双开模式下默认false;双开模式下不接受此参数; 开仓不接受此参数
limitPrice DECIMAL NO 限价单价格; 若未发送,则以市场价下单
recvWindow LONG NO
timestamp LONG YES

其他信息:

取消策略订单 (TRADE)

响应:

{
    "algoId": 14511,  //策略订单ID
    "success": true,
    "code": 0,
    "msg": "OK"
}

DELETE /sapi/v1/algo/futures/order

撤销订单

权重(IP): 1

注意:

参数:

名称 类型 是否必需 描述
algoId LONG YES eg. 14511
recvWindow LONG NO
timestamp LONG YES

查询当前策略订单挂单 (USER_DATA)

响应:

{
    "total": 1,
    "orders": [
        { 
            "algoId": 14517,      //策略订单ID
            "symbol": "ETHUSDT",  //交易对
            "side": "SELL",       //买卖方向
            "positionSide": "SHORT", //持仓模式
            "totalQty": "5.000",     //总共下单数量
            "executedQty": "0.000",  //执行数量
            "executedAmt": "0.00000000",   //执行价值
            "avgPrice": "0.00",            //平均价格
            "clientAlgoId": "d7096549481642f8a0bb69e9e2e31f2e",  //用户自定义策略订单ID
            "bookTime": 1649756817004,     //用户下单时间 
            "endTime": 0,                  //结束时间
            "algoStatus": "WORKING",       //策略订单状态
            "algoType": "VP",              //策略订单类型
            "urgency": "LOW"               //执行速率
        }
    ]
}

GET /sapi/v1/algo/futures/openOrders

权重(IP): 1

注意:

参数:

名称 类型 是否必需 描述
recvWindow LONG NO
timestamp LONG YES

查询历史策略订单 (USER_DATA)

响应:

{
    "total": 1,
    "orders": [
        {
            "algoId": 14518,      //策略订单ID
            "symbol": "BNBUSDT",  //交易对
            "side": "BUY",        //买卖方向
            "positionSide": "BOTH",  //持仓模式
            "totalQty": "100.00",    //总共下单数量
            "executedQty": "0.00",   //执行数量
            "executedAmt": "0.00000000",  //执行价值
            "avgPrice": "0.000",          //平均价格
            "clientAlgoId": "acacab56b3c44bef9f6a8f8ebd2a8408",  //用户自定义策略订单ID
            "bookTime": 1649757019503,    //用户下单时间
            "endTime": 1649757088101,     //结束时间
            "algoStatus": "CANCELLED",    //策略订单状态
            "algoType": "VP",             //策略订单类型
            "urgency": "LOW"              //执行速率
        }
    ]
}

GET /sapi/v1/algo/futures/historicalOrders

权重(IP): 1

注意:

参数:

名称 类型 是否必需 描述
symbol STRING NO 交易对 eg. BTCUSDT
side ENUM NO BUY 或者 SELL
startTime LONG NO 毫秒级时间戳 eg.1641522717552
endTime LONG NO 毫秒级时间戳 eg.1641522526562
page INT NO 默认 1
pageSize INT NO 最小 1, 最大 100; 默认 100
recvWindow LONG NO
timestamp LONG YES

查询执行子订单 (USER_DATA)

响应:

{
    "total": 1,
    "executedQty": "1.000",
    "executedAmt": "3229.44000000",
    "subOrders": [
        {
            "algoId": 13723,    //策略订单ID
            "orderId": 8389765519993908929,  //子订单ID
            "orderStatus": "FILLED",         //子订单状态
            "executedQty": "1.000",          //执行数量
            "executedAmt": "3229.44000000",  //执行价值
            "feeAmt": "-1.61471999",         //手续费
            "feeAsset": "USDT",              //手续费币种
            "bookTime": 1649319001964,       //下单时间
            "avgPrice": "3229.44",           //平均价格
            "side": "SELL",                  //买卖方向
            "symbol": "ETHUSDT",             //交易对
            "subId": 1,                      //子订单执行顺序ID
            "timeInForce": "IMMEDIATE_OR_CANCEL",  //有效方式
            "origQty": "1.000"              //原始委托数量
        }
    ]
}

GET /sapi/v1/algo/futures/subOrders

获取指定 algoId 的相应子订单

权重(IP): 1

注意:

参数:

名称 类型 是否必需 描述
algoId LONG YES
page INT NO 默认1
pageSize INT NO 最小 1, 最大 100; 默认 100
recvWindow LONG NO
timestamp LONG YES

现货策略交易接口

币安现货算法交易API服务,旨在为用户提供一整套的算法交易解决方案,包括:自动执行订单,提高执行透明度和提供智能接口直达市场。在推广期间,TWAP订单不会有额外手续费,仅收取标准手续费

时间加权平均价格策略(Twap)下单 (TRADE)

响应:

{
    "clientAlgoId": "65ce1630101a480b85915d7e11fd5078", //用户自定义策略订单ID
    "success": true, 
    "code": 0,
    "msg": "OK"
}

POST /sapi/v1/algo/spot/newOrderTwap

通过算法服务进行时间加权平均价格策略(TWAP)下单交易

权重(UID): 3000

参数:

名称 类型 是否必需 描述
symbol STRING YES 交易对 eg. BTCUSDT
side ENUM YES 买卖方向 ( BUY or SELL )
quantity DECIMAL YES 下单数量, 以Base资产个数下单; 名义价值 (quantity * 最新价格(base asset)) 需要大于 1,000 USDT,且不超过 100,000 USDT
duration LONG YES 请以秒为单位发送[300,86400];少于 5 分钟 => 默认为 5 分钟;大于 24h => 默认为 24h
clientAlgoId STRING NO 必须传入32位,如果未发送,则自动生成
limitPrice DECIMAL NO 限价单价格; 若未发送,则以市场价下单
stpMode ENUM NO 允许的 ENUM 取决于交易对的配置。支持的值有EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE
recvWindow LONG NO
timestamp LONG YES

其他信息:

取消TWAP策略订单 (TRADE)

响应:

{
    "algoId": 14511,  //策略订单ID
    "success": true,
    "code": 0,
    "msg": "OK"
}

DELETE /sapi/v1/algo/spot/order

取消正在委托的TWAP订单

权重(IP): 1

参数:

名称 类型 是否必需 描述
algoId LONG YES eg. 14511
recvWindow LONG NO
timestamp LONG YES

查询当前策略订单挂单 (USER_DATA)

响应:

{
    "total": 1,
    "orders": [
        { 
            "algoId": 14517,      //策略订单ID
            "symbol": "ETHUSDT",  //交易对
            "side": "SELL",       //买卖方向
            "totalQty": "5.000",     //总共下单数量
            "executedQty": "0.000",  //执行数量
            "executedAmt": "0.00000000",   //执行价值
            "avgPrice": "0.00",            //平均价格
            "clientAlgoId": "d7096549481642f8a0bb69e9e2e31f2e",  //用户自定义策略订单ID
            "bookTime": 1649756817004,     //用户下单时间 
            "endTime": 0,                  //结束时间
            "algoStatus": "WORKING",       //策略订单状态
            "algoType": "VP",              //策略订单类型
            "urgency": "LOW"               //执行速率
        }
    ]
}

GET /sapi/v1/algo/spot/openOrders

权重(IP): 1

参数:

名称 类型 是否必需 描述
recvWindow LONG NO
timestamp LONG YES

查询历史策略订单 (USER_DATA)

响应:

{
    "total": 1,
    "orders": [
        {
            "algoId": 14518,      //策略订单ID
            "symbol": "BNBUSDT",  //交易对
            "side": "BUY",        //买卖方向
            "totalQty": "100.00",    //总共下单数量
            "executedQty": "0.00",   //执行数量
            "executedAmt": "0.00000000",  //执行价值
            "avgPrice": "0.000",          //平均价格
            "clientAlgoId": "acacab56b3c44bef9f6a8f8ebd2a8408",  //用户自定义策略订单ID
            "bookTime": 1649757019503,    //用户下单时间
            "endTime": 1649757088101,     //结束时间
            "algoStatus": "CANCELLED",    //策略订单状态
            "algoType": "VP",             //策略订单类型
            "urgency": "LOW"              //执行速率
        }
    ]
}

GET /sapi/v1/algo/spot/historicalOrders

查询现货TWAP历史订单

权重(IP): 1

参数:

名称 类型 是否必需 描述
symbol STRING NO 交易对 eg. BTCUSDT
side ENUM NO BUY 或者 SELL
startTime LONG NO 毫秒级时间戳 eg.1641522717552
endTime LONG NO 毫秒级时间戳 eg.1641522526562
page INT NO 默认 1
pageSize INT NO 最小 1, 最大 100; 默认 100
recvWindow LONG NO
timestamp LONG YES

查询执行子订单 (USER_DATA)

响应:

{
    "total": 1,
    "executedQty": "1.000",
    "executedAmt": "3229.44000000",
    "subOrders": [
        {
            "algoId": 13723,    //策略订单ID
            "orderId": 8389765519993908929,  //子订单ID
            "orderStatus": "FILLED",         //子订单状态
            "executedQty": "1.000",          //执行数量
            "executedAmt": "3229.44000000",  //执行价值
            "feeAmt": "-1.61471999",         //手续费
            "feeAsset": "USDT",              //手续费币种
            "bookTime": 1649319001964,       //下单时间
            "avgPrice": "3229.44",           //平均价格
            "side": "SELL",                  //买卖方向
            "symbol": "ETHUSDT",             //交易对
            "subId": 1,                      //子订单执行顺序ID
            "timeInForce": "IMMEDIATE_OR_CANCEL",  //有效方式
            "origQty": "1.000"              //原始委托数量
        }
    ]
}

GET /sapi/v1/algo/spot/subOrders

获取指定 algoId 的相应子订单

权重(IP): 1

参数:

名称 类型 是否必需 描述
algoId LONG YES
page INT NO 默认1
pageSize INT NO 最小 1, 最大 100; 默认 100
recvWindow LONG NO
timestamp LONG YES

统一账户专业版接口

为了给币安合约用户提供更加优质的服务及提高用户的资金利用率,币安将推出统一账户专业版计划。该计划将以合约钱包、现货杠杆钱包的总资产作为保证金来计算。 关于统一账户专业版:币安统一账户专业版计划是一项跨资产保证金计划,支持超过 200 种有效的加密资产。 U本位合约、币本位合约以及杠杆钱包中支持的加密资产和头寸将作为有效的联合抵押品,以确定统一账户专业版的权益、保证金余额和维持保证金要求。

FAQ: 币安合约统一账户专业版总览

仅对特定用户开放此功能,详情:加入统一账户专业版计划

查询统一账户专业版信息 (USER_DATA)

响应:

{
        "uniMMR": "5167.92171923",        // 统一账户专业版模式维持保证金率
        "accountEquity": "122607.35137903",   // 统一账户专业版总权益,单位为USD
        "actualEquity": "142607.35137903",    // 不考虑质押率统一账户专业版总权益,单位为USD
        "accountMaintMargin": "23.72469206", // 统一账户专业版维持保证金,即账户开仓及借贷总共需要的维持保证金,单位为USD
        "accountStatus": "NORMAL",  // 统一账户专业版当前账户状态:"NORMAL"正常状态, "MARGIN_CALL"补充保证金, "SUPPLY_MARGIN"再一次补充保证金, "REDUCE_ONLY"触发交易限制, "ACTIVE_LIQUIDATION"手动强制平仓, "FORCE_LIQUIDATION"强制平仓, "BANKRUPTED"破产
        "accountType": "PM_1"     //PM_1为统一账户专业版, PM_2为统一账户,PM_3为统一账户专业版(SPAN)
}

GET /sapi/v1/portfolio/account

权重(IP): 5

参数:

名称 类型 是否必需 描述
recvWindow LONG NO
timestamp LONG YES

统一账户专业版资产质押率 (MARKET_DATA)

响应:

[
   {
       "asset": "USDC",
       "collateralRate": "1.0000" //质押率
   },
   {
       "asset": "BUSD",
       "collateralRate": "1.0000"
   },
]

GET /sapi/v1/portfolio/collateralRate

统一账户专业版资产质押率

权重(IP): 50

参数: None

查询统一账户专业版穿仓借贷金额 (USER_DATA)

响应:

{
        "asset": "BUSD",   
        "amount":  "579.45", // 统一账户用户强平穿仓负债,单位为BUSD
}

GET /sapi/v1/portfolio/pmLoan

查询统一账户专业版穿仓借贷金额

权重(UID): 500

参数:

名称 类型 是否必需 描述
recvWindow LONG NO
timestamp LONG YES

偿还统一账户专业版穿仓负债

响应:

{
    "tranId": 58203331886213504
}

POST /sapi/v1/portfolio/repay

偿还统一账户专业版穿仓负债

权重(UID): 3000

参数:

名称 类型 是否必需 描述
from STRING NO SPOT或MARGIN,默认SPOT
recvWindow LONG NO
timestamp LONG YES

查询统一账户专业版期货负余额收息历史(USER_DATA)

响应:

[
    {
        "asset": "USDT",    
        "interest": "24.4440",               //利息金额
        "interestAccruedTime": 1670227200000,
        "interestRate": "0.0001164",         //日利率 
        "principal": "210000"
    } 
]

GET /sapi/v1/portfolio/interest-history

查询统一账户专业版期货负余额收息历史

权重(IP): 50

参数:

名称 类型 是否必需 描述
asset STRING NO
startTime LONG NO 起始时间
endTime LONG NO 结束时间
size LONG NO 返回的结果集数量 默认值:10 最大值:100
recvWindow LONG NO
timestamp LONG YES

查询统一账户资产价格指数(MARKET_DATA)

响应:

[
   {
       "asset": "BTC",
       "assetIndexPrice": "28251.9136906",  //USD价格指数
       "time": 1683518338121
   }
]

GET /sapi/v1/portfolio/asset-index-price

查询统一账户资产价格指数

权重(IP):

传asset为1 或不传asset*50*

参数:

名称 类型 是否必需 描述
asset STRING NO

资金归集(USER_DATA)

响应:

{
    "msg": "success"
}

POST /sapi/v1/portfolio/auto-collection

账户资金归集,将除BNB外资产从合约账户划转到杠杆账户

权重(IP):

1500

参数:

名称 类型 是否必需 描述
recvWindow LONG NO
timestamp LONG YES

特定资产资金归集(USER_DATA)

响应:

{
    "msg": "success"
}

POST /sapi/v1/portfolio/asset-collection

特定资产账户资金归集,从合约账户划转到杠杆账户

权重(IP):

60

参数:

名称 类型 是否必需 描述
asset STRING YES
recvWindow LONG NO
timestamp LONG YES

BNB划转(USER_DATA)

响应:

{
     "tranId": 100000001
} 

POST /sapi/v1/portfolio/bnb-transfer

BNB在杠杆账户和USD-M期货账户划转

权重(IP):

1500

参数:

名称 类型 是否必需 描述
amount DECIMAL YES
transferSide STRING YES "TO_UM","FROM_UM"
recvWindow LONG NO
timestamp LONG YES

更改自动清还合约负余额模式(TRADE)

响应:

{
    "msg": "success"
}

POST /sapi/v1/portfolio/repay-futures-switch

更改自动支付合约负余额模式 (HMAC SHA256)

权重(IP):

1500

参数:

名称 类型 是否必需 描述
autoRepay STRING YES 默认为true; false代表关闭自动清还合约负余额
recvWindow LONG NO
timestamp LONG YES

查询自动清还合约负余额模式(USER_DATA)

响应:

{
    "autoRepay": true  //  `true`代表自动清还合约负余额; `false`代表关闭自动清还合约负余额
}

GET /sapi/v1/portfolio/repay-futures-switch

查询自动清还合约负余额模式

权重(IP):

30

参数:

名称 类型 是否必需 描述
recvWindow LONG NO
timestamp LONG YES

清还合约负余额(USER_DATA)

响应:

{
    "msg": "success"
}

POST /sapi/v1/portfolio/repay-futures-negative-balance

清还合约负余额

权重(IP):

1500

参数:

名称 类型 是否必需 描述
recvWindow LONG NO
timestamp LONG YES

查询统一账户资产支持杠杆倍数(USER_DATA)

响应:

[
   {
       "asset": "USDC",
       "leverage": 10
   },
   {
       "asset": "USDT",
       "leverage": 10
   }
]

GET /sapi/v1/portfolio/margin-asset-leverage

权重(IP):

50

法币接口

获取法币充值/提现历史记录 (USER_DATA)

响应:

{
   "code": "000000",
   "message": "success",
   "data": [
   {
      "orderNo":"7d76d611-0568-4f43-afb6-24cac7767365",
      "fiatCurrency": "BRL", // 法币token
      "indicatedAmount": "10.00",  // 交易金额
      "amount": "10.00",    // 实际金额(扣除手续费)
      "totalFee": "0.00",   // 交易手续费
      "method": "BankAccount",  // 交易方式
      "status": "Expired",  // Processing, Failed, Successful, Finished, Refunding, Refunded, Refund Failed, Order Partial credit Stopped
      "createTime": 1626144956000,  // 订单创建时间
      "updateTime": 1626400907000   // 订单更新时间
   }
   ],
   "total": 1,
   "success": true
}

GET /sapi/v1/fiat/orders

权重(UID): 90000

参数:

名称 类型 是否必需 描述
transactionType STRING YES 0-deposit,1-withdraw
beginTime LONG NO
endTime LONG NO
page INT NO 默认 1
rows INT NO 默认 100, 最大 500
recvWindow LONG NO
timestamp LONG YES

获取法币支付历史记录 (USER_DATA)

响应:

{
   "code": "000000",
   "message": "success",
   "data": [
   {
      "orderNo": "353fca443f06466db0c4dc89f94f027a",
      "sourceAmount": "20.0",  // 法币交易数量
      "fiatCurrency": "EUR",   // 法币token
      "obtainAmount": "4.462", // 数字货币交易数量
      "cryptoCurrency": "LUNA",  // 数字货币token
      "totalFee": "0.2",     // 交易手续费
      "price": "4.437472",   // 价格
      "status": "Failed",  // Processing处理中, Completed完成, Failed失败, Refunded退款
      "paymentMethod": "Credit Card",
      "createTime": 1624529919000, // 订单创建时间
      "updateTime": 1624529919000  // 订单更新时间
   }
   ],
   "total": 1,
   "success": true
}

GET /sapi/v1/fiat/payments

Weight(IP): 1

Parameters:

名称 类型 是否必需 描述
transactionType STRING YES 0-buy,1-sell
beginTime LONG NO
endTime LONG NO
page INT NO 默认 1
rows INT NO 默认 100, 最大 500
recvWindow LONG NO
timestamp LONG YES

C2C 接口

获取 C2C 交易历史记录 (USER_DATA)

响应:

{
   "code": "000000",
   "message": "success",
   "data": [
   {
      "orderNumber":"20219644646554779648",
      "advNo": "11218246497340923904",
      "tradeType": "SELL",  
      "asset": "BUSD", 
      "fiat": "CNY",
      "fiatSymbol": "¥",
      "amount": "5000.00000000",  // Quantity (in Crypto)
      "totalPrice": "33400.00000000",
      "unitPrice": "6.68", // Unit Price (in Fiat)
      "orderStatus": "COMPLETED",  // PENDING, TRADING, BUYER_PAYED, DISTRIBUTING, COMPLETED, IN_APPEAL, CANCELLED, CANCELLED_BY_SYSTEM
      "createTime": 1619361369000,
      "commission": "0",  // Transaction Fee (in Crypto)
      "counterPartNickName": "阿涛❤***",
      "advertisementRole": "TAKER"        
     }
   ],
   "total": 1,
   "success": true
}

GET /sapi/v1/c2c/orderMatch/listUserOrderHistory

权重(IP): 1

参数:

名称 类型 是否必需 描述
tradeType STRING YES BUY, SEll
startTimestamp LONG NO
endTimestamp LONG NO
page INT NO default 1
rows INT NO default 100, max 100
recvWindow LONG NO
timestamp LONG YES

VIP借币接口

查询VIP借币借款中订单 (USER_DATA)

响应:

{
  "rows": [
    {
      "orderId": 100000001,
      "loanCoin": "BUSD",
      "totalDebt": "10000",
      "loanRate": "0.0123",  // 浮动利率为"flexible rate"
      "residualInterest": "10.27687923",
      "collateralAccountId": "12345678,23456789",
      "collateralCoin": "BNB,BTC,ETH",
      "totalCollateralValueAfterHaircut": "25000.27565492", 
      "lockedCollateralValue": "25000.27565492", 
      "currentLTV": "0.57",
      "expirationTime": 1575018510000,
      "loanDate": "1676851200000",
      "loanTerm": "30days",                // 活期则为"open term"
      "expirationTime": 1575018510000      // 活期则为0
      "initialLtv": "72%",
      "marginCallLtv": "77%",
      "liquidationLtv": "91%"
    }
  ],
  "total": 1
}

GET /sapi/v1/loan/vip/ongoing/orders

VIP借币仅对VIP用户开放

权重(IP): 400

参数:

名称 类型 是否必需 描述
orderId LONG NO
collateralAccountId LONG NO
loanCoin STRING NO
collateralCoin STRING NO
current LONG NO 当前查询页数,从1开始。默认值:1,最大:1000
limit LONG NO 默认值:10,最大:100
recvWindow LONG NO
timestamp LONG YES

VIP借币还款 (TRADE)

响应:

{
  "loanCoin": "BUSD",
  "repayAmount": "200.5",
  "remainingPrincipal": "100.5",
  "remainingInterest": "0",
  "collateralCoin": "BNB,BTC,ETH",
  "currentLTV": "0.25",
  "repayStatus": "Repaid" // Repaid, Repaying, Failed
}

POST /sapi/v1/loan/vip/repay

VIP借币仅对VIP用户开放

权重(UID): 6000

参数:

名称 类型 是否必需 描述
orderId LONG YES
amount DECIMAL YES
recvWindow LONG NO
timestamp LONG YES

查询VIP借币还款记录历史 (USER_DATA)

响应:

{
  "rows": [
    {
      "loanCoin": "BUSD",
      "repayAmount": "10000",
      "collateralCoin": "BNB,BTC,ETH",
      "repayStatus": "Repaid", // Repaid, Repaying, Failed
      "loanDate": "1676851200000",
      "repayTime": "1575018510000",
      "orderId": "756783308056935434"
    }
  ],
  "total": 1
}

GET /sapi/v1/loan/vip/repay/history

VIP借币仅对VIP用户开放

权重(IP): 400

参数:

名称 类型 是否必需 描述
orderId LONG NO
loanCoin STRING NO
startTime LONG NO
endTime LONG NO
current LONG NO 当前查询页数,从1开始。默认值:1,最大:1000
limit LONG NO 默认值:10,最大:100
recvWindow LONG NO
timestamp LONG YES

VIP 借币续期 (TRADE)

响应:

{
  "loanAccountId": "12345678", 
  "loanCoin": "BTC", 
  "loanAmount": "100.55", 
  "collateralAccountId": "12345677,12345678,12345679",
  "collateralCoin": "BUSD,USDT,ETH",   
  "loanTerm": "30",
}

POST /sapi/v1/loan/vip/renew

VIP借币仅对VIP用户开放

权重(UID): 6000

参数:

名称 类型 是否必需 描述
orderId LONG YES
loanTerm INT NO 30/60 天
recvWindow LONG NO
timestamp LONG YES

查询VIP子账户冻结抵押物金额 (USER_DATA)

响应:

{
  "rows": [
    {
      "collateralAccountId": "12345678",
      "collateralCoin": "BNB,BTC,ETH",
    }
  ],
  [
    {
      "collateralAccountId": "23456789",
      "collateralCoin": "BNB,BTC,ETH",
    }
  ],
  "total": 2
}

GET /sapi/v1/loan/vip/collateral/account

VIP借币仅对VIP用户开放

权重(IP): 6000

参数:

名称 类型 是否必需 描述
orderId LONG NO
collateralAccountId LONG NO
recvWindow LONG NO
timestamp LONG YES

VIP 借币借款 (TRADE)

响应:

{
   "loanAccountId": "12345678", 
   "requestId": "12345678",
   "loanCoin": "BTC",
   "isFlexibleRate": "No",
   "loanAmount": "100.55",
   "collateralAccountId": "12345678,12345678,12345678",
   "collateralCoin": "BUSD,USDT,ETH",  
   "loanTerm": "30"
}

{
   "loanAccountId": "12345678", 
   "requestId": "12345678",
   "loanCoin": "BTC",
   "isFlexibleRate": "Yes",
   "loanAmount": "100.55",
   "collateralAccountId": "12345678,12345678,12345678",
   "collateralCoin": "BUSD,USDT,ETH"
}

POST /sapi/v1/loan/vip/borrow

VIP借币仅对VIP用户开放

权重(UID): 6000

频率限制: 1次/2秒/UID

参数:

名称 类型 是否必需 描述
loanAccountId LONG YES
loanCoin STRING YES
loanAmount DECIMAL YES
collateralAccountId STRING YES 多个用,分割
collateralCoin STRING YES 多个用,分割
isFlexibleRate BOOLEAN YES
默认:TRUE. TRUE: 浮动利率;FALSE:固定利率
loanTerm INT NO 选择固定利率时此为必填选项;选择浮动利率时选填:30/60 days
recvWindow LONG NO
timestamp LONG YES

查询VIP借币可借币种数据(USER_DATA)

响应:

{
  "rows": [ 
    { 
    "loanCoin": "BUSD", 
    "_flexibleHourlyInterestRate": "0.000103",
    "_flexibleYearlyInterestRate": "0.548595",
    "_30dDailyInterestRate": "0.000136", 
    "_30dYearlyInterestRate": "0.03450", 
    "_60dDailyInterestRate": "0.000145", 
    "_60dYearlyInterestRate": "0.04103", 
    "minLimit": "100" 
    "maxLimit": "1000000" 
    "vipLevel": 1
    } 
  ], 
  "total": 1 
}

GET /sapi/v1/loan/vip/loanable/data

获取可借币种的利率和借贷限额。借入限额以美元价值显示。

权重(IP): 400

参数:

名称 类型 是否必需 描述
loanCoin STRING NO
vipLevel INT NO 默认值:用户的VIP等级
recvWindow LONG NO
timestamp LONG YES

查询VIP借币抵押币种数据(USER_DATA)

响应:

{
  "rows": [
    {
    "collateralCoin": "BUSD",
    "_1stCollateralRatio": "100%",
    "_1stCollateralRange": "1-10000000",  
    "_2ndCollateralRatio": "80%",
    "_2ndCollateralRange": "10000000-100000000",  
    "_3rdCollateralRatio": "60%",
    "_3rdCollateralRange": "100000000-1000000000",  
    "_4thCollateralRatio": "0%",
    "_4thCollateralRange": ">10000000000",  
    }
    ],
  "total": 1
}

GET /sapi/v1/loan/vip/collateral/data

查询VIP借币抵押币种数据

权重(IP): 400

参数:

名称 类型 是否必需 描述
collateralCoin STRING NO
recvWindow LONG NO
timestamp LONG YES

查询申请状态(USER_DATA)

响应:

{
  "rows": [
     {
     "loanAccountId": "12345678", //loan receiving account
     "orderId": "12345678",
     "requestId": "12345678", 
     "loanCoin": "BTC", 
     "loanAmount": "100.55", 
     "collateralAccountId": "12345678,12345678,12345678",
     "collateralCoin": "BUSD,USDT,ETH",   
     "loanTerm": "30",
     "status": "Repaid", // Accruing_Interest, Overdue, Liquidating, Repaying, Repaid, Liquidated, Pending, Failed
     "loanDate":"1676851200000"
     }
  ],
  "total": 1
}

GET /sapi/v1/loan/vip/request/data

权重(UID): 400

频率限制: 1次/秒/UID

参数:

名称 类型 是否必需 描述
current LONG NO 目前查询的页面。从1开始,默认:1,最大:1000
limit LONG NO 默认: 10, 最大: 100
recvWindow LONG NO
timestamp LONG YES

查询借款利率(USER_DATA)

响应:

[
    {
      "asset": "BUSD",
     "flexibleDailyInterestRate": "0.001503",
     "flexibleYearlyInterestRate": "0.548595",
     "time": 1577233578000
    },

    {
     "asset": "BTC",
     "flexibleDailyInterestRate": "0.001503",
     "flexibleYearlyInterestRate": "0.548595",
     "time": 1577233562000
    }
]

GET /sapi/v1/loan/vip/request/interestRate

权重(UID): 400

参数:

名称 类型 是否必需 描述
loanCoin STRING YES 最多10个币种, 多个用","隔开
recvWindow LONG NO
timestamp LONG YES

质押借币接口

获取质押借币资金流水 (USER_DATA)

响应:

[
   {
        "asset": "BUSD",
        "type": "borrowIn",
        "amount": "100",
        "timestamp": 1633771139847,
        "tranId": "80423589583"
    },
    {
        "asset": "BUSD",
        "type": "borrowIn",
        "amount": "100",
        "timestamp": 1634638371496,
        "tranId": "81685123491"
    }
 ]

GET /sapi/v1/loan/income

权重(UID): 6000

参数:

名称 类型 是否必需 描述
asset STRING NO
type STRING NO 默认返回所有类型 枚举值:借入 borrowIn,抵押金使用collateralSpent, 还款金额repayAmount, 抵押物返还collateralReturn, 增加抵押物addCollateral, 减少抵押物removeCollateral, 强平后返还抵押物collateralReturnAfterLiquidation
startTime LONG NO
endTime LONG NO
limit INT NO 默认 20, 最大 100
recvWindow LONG NO
timestamp LONG YES

借币 - 质押借币借贷 (TRADE)

响应:

{
  "loanCoin": "BUSD",
  "loanAmount": "100.5",
  "collateralCoin": "BNB",
  "collateralAmount": "50.5",
  "hourlyInterestRate": "0.001234",
  "orderId": "100000001"
}

POST /sapi/v1/loan/borrow

权重(UID): 36000

频率限制: 1次/秒/UID

参数:

名称 类型 是否必需 描述
loanCoin STRING YES
loanAmount DECIMAL NO 当collateralAmount为空时,需必填
collateralCoin STRING YES
collateralAmount DECIMAL NO 当loanAmount为空时,需必填
loanTerm INT YES 7/30 天
recvWindow LONG NO
timestamp LONG YES

借币 - 查询质押借币历史记录 (USER_DATA)

响应:

{
  "rows": [
    {
    "orderId": 100000001,
    "loanCoin": "BUSD",
    "initialLoanAmount": "10000",
    "hourlyInterestRate": "0.000057"
    "loanTerm": "7"
    "collateralCoin": "BNB",
    "initialCollateralAmount": "49.27565492"
    "borrowTime": 1575018510000
    "status": "Repaid" // Accruing_Interest, Overdue, Liquidating, Repaying, Repaid, Liquidated, Pending, Failed
    }
  ],
  "total": 1
}

GET /sapi/v1/loan/borrow/history

权重(IP): 400

参数:

名称 类型 是否必需 描述
orderId LONG NO POST /sapi/v1/loan/borrow 中的 orderId
loanCoin STRING NO
collateralCoin STRING NO
startTime LONG NO
endTime LONG NO
current LONG NO 当前查询页数,从1开始。默认值:1;最大:1000。
limit LONG NO 默认值:10;最大:100。
recvWindow LONG NO
timestamp LONG YES

借币 - 查询借款中订单列表 (USER_DATA)

响应:

{
  "rows": [
    {
    "orderId": 100000001,
    "loanCoin": "BUSD",
    "totalDebt": "10000",
    "residualInterest":"10.27687923"
    "collateralCoin": "BNB",
    "collateralAmount": "49.27565492"
    "currentLTV": "0.57"
    "expirationTime": 1575018510000
    }
  ],
  "total": 1
}

GET /sapi/v1/loan/ongoing/orders

权重(IP):: 300

参数:

名称 类型 是否必需 描述
orderId LONG NO
loanCoin STRING NO
collateralCoin STRING NO
current LONG NO 当前查询页数,从1开始。默认值:1;最大:1000。
limit LONG NO 默认值:10;最大:100。
recvWindow LONG NO
timestamp LONG YES

还款 - 质押借币还款 (TRADE)

响应:

{
  "loanCoin": "BUSD"
  "remainingPrincipal": "100.5"
  "remainingInterest": "0"
  "collateralCoin": "BNB"
  "remainingCollateral": "5.253"
  "currentLTV": "0.25"
  "repayStatus": "Repaid" // Repaid, Repaying
}

or

{
  "loanCoin": "BUSD"
  "collateralCoin": "BNB"
  "repayStatus": "Repaying" // Repaid, Repaying
}

POST /sapi/v1/loan/repay

权重(UID): 6000

参数:

名称 类型 是否必需 描述
orderId LONG YES
amount DECIMAL YES
type INT NO 默认值:1。 1:用借贷币还款;2:用抵押币还款。
collateralReturn BOOLEAN NO 默认值:TRUE。TRUE:多余的抵押金退回现货钱包;FALSE: 多余的抵押金保留在原订单里。
recvWindow LONG NO
timestamp LONG YES

还款 - 查询还款记录历史 (USER_DATA)

响应:

{
  "rows": [
    {
    "loanCoin": "BUSD",
    "repayAmount": "10000",
    "collateralCoin": "BNB",
    "collateralUsed": "0"
    "collateralReturn": "49.27565492"
    "repayType": "1" // 1 for "repay with borrowed coin", 2 for "repay with collateral"
    "repayStatus": "Repaid" // Repaid, Repaying, Failed
    "repayTime": 1575018510000
    "orderId": 756783308056935434
    }
  ],
  "total": 1
}

GET /sapi/v1/loan/repay/history

权重(IP): 400

参数:

名称 类型 是否必需 描述
orderId LONG NO
loanCoin STRING NO
collateralCoin STRING NO
startTime LONG NO
endTime LONG NO
current LONG NO 当前查询页数,从1开始。默认值:1;最大:1000。
limit LONG NO 默认值:10;最大:100。
recvWindow LONG NO
timestamp LONG YES

调整质押率 - 质押借币调整质押率 (TRADE)

响应:

{
  "loanCoin": "BUSD",
  "collateralCoin": "BNB",
  "direction": "ADDITIONAL",
  "amount": "5.235",
  "currentLTV": "0.52"
}

POST /sapi/v1/loan/adjust/ltv

权重(UID): 6000

参数:

名称 类型 是否必需 描述
orderId LONG YES
amount DECIMAL YES
direction ENUM YES "ADDITIONAL", "REDUCED"
recvWindow LONG NO
timestamp LONG YES

调整质押率 - 查询质押率调整历史 (USER_DATA)

响应:

{
  "rows": [
    {
    "loanCoin": "BUSD",
    "collateralCoin": "BNB",
    "direction": "ADDITIONAL",
    "amount": "5.235",
    "preLTV": "0.78",
    "afterLTV": "0.56",
    "adjustTime": 1575018510000,
    "orderId": 756783308056935434
    }
  ],
  "total": 1
}

GET /sapi/v1/loan/ltv/adjustment/history

权重(IP): 400

参数:

名称 类型 是否必需 描述
orderId LONG NO
loanCoin STRING NO
collateralCoin STRING NO
startTime LONG NO
endTime LONG NO
current LONG NO 当前查询页数,从1开始。默认值:1;最大:1000。
limit LONG NO 默认值:10;最大:100。
recvWindow LONG NO
timestamp LONG YES

查询可借币种数据 (USER_DATA)

响应:

{
  "rows": [
    {
      "loanCoin": "BUSD",
      "_7dHourlyInterestRate": "0.00000491",
      "_7dDailyInterestRate": "0.000118",
      "_14dHourlyInterestRate": "0.00000491",
      "_14dDailyInterestRate": "0.000118",
      "_30dHourlyInterestRate": "0.00000567",
      "_30dDailyInterestRate": "0.000136",
      "_90dHourlyInterestRate": "0.00000596",
      "_90dDailyInterestRate": "0.000143",
      "_180dHourlyInterestRate": "0.00000631",
      "_180dDailyInterestRate": "0.000151",
      "minLimit": "100"
      "maxLimit": "1000000"
      "vipLevel": 1
    }
  ],
  "total": 1
}

GET /sapi/v1/loan/loanable/data

获取可借币种的利率和借贷限额。借入限额以美元价值显示。

权重(IP): 400

频率限制: 1次/2秒/UID

参数:

名称 类型 是否必需 描述
loanCoin STRING NO
vipLevel INT NO 默认:用户当前VIP等级。如有特殊配置,则填“-1”查询
recvWindow LONG NO
timestamp LONG YES

查询抵押币种数据 (USER_DATA)

响应:

{
  "rows": [
    {
      "collateralCoin": "BNB",
      "initialLTV": "0.65",
      "marginCallLTV": "0.75",
      "liquidationLTV": "0.83",
      "maxLimit": "1000000"
      "vipLevel": 1
    }
  ],
  "total": 1
}

GET /sapi/v1/loan/collateral/data

获取抵押币种质押率信息和质押限额。质押限额以美元价值显示。

权重(IP): 400

频率限制: 1次/2秒/UID

参数:

名称 类型 是否必需 描述
collateralCoin STRING NO
vipLevel INT NO 默认:用户当前VIP等级。如有特殊配置,则填“-1”查询
recvWindow LONG NO
timestamp LONG YES

查询抵押币种还款汇率 (USER_DATA)

响应:

{
  "loanlCoin": "BUSD",
  "collateralCoin": "BNB",
  "repayAmount": "1000",
  "rate": "300.36781234" // 抵押/借贷币种的汇率价格
}

GET /sapi/v1/loan/repay/collateral/rate

获取抵押物还款时,抵押/借贷币种的汇率价格。汇率价格有效时间为8秒。

权重(IP): 6000

参数:

名称 类型 是否必需 描述
loanCoin STRING YES
collateralCoin STRING YES
repayAmount DECIMAL YES 以借贷币种为单位的还款金额
recvWindow LONG NO
timestamp LONG YES

质押借币自定义补仓质押率 (TRADE)

响应:

{
  "rows": [
    {
    "orderId": "100000001"
    "collateralCoin": "BNB"
    "preMarginCall": "0.8"
    "afterMarginCall": "0.7"
    "customizeTime": 1575018510000
    }
  ],
  "total": 1
}

POST /sapi/v1/loan/customize/margin_call

仅可针对进行中订单,自定义补仓质押率。

权重(UID): 6000

参数:

名称 类型 是否必需 描述
orderId LONG NO 当collateralCoin为空时,需必填。orderId或collateralCoin只需传一个,如果两个参数同时传,以orderId为准。
collateralCoin STRING NO 当orderID为空时,需必填。orderId或collateralCoin只需传一个,如果两个参数同时传,以orderId为准。
marginCall DECIMAL YES
recvWindow LONG NO
timestamp LONG YES

借币 - 活期借币借贷 (TRADE)

响应:

{
  "loanCoin": "BUSD",
  "loanAmount": "100.5",
  "collateralCoin": "BNB",
  "collateralAmount": "50.5",
  "status": "Succeeds" //Succeeds, Failed, Processing
}

POST /sapi/v1/loan/flexible/borrow (已停用)

请更换为:

POST /sapi/v2/loan/flexible/borrow

权重(UID): 6000

频率限制: 1次/2秒/UID

参数:

名称 类型 是否必须 描述
loanCoin STRING YES
loanAmount DECIMAL NO 当collateralAmount为空时,需必填
collateralCoin STRING YES
collateralAmount DECIMAL NO 当loanAmount为空时,需必填
recvWindow LONG NO
timestamp LONG YES

借币 - 查询活期借款中订单列表 (USER_DATA)

响应:

{
  "rows": [
    {
      "loanCoin": "BUSD",
      "totalDebt": "10000",
      "collateralCoin": "BNB",
      "collateralAmount": "49.27565492",
      "currentLTV": "0.57"
    }
  ],
  "total": 1
}

GET /sapi/v1/loan/flexible/ongoing/orders (将被停用)

请更换为:

GET /sapi/v2/loan/flexible/ongoing/orders

权重(IP): 300

参数:

名称 类型 是否必须 描述
loanCoin STRING NO
collateralCoin STRING NO
current LONG NO 当前查询页数,从1开始。默认值:1;最大:1000。
limit LONG NO 默认值:10;最大:100。
recvWindow LONG NO
timestamp LONG YES

借币 - 查询活期借币历史记录 (USER_DATA)

响应:

{
  "rows": [
    {
      "loanCoin": "BUSD",
      "initialLoanAmount": "10000",
      "collateralCoin": "BNB",
      "initialCollateralAmount": "49.27565492",
      "borrowTime": 1575018510000,
      "status": "Succeeds" //Succeeds, Failed, Processing
    }
  ],
  "total": 1
}

GET /sapi/v1/loan/flexible/borrow/history (将被停用)

请更换为:

GET /sapi/v2/loan/flexible/borrow/history

权重(IP): 400

参数:

名称 类型 是否必须 描述
loanCoin STRING NO
collateralCoin STRING NO
startTime LONG NO
endTime LONG NO
current LONG NO 当前查询页数,从1开始。默认值:1;最大:1000。
limit LONG NO 默认值:10;最大:100。
recvWindow LONG NO
timestamp LONG YES

还款 - 活期借币还款 (TRADE)

响应:

{
  "loanCoin": "BUSD",
  "collateralCoin": "BNB",
  "remainingDebt": "100.5",
  "remainingCollateral": "5.253",
  "fullRepayment": false,
  "currentLTV": "0.25",
  "repayStatus": "Repaid" // Repaid, Repaying, Failed
}

POST /sapi/v1/loan/flexible/repay (将被停用)

请更换为:

POST /sapi/v2/loan/flexible/repay

权重(UID): 6000

参数:

名称 类型 是否必须 描述
loanCoin STRING YES
collateralCoin DECIMAL YES
repayAmount DECIMAL YES
collateralReturn BOOLEAN NO 默认: TRUE. TRUE: 多余的抵押金退回理财钱包;FALSE: 多余的抵押金保留在原订单里,降低LTV
fullRepayment BOOLEAN NO 默认: FALSE. TRUE: 全部偿还; FALSE: 按照loanAmount金额部分偿还
recvWindow LONG NO
timestamp LONG YES

还款 - 查询活期借币还款记录历史 (USER_DATA)

相应:

{
  "rows": [
    {
      "loanCoin": "BUSD",
      "repayAmount": "10000",
      "collateralCoin": "BNB",
      "collateralReturn": "49.27565492",
      "repayStatus": "Repaid", // Repaid, Repaying, Failed
      "repayTime": 1575018510000
    }
  ],
  "total": 1
}

GET /sapi/v1/loan/flexible/repay/history (将被停用)

请更换为:

GET /sapi/v2/loan/flexible/repay/history

权重(IP): 400

参数:

名称 类型 是否必须 描述
loanCoin STRING NO
collateralCoin STRING NO
startTime LONG NO
endTime LONG NO
current LONG NO 当前查询页数,从1开始。默认值:1;最大:1000。
limit LONG NO 默认值:10;最大:100。
recvWindow LONG NO
timestamp LONG YES

调整质押率 - 活期借币调整质押率 (TRADE)

响应:

{
  "loanCoin": "BUSD",
  "collateralCoin": "BNB",
  "direction": "ADDITIONAL",
  "adjustmentAmount": "5.235",
  "currentLTV": "0.52"
}

POST /sapi/v1/loan/flexible/adjust/ltv (将被停用)

请更换为:

POST /sapi/v2/loan/flexible/adjust/ltv

权重(UID): 6000

频率限制: 1次/2秒/UID

参数:

名称 类型 是否必须 描述
loanCoin STRING YES
collateralCoin STRING YES
adjustmentAmount DECIMAL YES
direction ENUM YES "ADDITIONAL", "REDUCED"
recvWindow LONG NO
timestamp LONG YES

调整质押率 - 查询活期借币质押率调整历史

响应:

{
  "rows": [
    {
    "loanCoin": "BUSD",
    "collateralCoin": "BNB",
    "direction": "ADDITIONAL",
    "collateralAmount": "5.235",
    "preLTV": "0.78",
    "afterLTV": "0.56",
    "adjustTime": 1575018510000     }
  ],
  "total": 1
}

GET /sapi/v1/loan/flexible/ltv/adjustment/history (将被停用)

请更换为:

GET /sapi/v2/loan/flexible/ltv/adjustment/history

权重(UID): 400

参数:

名称 类型 是否必须 描述
loanCoin STRING NO
collateralCoin STRING NO
startTime LONG NO
endTime LONG NO
current LONG NO Current querying page. Start from 1; default: 1; max: 1000
limit LONG NO Default: 10; max: 100
recvWindow LONG NO
timestamp LONG YES

查询活期借币可借币种数据 (USER_DATA)

响应:

{
  "rows": [
    {
      "loanCoin": "BUSD",
      "flexibleInterestRate": "0.00000491",
      "flexibleMinLimit": "100",
      "flexibleMaxLimit": "1000000"
    }
  ],
  "total": 1
}

GET /sapi/v1/loan/flexible/loanable/data (已停用)

请更换为:

GET /sapi/v2/loan/flexible/loanable/data

获取活期借币可借币种的利率和借贷限额。借入限额以美元价值显示。

权重(IP): 400

频率限制: 1次/2秒/UID

参数:

名称 类型 是否必须 描述
loanCoin STRING NO
recvWindow LONG NO
timestamp LONG YES

查询活期借币抵押币种数据 (USER_DATA)

响应:

{
  "rows": [
    {
      "collateralCoin": "BNB",
      "initialLTV": "0.65",
      "marginCallLTV": "0.75",
      "liquidationLTV": "0.83",
      "maxLimit": "1000000"
    }
  ],
  "total": 1
}

GET /sapi/v1/loan/flexible/collateral/data (已停用)

请更换为:

GET /sapi/v2/loan/flexible/collateral/data

获取活期借币抵押币种质押率信息和质押限额。质押限额以美元价值显示。

权重(IP): 400

频率限制: 1次/2秒/UID

参数:

名称 类型 是否必须 描述
collateralCoin STRING NO
recvWindow LONG NO
timestamp LONG YES

跟单交易接口

查询是否为带单员身份 (USER_DATA)

响应:

{
  "code": "000000",
  "message": "success",
  "data": {
     "isLeadTrader": true,
     "time": 1717382310843
   },
  "success": true
}

GET /sapi/v1/copyTrading/futures/userStatus

权重(UID): 20

参数:

名称 类型 是否必需 描述
recvWindow LONG NO
timestamp LONG YES

查询带单币种白名单(USER_DATA)

响应:

{
   "code": "000000",
   "message": "success",
   "data": [
     {
        "symbol": "BTCUSDT",
        "baseAsset": "BTC",
        "quoteAsset": "USDT"
     },
     {
        "symbol": "ETHUSDT",
        "baseAsset": "ETH",
        "quoteAsset": "USDT"
     }
   ],
}

GET /sapi/v1/copyTrading/futures/leadSymbol 

权重(UID): 20

参数:

名称 类型 是否必需 描述
recvWindow LONG NO
timestamp LONG YES

Pay 接口

获取 Pay 交易历史记录 (USER_DATA)

响应:

{
   "code": "000000",
   "message": "success",
   "data": [
   {
       "orderType": "C2C", //交易类型 枚举值:PAY(C端用户在商户侧消费), PAY_REFUND(C端用户商户侧消费,退款), C2C(C端用户间的转账),CRYPTO_BOX(红包交易), CRYPTO_BOX_RF(红包交易,退款), C2C_HOLDING(C端用户转账给非币安用户), C2C_HOLDING_RF(C端用户转账给非币安用户,退款), PAYOUT(商户给其用户付款), REMITTANCE(汇款)
       "transactionId": "M_P_71505104267788288", //流水编号
       "transactionTime": 1610090460133, //交易时间戳
       "amount": "23.72469206", //订单金额 最多8位小数 正为收入,负为支出
       "currency": "BNB", //订单币种
       "walletType": 1, //主钱包类型,1 资金钱包;2 现货钱包;3 法币钱包;4 或 6 卡支付;5 理财钱包
       "walletTypes": [1,2], //数组格式,当使用组合支付时会有多个值
       "fundsDetail": [ //使用资金明细
               {
                "currency": "USDT", //使用资金币种  
                "amount": "1.2", //使用资金金额 为正 最多8位小数
                "walletAssetCost":[ //每个钱包的资金支出明细
                    {"1":"0.6"},
                    {"2":"0.6"}
                 ]
               },
               {
                "currency": "ETH",
                "amount": "0.0001",
                "walletAssetCost":[
                    {"1":"0.00005"},
                    {"2":"0.00005"}
                 ]
               }
          ],
       "payerInfo":{
               "name":"Jack", //个人昵称或商户名称
               "type":"USER", //账户类型,USER表示个人账户,MERCHANT表示商家
               "binanceId":"12345678", //binance uid
               "accountId":"67736251" //binance pay id
           },
       "receiverInfo":{
               "name":"Alan", //个人昵称或商户名称
               "type":"MERCHANT", //账户类型,USER表示个人账户,MERCHANT表示商家
               "email":"alan@binance.com", //邮箱
               "binanceId":"34355667", //binance uid
               "accountId":"21326891", /binance pay id
               "countryCode":"1", //国际区号
               "phoneNumber":"8057651210", //手机号
               "mobileCode":"US", //国家代码                
               "extend":[ //extension field
                    "institutionName": "", //银行名或者电子钱包名称
                    "cardNumber": "",  
                    "digitalWalletId": ""
               ] 
           }
     }
   ],
  "success": true
}

GET /sapi/v1/pay/transactions

权重(UID): 3000

参数:

名称 类型 是否必需 描述
startTime LONG NO
endTime LONG NO
limit INT NO 默认 100, 最大 100
recvWindow LONG NO
timestamp LONG YES

闪兑接口

您想访问币安闪兑API吗?请填写问卷提交访问申请。闪兑API服务适用于需要在币安闪兑上自动交易的用户。我们批准您的申请后,您将收到一封确认邮件。

请注意,该服务的所有用户均受到币安使用条款的约束;API服务不适用于含套利、高频交易、价格剥削在内的使用目的。币安可随时出于任何原因自行决定限制或终止币安API连接,并且对于此类限制、终止及其原因,币安没有义务提前告知用户。

查询可交易币对信息

响应:

[
  {
    "fromAsset":"BTC",
    "toAsset":"USDT",
    "fromAssetMinAmount":"0.0004",
    "fromAssetMaxAmount":"50",
    "toAssetMinAmount":"20",
    "toAssetMaxAmount":"2500000",
    "fromIsBase": True
  }
]

GET /sapi/v1/convert/exchangeInfo

查询可交易的币对的信息,以及它们分别所支持交易金额的上下限。

权重(IP): 20

参数:

名称 类型 是否必需 描述
fromAsset STRING EITHER OR BOTH 用户售出币种
toAsset STRING EITHER OR BOTH 用户买入币种

查询可交易币种精度 (USER_DATA)

响应:

[
  {
    "asset": "BTC", 
    "fraction": 8
  },
  {
    "asset": "SHIB", 
    "fraction": 2
  }
]

GET /sapi/v1/convert/assetInfo

查询每个可交易币种的精度信息

权重(IP): 100

参数:

名称 类型 是否必需 描述
recvWindow LONG NO 此值不能大于 60000
timestamp LONG YES

发送获取报价请求 (USER_DATA)

响应:

{
   "quoteId":"12415572564",
   "ratio":"38163.7",
   "inverseRatio":"0.0000262",
   "validTimestamp":1623319461670,
   "toAmount":"3816.37",
   "fromAmount":"0.1"
}

POST /sapi/v1/convert/getQuote

对所需的币对发送获取报价请求

权重(UID): 200

参数:

名称 类型 是否必需 描述
fromAsset STRING YES
toAsset STRING YES
fromAmount DECIMAL EITHER 这是成交后将被扣除的金额
toAmount DECIMAL EITHER 这是成交后将会获得的金额
walletType ENUM NO 可用值为SPOT 或者 FUNDING. 默认值是 SPOT
validTime ENUM NO 可以支持10s、30s、1m、2m等值,默认值为 10s
recvWindow LONG NO 此值不能大于 60000
timestamp LONG YES

接受报价 (TRADE)

响应:

{
  "orderId":"933256278426274426",
  "createTime":1623381330472,
  "orderStatus":"PROCESS" //PROCESS/ACCEPT_SUCCESS/SUCCESS/FAIL
}

POST /sapi/v1/convert/acceptQuote

通过 quote ID 来接受报价。

权重(UID): 500

参数:

名称 类型 是否必需 描述
quoteId STRING YES
recvWindow LONG NO 此值不能大于 60000
timestamp LONG YES

查询订单状态 (USER_DATA)

响应:

{
  "orderId":933256278426274426,
  "orderStatus":"SUCCESS",
  "fromAsset":"BTC",
  "fromAmount":"0.00054414",
  "toAsset":"USDT",
  "toAmount":"20",
  "ratio":"36755",
  "inverseRatio":"0.00002721",
  "createTime":1623381330472
}

GET /sapi/v1/convert/orderStatus

通过 order ID 来查询订单状态。

权重(UID): 100

参数:

名称 类型 是否必需 描述
orderId STRING NO orderId 和quoteId需要填其中一个
quoteId STRING NO orderId 和quoteId需要填其中一个

创建闪兑限价单(USER_DATA)

响应:

{
    "orderId": 1603680255057330400, 
    "status": "PROCESS"
}

POST /sapi/v1/convert/limit/placeOrder

用户创建闪兑限价单

权重(UID): 500

参数:

名称 类型 是否必需 描述
baseAsset STRING YES 先使用GET /sapi/v1/convert/exchangeInfo API接口去查询币对中的baseAsset
quoteAsset STRING YES 先使用GET /sapi/v1/convert/exchangeInfoAPI接口去查询币对中的quoteAsset
limitPrice DECIMAL YES 币对限价 (从baseAssetquoteAsset)
baseAmount DECIMAL NO Base asset 金额 (baseAmount 或 quoteAmount 需且仅需填写一个)
quoteAmount DECIMAL NO Quote asset 金额 (baseAmount 或 quoteAmount 需且仅需填写一个)
side ENUM YES BUY 或者SELL
walletType ENUM NO 使用扣款钱包类型,SPOTFUNDINGSPOT_FUNDING.默认值为SPOT.
expiredType ENUM YES 1_D, 3_D, 7_D, 30_D (D 指天)
recvWindow LONG NO
timestamp LONG YES

取消闪兑限价单 (USER_DATA)

响应:

{
    "orderId": 1603680255057330400, 
    "status": "CANCELED"
}

POST /sapi/v1/convert/limit/cancelOrder

用户取消闪兑限价单

权重(UID): 200

参数:

名称 类型 是否必需 描述
orderId LONG YES orderId 在 placeOrder接口响应中获得
recvWindow LONG NO
timestamp LONG YES

查询闪兑限价单 (USER_DATA)

响应:

{
    "list": [
        {
            "quoteId": "18sdf87kh9df", 
            "orderId": 1150901289839, 
            "orderStatus": "SUCCESS", 
            "fromAsset": "BNB", 
            "fromAmount": "10", 
            "toAsset": "USDT", 
            "toAmount": "2317.89", 
            "ratio": "231.789", 
            "inverseRatio": "0.00431427", 
            "createTime": 1614089498000,
           "expiredTimestamp": 1614099498000
        }
    ]
}

GET /sapi/v1/convert/limit/queryOpenOrders

查询闪兑限价单

权重(UID): 3000

参数:

名称 类型 是否必需 描述
recvWindow LONG NO 该值不大于60000
timestamp LONG YES

获取闪兑交易记录 (USER_DATA)

响应:

{
   "list": [
        {
            "quoteId": "f3b91c525b2644c7bc1e1cd31b6e1aa6",
            "orderId": 940708407462087195,  // 订单号
            "orderStatus": "SUCCESS",  // 订单状态
            "fromAsset": "USDT",       // 闪兑前币种
            "fromAmount": "20",        // 闪兑前金额
            "toAsset": "BNB",          // 闪兑后币种
            "toAmount": "0.06154036",  // 闪兑后金额
            "ratio": "0.00307702",     // 价格
            "inverseRatio": "324.99",  // 反向价格
            "createTime": 1624248872184
        }
   ],
    "startTime": 1623824139000,
    "endTime": 1626416139000,
    "limit": 100,
    "moreData": false
}

GET /sapi/v1/convert/tradeFlow

权重(UID): 3000

参数:

名称 类型 是否必需 描述
startTime LONG YES
endTime LONG YES
limit INT NO 默认 100, 最大 1000
recvWindow LONG NO
timestamp LONG YES

返佣接口

获取现货返佣历史记录 (USER_DATA)

响应:

{
   "status": "OK",
   "type": "GENERAL",
   "code": "000000000",
   "data": {
        "page": 1,  //当前页
        "totalRecords": 2,  //总记录数
        "totalPageNum": 1,  //总页数
        "data": [
            {
                "asset": "USDT",  // 返佣资产
                "type": 1,        // 返佣类型:1为推荐人返佣,2为被推荐人返现
                "amount": "0.0001126",  // 金额
                "updateTime": 1637651320000
            },
            {
                "asset": "ETH",
                "type": 1,
                "amount": "0.00000056",
                "updateTime": 1637928379000
            }
        ]
    }

}

GET /sapi/v1/rebate/taxQuery

权重(UID): 12000

参数:

名称 类型 是否必需 描述
startTime LONG NO
endTime LONG NO
page INT NO 默认 1
recvWindow LONG NO
timestamp LONG YES

NFT 接口

获取 NFT 资金流水记录 (USER_DATA)

响应:

{
  "total": 2,  //交易记录总数
  "list": [
    {
      "orderNo": "1_470502070600699904", // 数字前缀含义 0:买单,1:卖单,2:版税收入,3:一级市场买单,4:mint 费用
      "tokens": [
        {
          "network": "BSC",  // NFT的网络
          "tokenId": "216000000496",  // NFT的Token ID
          "contractAddress": "MYSTERY_BOX0000087"  // NFT 的 Contract Address
        }
      ],
      "tradeTime": 1626941236000,     // 交易成功时间
      "tradeAmount": "19.60000000",  // 交易金额(实际收入/实际购买总价/实际费用)
      "tradeCurrency": "BNB"               // 交易币种
    },
    {
      "orderNo": "1_488306442479116288",
      "tokens": [
        {
          "network": "BSC",
          "tokenId": "132900000007",
          "contractAddress": "0xAf12111a592e408DAbC740849fcd5e68629D9fb6"
        }
      ],
      "tradeTime": 1631186130000,
      "tradeAmount": "192.00000000",
      "tradeCurrency": "BNB"
    }
  ]
}

GET /sapi/v1/nft/history/transactions

权重(UID): 3000

参数:

名称 类型 是否必需 描述
orderType INT YES 0:买单,1:卖单,2:版税收入,3:一级市场买单,4:mint 费用
startTime LONG NO
endTime LONG NO
limit INT NO 默认 50, 最大 50
page INT NO 默认 1
recvWindow LONG NO
timestamp LONG YES

获取 NFT 充值记录 (USER_DATA)

响应:

{
  "total": 2,
  "list": [
    {
      "network": "ETH",  // NFT的网络
      "txID": null,      // 该笔充值记录的 Transaction ID
      "contractAdrress": "0xe507c961ee127d4439977a61af39c34eafee0dc6",  // NFT的 Contract Address
      "tokenId": "10014",   // NFT的 Token ID
      "timestamp": 1629986047000  
    },
    {
      "network": "BSC",
      "txID": null,
      "contractAdrress": "0x058451b463bab04f52c0799d55c4094f507acfa9",
      "tokenId": "10016",
      "timestamp": 1630083581000
    }
  ]
}

GET /sapi/v1/nft/history/deposit

权重(UID): 3000

参数:

名称 类型 是否必需 描述
startTime LONG NO
endTime LONG NO
limit INT NO 默认 50, 最大 50
page INT NO 默认 1
recvWindow LONG NO
timestamp LONG YES

获取 NFT 提现记录 (USER_DATA)

响应:

{
  "total": 178,
  "list": [
    {
      "network": "ETH",
      "txID": "0x2be5eed31d787fdb4880bc631c8e76bdfb6150e137f5cf1732e0416ea206f57f",
      "contractAdrress": "0xe507c961ee127d4439977a61af39c34eafee0dc6",  // NFT的 Contract Address
      "tokenId": "1000001247",    // NFT的 Token ID
      "timestamp": 1633674433000, // 提现时间
      "fee": 0.1,         // 提现手续费
      "feeAsset": "ETH"   // 手续费币种
    },
    {
      "network": "ETH",
      "txID": "0x3b3aea5c0a4faccd6f306641e6deb9713ab229ac233be3be227f580311e4362a",
      "contractAdrress": "0xe507c961ee127d4439977a61af39c34eafee0dc6",
      "tokenId": "40000030",
      "timestamp": 1633677022000,
      "fee": 0.1,
      "feeAsset": "ETH"
    }
  ]
}

GET /sapi/v1/nft/history/withdraw

权重(UID): 3000

参数:

名称 类型 是否必需 描述
startTime LONG NO
endTime LONG NO
limit INT NO 默认 50, 最大 50
page INT NO 默认 1
recvWindow LONG NO
timestamp LONG YES

获取 NFT 资产 (USER_DATA)

响应:

{
  "total": 347,
  "list": [
    {
      "network": "BSC",  // NFT的网络
      "contractAddress": "REGULAR11234567891779", // NFT的 Contract Address
      "tokenId": "100900000017"  // NFT的 Token ID
    },
    {
      "network": "BSC",
      "contractAddress": "SSMDQ8W59",
      "tokenId": "200500000011"
    },
    {
      "network": "BSC",
      "contractAddress": "SSMDQ8W59",
      "tokenId": "200500000019"
    }
  ]
}

GET /sapi/v1/nft/user/getAsset

权重(UID): 3000

参数:

名称 类型 是否必需 描述
limit INT NO 默认 50, 最大 50
page INT NO 默认 1
recvWindow LONG NO
timestamp LONG YES

币安礼品卡接口

通过币安礼品卡,用户可以通过一串可兑现的密码进行便捷安全的加密货币转账及交易。币安礼品卡API提供及时的币安礼品卡创建,兑现以及状态查询。每张币安礼品卡包含两个部分:“礼品卡卡号” 以及“礼品卡兑现码”。“礼品卡卡号”可以公开流通,并用于验证币安礼品卡的有效性;“礼品卡兑现码”应妥善保管,因为任何拥有兑现码的人可以随时兑现该礼品卡。

一经使用币安礼品卡接口,即代表您同意币安礼品卡用户协议币安支付用户协议

创建币安礼品卡功能仅允许已通过 KYB 的企业帐户使用。

自 2023 年 8 月 21 日起,创建礼品卡将征收 1% 的服务费。

创建单币种礼品卡 (USER_DATA)

响应:

{
    "code": "000000",
    "message": "success",
    "data": {
        "referenceNo": "0033002144060553",
        "code": "6H9EKF5ECCWFBHGE",
        "expiredTime": 1727417154000
    },
    "success": true
}

POST /sapi/v1/giftcard/createCode

该API用于创建一个币安礼品卡。要开始使用,请确保:

权重(IP): 1

参数:

名称 类型 是否必需 描述
token STRING YES 币安礼品卡中的数字货币币种
amount DOUBLE YES 币安礼品卡中的数字货币数量
recvWindow LONG NO
timestamp LONG YES

创建双币种礼品卡(固定价值,设置折扣) (TRADE)

响应:

{
    "code": "000000",
    "message": "success",
    "data": {
        "referenceNo": "0033002144060553",
        "code": "6H9EKF5ECCWFBHGE",
        "expiredTime": 1727417154000
    },
    "success": true
}

POST /sapi/v1/giftcard/buyCode

权重(IP): 1

参数:

名称 类型 是否必需 描述
baseToken STRING YES 你用来支付的货币,例如:BUSD
faceToken STRING YES 你创建的礼品卡面额,例如:BNB。如果 faceToken = baseToken, 将等同于使用 createCode API
baseTokenAmount DOUBLE YES 支付的货币数量,例如:1.002
discount DOUBLE NO 稳定币定值礼品卡的折扣百分比,例如:1 代表 1% 的折扣。小数点精度需小于 6。
recvWindow LONG NO
timestamp LONG YES

兑现币安礼品卡 (USER_DATA)

响应:

{
  "code":"000000",
  "message":"success",
  "data":{
    "referenceNo":"0033002328060227",
    "identityNo":"10317392647411060736",
    "token":"BNB",
    "amount":"0.00000001"
  },
  "success":true
}

POST /sapi/v1/giftcard/redeemCode

该API用于兑现币安礼品卡。兑现后,币种将存入您的资金账户。

请注意,如果您在 24 小时内输入错误币安礼品卡兑现码 5 次,您将无法在当天兑现任何币安礼品卡。

权重(IP): 1

参数:

名称 类型 是否必需 描述
code STRING YES 用于赎回的币安礼品卡,支持加密&未加密两种方式
externalUid String NO 每个外部用户 ID 代表合作伙伴平台上的某个用户。该功能帮助您识别不同用户的兑现行为,例如兑现频次和金额。它还有助于对单个账户进行风险和限额控制,例如设置单个账户每日兑现金额、频次和卡密输错次数的上限。这也将防止单个帐户突破合作伙伴的每日兑现限额从而导致合作伙伴的账户在当日无法继续制码或者兑现。如果您有外部的网站且有不同的用户在您的平台上兑现 币安礼品卡,我们强烈建议您使用此功能并将您用户的用户 ID 传输给我们来进行风控。为保护用户的信息安全,您可以选择以任何格式(上限为 400 个字符)传输用户 ID。
recvWindow LONG NO
timestamp LONG YES

注意:

获取加密后的binance code的java使用方式:

  private static PublicKey getPublicKey(String publicKey) throws Exception {
     KeyFactory keyFactory = KeyFactory.getInstance("RSA");
     byte[] decodedKey = Base64.decodeBase64(publicKey.getBytes());
     X509EncodedKeySpec keySpec = new X509EncodedKeySpec(decodedKey);
     return keyFactory.generatePublic(keySpec);
  }

  public static String encrypt(String content, String publicKeyString) throws Exception {
     if (StringUtils.isAnyEmpty(new CharSequence[]{content, publicKeyString})) {
        throw new IllegalArgumentException("invalid content or privateKey.");
     } else {
        Cipher cipher = Cipher.getInstance("RSA/ECB/OAEPWITHSHA-256ANDMGF1PADDING", "BC");
        cipher.init(Cipher.ENCRYPT_MODE, getPublicKey(publicKeyString));
        return new String(Base64.encodeBase64URLSafe(cipher.doFinal(content.getBytes("UTF-8"))));
     }
  }

  static {
     Security.addProvider(new BouncyCastleProvider());
  }

通过礼品卡卡号验证币安礼品卡 (USER_DATA)

响应:

{
   "code": "000000",
   "message": "success",
   "data": {
    "valid":true,  //是否有效
    "token":"BNB",  //币种
    "amount":"0.00000001"  //金额
  }, 
   "success": true
}

GET /sapi/v1/giftcard/verify

此 API 用于通过输入礼品卡卡号来验证币安礼品卡是否有效。

请注意,如果您在一小时内输入错误的礼品卡卡号 5 次,您将无法在该小时内验证任何礼品卡卡号。

权重(IP): 1

参数:

名称 类型 是否必需 描述
referenceNo STRING YES 输入礼品卡卡号
recvWindow LONG NO
timestamp LONG YES

获取RSA Public Key (USER_DATA)

响应:

{
   "code": "000000",
   "message": "success",
    "data": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCXBBVKLAc1GQ5FsIFFqOHrPTox5noBONIKr+IAedTR9FkVxq6e65updEbfdhRNkMOeYIO2i0UylrjGC0X8YSoIszmrVHeV0l06Zh1oJuZos1+7N+WLuz9JvlPaawof3GUakTxYWWCa9+8KIbLKsoKMdfS96VT+8iOXO3quMGKUmQIDAQAB",
   "success": true
}

GET /sapi/v1/giftcard/cryptography/rsa-public-key

此API用来获取用户的公钥

公钥可以用来对币安礼品卡的兑现码进行加密

请注意公钥获取只有当天有效

权重(IP): 1

参数:

名称 类型 是否必需 描述
recvWindow LONG NO
timestamp LONG YES

获取货币使用限制 (USER_DATA)

响应:

{
  "code": "000000",
  "message": "success",
  "data": [
    {
      "coin": "BNB",
      "fromMin": "0.01",
      "fromMax": "1"
    }
  ],
  "success":true
}

GET /sapi/v1/giftcard/buyCode/token-limit

此 API 是用来查看第2部分描述的稳定币定值的礼品卡所支持的数字货币及限制

权重(IP): 1

参数:

名称 类型 是否必需 描述
baseToken STRING YES 你用来支付的货币,例如:BUSD
recvWindow LONG NO
timestamp LONG YES

错误代码

错误JSON格式:

{
  "code":-1121,
  "msg":"Invalid symbol."
}

错误由两部分组成:错误代码和消息。 代码是通用的,但是消息可能会有所不同。

10xx -常规服务器或网络问题

-1000 UNKNOWN

-1001 DISCONNECTED

-1002 UNAUTHORIZED

-1003 TOO_MANY_REQUESTS

-1004 SERVER_BUSY

-1006 UNEXPECTED_RESP

-1007 TIMEOUT

-1008 SERVER_BUSY

-1014 UNKNOWN_ORDER_COMPOSITION

-1015 TOO_MANY_ORDERS

-1016 SERVICE_SHUTTING_DOWN

-1020 UNSUPPORTED_OPERATION

-1021 INVALID_TIMESTAMP

-1022 INVALID_SIGNATURE

-1099 Not found, authenticated, or authorized

11xx - 2xxx Request issues

-1100 ILLEGAL_CHARS

-1101 TOO_MANY_PARAMETERS

-1102 MANDATORY_PARAM_EMPTY_OR_MALFORMED

-1103 UNKNOWN_PARAM

-1104 UNREAD_PARAMETERS

-1105 PARAM_EMPTY

-1106 PARAM_NOT_REQUIRED

-1111 BAD_PRECISION

-1112 NO_DEPTH

-1114 TIF_NOT_REQUIRED

-1115 INVALID_TIF

-1116 INVALID_ORDER_TYPE

-1117 INVALID_SIDE

-1118 EMPTY_NEW_CL_ORD_ID

-1119 EMPTY_ORG_CL_ORD_ID

-1120 BAD_INTERVAL

-1121 BAD_SYMBOL

-1122 INVALID_SYMBOLSTATUS

-1125 INVALID_LISTEN_KEY

-1127 MORE_THAN_XX_HOURS

-1128 OPTIONAL_PARAMS_BAD_COMBO

-1130 INVALID_PARAMETER

-1131 BAD_RECV_WINDOW

-1134 BAD_STRATEGY_TYPE

-1139 无效的Ticker类型

-1145 INVALID_CANCEL_RESTRICTIONS

-1151 重复的交易对

-1152 无效的SBE报文头部

-1153 不支持的SCHEMA_ID

-1155 SBE 没有开启

-1158 OCO 订单类型被拒绝

-1160 OCO 订单类型的冰山数量参数与 time in force 参数的组合有问题

-2010 NEW_ORDER_REJECTED

-2011 CANCEL_REJECTED

-2013 NO_SUCH_ORDER

-2014 BAD_API_KEY_FMT

-2015 REJECTED_MBX_KEY

-2016 NO_TRADING_WINDOW

-2026 ORDER_ARCHIVED

3xxx-5xxx SAPI 具体问题

-3000 INNER_FAILURE

-3001 NEED_ENABLE_2FA

-3002 ASSET_DEFICIENCY

-3003 NO_OPENED_MARGIN_ACCOUNT

-3004 TRADE_NOT_ALLOWED

-3005 TRANSFER_OUT_NOT_ALLOWED

-3006 EXCEED_MAX_BORROWABLE

-3007 HAS_PENDING_TRANSACTION

-3008 BORROW_NOT_ALLOWED

-3009 ASSET_NOT_MORTGAGEABLE

-3010 REPAY_NOT_ALLOWED

-3011 BAD_DATE_RANGE

-3012 ASSET_ADMIN_BAN_BORROW

-3013 LT_MIN_BORROWABLE

-3014 ACCOUNT_BAN_BORROW

-3015 REPAY_EXCEED_LIABILITY

-3016 LT_MIN_REPAY

-3017 ASSET_ADMIN_BAN_MORTGAGE

-3018 ACCOUNT_BAN_MORTGAGE

-3019 ACCOUNT_BAN_ROLLOUT

-3020 EXCEED_MAX_ROLLOUT

-3021 PAIR_ADMIN_BAN_TRADE

-3022 ACCOUNT_BAN_TRADE

-3023 WARNING_MARGIN_LEVEL

-3024 FEW_LIABILITY_LEFT

-3025 INVALID_EFFECTIVE_TIME

-3026 VALIDATION_FAILED

-3027 NOT_VALID_MARGIN_ASSET

-3028 NOT_VALID_MARGIN_PAIR

-3029 TRANSFER_FAILED

-3036 ACCOUNT_BAN_REPAY

-3037 PNL_CLEARING

-3038 LISTEN_KEY_NOT_FOUND

-3041 BALANCE_NOT_CLEARED

-3042 PRICE_INDEX_NOT_FOUND

-3043 TRANSFER_IN_NOT_ALLOWED

-3044 SYSTEM_BUSY

-3045 SYSTEM

-3999 NOT_WHITELIST_USER

-4001 CAPITAL_INVALID

-4002 CAPITAL_IG

-4003 CAPITAL_IEV

-4004 CAPITAL_UA

-4005 CAPITAL_TOO_MANY_REQUEST

-4006 CAPITAL_ONLY_SUPPORT_PRIMARY_ACCOUNT

-4007 CAPITAL_ADDRESS_VERIFICATION_NOT_PASS

-4008 CAPITAL_ADDRESS_TAG_VERIFICATION_NOT_PASS

-4010 CAPITAL_WHITELIST_EMAIL_CONFIRM

-4011 CAPITAL_WHITELIST_EMAIL_EXPIRED

-4012 CAPITAL_WHITELIST_CLOSE

-4013 CAPITAL_WITHDRAW_2FA_VERIFY

-4014 CAPITAL_WITHDRAW_LOGIN_DELAY

-4015 CAPITAL_WITHDRAW_RESTRICTED_MINUTE

-4016 CAPITAL_WITHDRAW_RESTRICTED_PASSWORD

-4017 CAPITAL_WITHDRAW_RESTRICTED_UNBIND_2FA

-4018 CAPITAL_WITHDRAW_ASSET_NOT_EXIST

-4019 CAPITAL_WITHDRAW_ASSET_PROHIBIT

-4021 CAPITAL_WITHDRAW_AMOUNT_MULTIPLE

-4022 CAPITAL_WITHDRAW_MIN_AMOUNT

-4023 CAPITAL_WITHDRAW_MAX_AMOUNT

-4024 CAPITAL_WITHDRAW_USER_NO_ASSET

-4025 CAPITAL_WITHDRAW_USER_ASSET_LESS_THAN_ZERO

-4026 CAPITAL_WITHDRAW_USER_ASSET_NOT_ENOUGH

-4027 CAPITAL_WITHDRAW_GET_TRAN_ID_FAILURE

-4028 CAPITAL_WITHDRAW_MORE_THAN_FEE

-4029 CAPITAL_WITHDRAW_NOT_EXIST

-4030 CAPITAL_WITHDRAW_CONFIRM_SUCCESS

-4031 CAPITAL_WITHDRAW_CANCEL_FAILURE

-4032 CAPITAL_WITHDRAW_CHECKSUM_VERIFY_FAILURE

-4033 CAPITAL_WITHDRAW_ILLEGAL_ADDRESS

-4034 CAPITAL_WITHDRAW_ADDRESS_CHEAT

-4035 CAPITAL_WITHDRAW_NOT_WHITE_ADDRESS

-4036 CAPITAL_WITHDRAW_NEW_ADDRESS

-4037 CAPITAL_WITHDRAW_RESEND_EMAIL_FAIL

-4038 CAPITAL_WITHDRAW_RESEND_EMAIL_TIME_OUT

-4039 CAPITAL_USER_EMPTY

-4041 CAPITAL_MINUTE_TOO_SMALL

-4042 CAPITAL_CHARGE_NOT_RESET

-4043 CAPITAL_ADDRESS_TOO_MUCH

-4044 CAPITAL_BLACKLIST_COUNTRY_GET_ADDRESS

-4045 CAPITAL_GET_ASSET_ERROR

-4046 CAPITAL_AGREEMENT_NOT_CONFIRMED

-4047 CAPITAL_DATE_INTERVAL_LIMIT

-4060 CAPITAL_WITHDRAW_USER_ASSET_LOCK_DEPOSIT

-5001 ASSET_DRIBBLET_CONVERT_SWITCH_OFF

-5002 ASSET_ASSET_NOT_ENOUGH

-5003 ASSET_USER_HAVE_NO_ASSET

-5004 USER_OUT_OF_TRANSFER_FLOAT

-5005 USER_ASSET_AMOUNT_IS_TOO_LOW

-5006 USER_CAN_NOT_REQUEST_IN_24_HOURS

-5007 AMOUNT_OVER_ZERO

-5008 ASSET_WITHDRAW_WITHDRAWING_NOT_ENOUGH

-5009 PRODUCT_NOT_EXIST

-5010 TRANSFER_FAIL

-5011 FUTURE_ACCT_NOT_EXIST

-5012 TRANSFER_PENDING

-5021 PARENT_SUB_HAVE_NO_RELATION

-5012 FUTURE_ACCT_OR_SUBRELATION_NOT_EXIST

6XXX - 币安宝相关

-6001 DAILY_PRODUCT_NOT_EXIST

-6003 DAILY_PRODUCT_NOT_ACCESSIBLE

-6004 DAILY_PRODUCT_NOT_PURCHASABLE

-6005 DAILY_LOWER_THAN_MIN_PURCHASE_LIMIT

-6006 DAILY_REDEEM_AMOUNT_ERROR

-6007 DAILY_REDEEM_TIME_ERROR

-6008 DAILY_PRODUCT_NOT_REDEEMABLE

-6009 REQUEST_FREQUENCY_TOO_HIGH

-6011 EXCEEDED_USER_PURCHASE_LIMIT

-6012 BALANCE_NOT_ENOUGH

-6013 PURCHASING_FAILED

-6014 UPDATE_FAILED

-6015 EMPTY_REQUEST_BODY

-6016 PARAMS_ERR

-6017 NOT_IN_WHITELIST

-6018 ASSET_NOT_ENOUGH

-6019 PENDING

-6020 PROJECT_NOT_EXISTS

70xx - 期货

-7001 FUTURES_BAD_DATE_RANGE

-7002 FUTURES_BAD_TYPE

20xxx - 合约/现货策略交易

-20121 Invalid symbol

-20124 Invalid algo id or it has been completed

-20130 Invalid data sent for a parameter

-20132 The client algo id is duplicated

-20194 Duration is too short to execute all required quantity

-20195 The total size is too small

-20196 The total size is too large

-20198 Reach the max open orders allowed

-20204 The notional of USD is less or more than the limit

过滤器故障

报错信息 描述
"Filter failure: PRICE_FILTER" "价格"过高,过低和/或不遵循交易对的最小价格规则。
"Filter failure: PERCENT_PRICE" "价格"比最近Y分钟的平均加权价格高X%或X%太低。
"Filter failure: LOT_SIZE" "数量"太高,太低和/或不遵循该交易对的步长规则。
"Filter failure: MIN_NOTIONAL" 价格*数量太低,无法成为该交易对的有效订单。
"Filter failure: ICEBERG_PARTS" ICEBERG 订单会分成太多部分; icebergQty太小。
"Filter failure: MARKET_LOT_SIZE" "MARKET"订单的"数量"过高,过低和/或未遵循交易对的步长规则。
"Filter failure: MAX_POSITION" 账户的仓位已达到定义的最大限额。
它是由基础资产余额的总和以及所有未平仓买入订单的数量之和组成的。
"Filter failure: MAX_NUM_ORDERS" 客户在交易对上有太多挂单。
"Filter failure: MAX_NUM_ALGO_ORDERS" 账户在该交易对下最多的止盈/止损挂单数。
"Filter failure: MAX_NUM_ICEBERG_ORDERS" 客户在交易对上有太多 iceberg 挂单。
"Filter failure: TRAILING_DELTA" trailingDelta 值不在限定的范围内.
"Filter failure: EXCHANGE_MAX_NUM_ORDERS" 帐户上的交易所有太多挂单。
"Filter failure: EXCHANGE_MAX_ALGO_ORDERS" 帐户有太多止损挂单和/或在交易所收取获利指令。
"Filter failure: EXCHANGE_MAX_NUM_ICEBERG_ORDERS" 账户在交易所有太多未平仓的冰山订单。

10xxx - 质押借币

-10001 SYSTEM_MAINTENANCE

-10002 INVALID_INPUT

-10005 NO_RECORDS

-10007 COIN_NOT_LOANABLE

-10008 COIN_NOT_LOANABLE

-10009 COIN_NOT_COLLATERAL

-10010 COIN_NOT_COLLATERAL

-10011 INSUFFICIENT_ASSET

-10012 INVALID_AMOUNT

-10013 INSUFFICIENT_AMOUNT

-10015 DEDUCTION_FAILED

-10016 LOAN_FAILED

-10017 REPAY_EXCEED_DEBT

-10018 INVALID_AMOUNT

-10019 CONFIG_NOT_EXIST

-10020 UID_NOT_EXIST

-10021 ORDER_NOT_EXIST

-10022 INVALID_AMOUNT

-10023 ADJUST_LTV_FAILED

-10024 ADJUST_LTV_NOT_SUPPORTED

-10025 REPAY_FAILED

-10026 INVALID_PARAMETER

-10028 INVALID_PARAMETER

-10029 AMOUNT_TOO_SMALL

-10030 AMOUNT_TOO_LARGE

-10031 QUOTA_REACHED

-10032 REPAY_NOT_AVAILABLE

-10034 REPAY_NOT_AVAILABLE

-10039 AMOUNT_TOO_SMALL

-10040 AMOUNT_TOO_LARGE

-10041 INSUFFICIENT_AMOUNT

-10042 ASSET_NOT_SUPPORTED

-10043 ASSET_NOT_SUPPORTED

-10044 QUOTA_REACHED

-10045 COLLTERAL_REPAY_NOT_SUPPORTED

-10046 EXCEED_MAX_ADJUSTMENT

-10047 REGION_NOT_SUPPORTED

12xxx - 流动性挖矿

-12014 TOO MANY REQUESTS

18xxx - 币安码

-18002

-18003

-18004

-18005

-18006

-18007

21xxx - 統一帳戶

-21001 USER_IS_NOT_UNIACCOUNT

-21002 UNI_ACCOUNT_CANT_TRANSFER_FUTURE

-21003 NET_ASSET_MUST_LTE_RATIO

-21004 USER_NO_LIABILITY

-21005 NO_ENOUGH_ASSET

-21006 HAD_IN_PROCESS_REPAY

-21007 IN_FORCE_LIQUIDATION

订单拒绝错误

以下错误代码表示撮合引擎返回的订单相关错误:

结合以下消息将指示特定的错误:

错误信息 描述
"Unknown order sent." 找不到订单(通过"orderId","clientOrderId","origClientOrderId")
"Duplicate order sent." clientOrderId已经被使用
"Market is closed." 该交易对不在交易范围
"Account has insufficient balance for requested action." 没有足够的资金来完成行动
"Market orders are not supported for this symbol." 交易对上未启用"MARKET"
"Iceberg orders are not supported for this symbol." 交易对上未启用icebergQty
"Stop loss orders are not supported for this symbol." 交易对上未启用 STOP_LOSS
"Stop loss limit orders are not supported for this symbol." 交易对上未启STOP_LOSS_LIMIT
"Take profit orders are not supported for this symbol." 交易对上未启用TAKE_PROFIT
"Take profit limit orders are not supported for this symbol." 交易对上未启用TAKE_PROFIT_LIMIT
"Price * QTY is zero or less." price * quantity太小
"IcebergQty exceeds QTY." icebergQty 必须少于订单数量
"This action is disabled on this account." 联系客户支持; 该账户已禁用了某些操作。
"This account may not place or cancel orders." 联系客户支持: 该账户已被禁用了交易操作。
"Unsupported order combination" 不允许组合orderType, timeInForce, stopPrice, 和/或 icebergQty
"Order would trigger immediately." 与最后交易价格相比,订单的止损价无效。
"Cancel order is invalid. Check origClientOrderId and orderId." 未发送origClientOrderIdorderId
"Order would immediately match and take." LIMIT_MAKER 订单类型将立即匹配并进行交易,而不是纯粹的生成订单。
"The relationship of the prices for the orders is not correct." OCO订单中设置的价格不符合报价规则:
请参考以下示例:
BUYLIMIT_MAKER price < Last Traded Price < stopPrice
SELLLIMIT_MAKER price > Last Traded Price > stopPrice
"OCO orders are not supported for this symbol" OCO订单不支持该交易对
"Quote order qty market orders are not support for this symbol." 这个交易对,市价单不支持参数quoteOrderQty
"Trailing stop orders are not supported for this symbol." 此symbol不支持 trailingDelta
"Order cancel-replace is not supported for this symbol." 此symbol不支持 POST /api/v3/order/cancelReplace 或者 order.cancelReplace (WebSocket API) |
"This symbol is not permitted for this account." 账户和交易对的权限不一致 (比如 SPOT, MARGIN 等)。|
"This symbol is restricted for this account." 账户没有权限在此交易对交易 (比如账户只拥有 ISOLATED_MARGIN权限,则无法下SPOT 订单)。 |
"Order was not canceled due to cancel restrictions." cancelRestrictions 设置为 ONLY_NEW 但订单状态不是 NEW

cancelRestrictions 设置为 ONLY_PARTIALLY_FILLED 但订单状态不是 PARTIALLY_FILLED。 |
"Rest API trading is not enabled." / "WebSocket API trading is not enabled." 下单时,服务器没有设置为允许访问 TRADE 的接口。
"Order book liquidity is less than LOT_SIZE filter minimum quantity." 当订单簿流动性小于 LOT_SIZE 过滤器配置的最小数量时,无法提交包含 quoteOrderQty 的市价单。
"Order book liquidity is less than MARKET_LOT_SIZE filter minimum quantity." 当订单簿流动性小于 MARKET_LOT_SIZE 过滤器的最小数量时,无法提交包含 quoteOrderQty 的市价单。
"Order book liquidity is less than symbol minimum quantity." 当订单簿里没有订单时,无法提交包含 quoteOrderQty 的市价单。

关于 POST /api/v3/order/cancelReplace 的错误

-2021 Order cancel-replace partially failed

收到该错误码代表撤单或者下单失败。

-2022 Order cancel-replace failed.

收到该错误码代表撤单下单都失败。

备注说明

请求参数

Email地址