Change Log
The following changes will be effective from 2023-08-25 at UTC 00:00.
- The
REQUEST_WEIGHT
rate limit for SPOT API has been adjusted to 6,000 every minute. - The
RAW_REQUESTS
for SPOT API has been adjusted to 61,000 every 5 minutes. - The weights to the following requests for the SPOT API have been adjusted.
Please refer to the table for more details:
Request | Previous Request Weight | New Request Weight |
---|---|---|
GET /api/v3/order | 2 | 4 |
GET /api/v3/orderList | 2 | 4 |
GET /api/v3/openOrders - With symbol | 3 | 6 |
GET /api/v3/openOrders - Without 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 - Using preventedMatchId | 1 | 2 |
GET /api/v3/myPreventedMatches - Using 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 - With symbol | 1 | 2 |
GET /api/v3/ticker/bookTicker - Without symbol or With symbols | 2 | 4 |
GET /api/v3/ticker/price - With symbol | 1 | 2 |
GET /api/v3/ticker/price - Without symbol or With symbols | 2 | 4 |
GET /api/v3/ticker/24hr - With symbol or With symbols using 1-20 symbols | 1 | 2 |
GET /api/v3/ticker/24hr - With symbols using 21-100 symbols | 20 | 40 |
GET /api/v3/ticker/24hr - Without symbol or symbols using 101 or more symbols | 40 | 80 |
GET /api/v3/avgPrice | 1 | 2 |
GET /api/v3/ticker | 2 | 4 |
GET /api/v3/ticker - Maximum weight for this request | 100 | 200 |
POST /api/v3/userDataStream | 1 | 2 |
PUT /api/v3/userDataStream | 1 | 2 |
DELETE /api/v3/userDataStream | 1 | 2 |
**2023-08-18**
- Update endpoints for VIP Loan:
POST /sapi/v1/loan/vip/borrow
: add fieldisFlexibleRate
to borrow using flexible rate loan
**2023-08-08**
Smart Order Routing (SOR) has been added to the APIs. For more information please refer to our FAQ. Please wait for future announcements on when the feature will be enabled.
SPOT API
- Changes to
GET /api/v3/exchangeInfo
:- New field in response:
sors
, describing SORs enabled on the exchange.
- New field in response:
- Changes to
GET /api/v3/myPreventedMatches
- New field
makerSymbol
will appear in the response for all prevented matches.
- New field
- New endpoints for order placement using SOR:
POST /api/v3/sor/order
POST /api/v3/sor/order/test
- New endpoint
GET /api/v3/myAllocations
USER DATA STREAM
- Changes to
executionReport
:- These fields are only relevant for orders placed using SOR:
- New field
b
formatchType
- New field
a
forallocId
- New field
k
forworkingFloor
- New field
- This field is only relevant for orders expiring due to STP:
- New field
Cs
forcounterSymbol
- New field
- These fields are only relevant for orders placed using SOR:
**2023-08-02**
- As per the announcement, eeffective from 21 Aug 2023, a 1% transaction fee will apply when you buy or create gift cards in Binance directly. The following endpoints are impacted:
POST /sapi/v1/giftcard/createCode
POST /sapi/v1/giftcard/buyCode
**2023-07-20**
- As per the announcement, effective from 20 July 2023, creating gift cards is limited only to entity accounts which have passed KYB verification. The following endpoints are impacted:
POST /sapi/v1/giftcard/createCode
POST /sapi/v1/giftcard/buyCode
- New endpoints for Classic Porfolio Margin:
POST /sapi/v1/portfolio/asset-collection
: Fund Collection by Asset
**2023-07-18**
- New API key type – Ed25519 – is now supported. (UI support will be released this week.)
- Ed25519 API keys are an alternative to RSA API keys, using asymmetric cryptography to authenticate your requests on the API.
- We recommend switching to Ed25519 for improved performance and security.
For more information, please refer to our supplemental document API Key Types.
- Documentation has been updated with how to sign a payload with Ed25519 keys.
**2023-07-14**
- New endpoints for Classic Porfolio Margin:
POST /sapi/v1/portfolio/repay-futures-switch
: Change Auto-repay-futures StatusGET /sapi/v1/portfolio/repay-futures-switch
: Get Auto-repay-futures StatusPOST /sapi/v1/portfolio/repay-futures-negative-balance
: Repay futures Negative Balance
- New endpoints for VIP Loan:
POST /sapi/v1/loan/vip/renew
: VIP Loan Renew
**2023-07-11**
Notice: The change below are being rolled out, and will take approximately a week to complete.
SPOT API
- Changes to error messages:
- Previously, when duplicate symbols were passed to requests that do not allow it, the error would be "Mandatory parameter symbols was not sent, was empty/null, or malformed."
- Now, the error message is "Symbol is present multiple times in the list", with a new error code
-1151
- This affects the following requests:
GET /api/v3/exchangeInfo
GET /api/v3/ticker/24hr
GET /api/v3/ticker/price
GET/api/v3/ticker/bookTicker
- Fixed a bug where some non-archived orders being queried would receive the error code that their order was archived.
- Changes to
GET /api/v3/account
:- New field
preventSor
will appear in the response. - New field
uid
that shows the User Id/Account will appear in the response.
- New field
- Changes to
GET /api/v3/historicalTrades
:- Changed security type from
MARKET_DATA
toNONE
. - This means that the
X-MBX-APIKEY
header is no longer necessary and is now ignored.
- Changed security type from
The following changes will take effect approximately a week from the release date::
- Fixed multiple bugs with orders that use
type=MARKET
andquoteOrderQty
, also known as “reverse market orders”:- Reverse market orders are no longer partially filled, or filled for zero or negative quantity under extreme market conditions.
MARKET_LOT_SIZE
filter now correctly rejects reverse market orders that go over the symbol'smaxQty
.
- Fixed a bug where OCO orders using
trailingDelta
could have an incorrecttrailingTime
value after either leg of the OCO is touched. - New field
transactTime
will appear in order cancellation responses. This affects the following requests:DELETE /api/v3/order
POST /api/v3/order/cancelReplace
DELETE /api/v3/openOrders
DELETE /api/v3/orderList
**2023-07-07**
- New endpoints for Margin:
POST /sapi/v1/margin/max-leverage
: Adjust cross margin max leverage
**2023-06-29**
- Added multiple new endpoints related to ETH Staking in Staking.
- New endpoints for Margin:
GET /sapi/v1/margin/dust
: Get Assets That Can Be Converted Into BNBPOST /sapi/v1/margin/dust
: Convert dust assets to BNB.
- New endpoints for VIP Loan(effective on 2023-06-30):
POST /sapi/v1/loan/vip/borrow
: Borrow VIP loanGET /sapi/v1/loan/vip/loanable/data
: Get interest rate and borrow limit of loanable assets.GET /sapi/v1/loan/vip/collateral/data
: Get collateral asset dataGET /sapi/v1/loan/vip/request/data
: Query application status.
**2023-06-22**
- New endpoints for Sub-Account:
POST /sapi/v1/sub-account/eoptions/enable
: enable Options for Sub-accountGET /sapi/v1/managed-subaccount/query-trans-log
: Query Managed Sub Account Transfer Log (For Trading Team Sub Account)
- Update endpoints for Margin:
POST /sapi/v1/margin/order
: add fieldsautoRepayAtCancel
andselfTradePreventionMode
POST /sapi/v1/margin/order/oco
: add fieldselfTradePreventionMode
- New endpoints for Simple Earn.
- Delete endpoint for Lending:
GET /sapi/v1/lending/daily/product/list
GET /sapi/v1/lending/daily/userLeftQuota
POST /sapi/v1/lending/daily/purchase
GET /sapi/v1/lending/daily/userRedemptionQuota
POST /sapi/v1/lending/daily/redeem
GET /sapi/v1/lending/daily/token/position
GET /sapi/v1/lending/union/account
GET /sapi/v1/lending/union/purchaseRecord
GET /sapi/v1/lending/union/redemptionRecord
GET /sapi/v1/lending/union/interestHistory
**2023-06-20**
- New endpoints for Auto-Investment:
GET /sapi/v1/lending/auto-invest/target-asset/list
: query target asset listGET /sapi/v1/lending/auto-invest/target-asset/roi/list
: query ROI return list for target assetGET /sapi/v1/lending/auto-invest/all/asset
: query all source assets and target assetsGET /sapi/v1/lending/auto-invest/source-asset/list
: query source asset to be used for investmentPOST /sapi/v1/lending/auto-invest/plan/add
: create an investment planPOST/sapi/v1/lending/auto-invest/plan/edit
: adjust the details of the planPOST /sapi/v1/lending/auto-invest/plan/edit-status
: change plan statusGET /sapi/v1/lending/auto-invest/plan/list
: query plan listsGET /sapi/v1/lending/auto-invest/plan/id
: Get holding details of the planGET /sapi/v1/lending/auto-invest/history/list
: query subscription transaction history of a plan
- Update endpoints for Margin:
GET /sapi/v1/margin/delist-schedule
: get tokens or symbols delist schedule for cross margin and isolated margin
**2023-06-09**
- Below changes are applicable to the Classic Portfolio Margin Program and the new Portfolio Margin Program: these will be taken into effect on 2023-06-22: Transfers in and out of Portfolio Margin Account can only be done through Cross Margin Wallets. Please be aware that transfer in and out from UM or CM wallets to non-PM wallets (such as spot wallet and option wallet) are not supported, below are the impacted APIs:
- For
POST /sapi/v1/asset/transfer
, below parameters can no longer be supported:- MAIN_UMFUTURE
- MAIN_CMFUTURE
- UMFUTURE_MAIN
- UMFUTURE_MARGIN
- CMFUTURE_MARGIN
- MARGIN_UMFUTURE
- MARGIN_CMFUTURE
- FUNDING_UMFUTURE
- UMFUTURE_FUNDING
- FUNDING_CMFUTURE
- CMFUTURE_FUNDING
- UMFUTURE_OPTION
- OPTION_UMFUTURE
POST /sapi/v1/sub-account/futures/internalTransfer
will no longer be supportedPOST /sapi/v1/sub-account/futures/transfer
will no longer be supportedPOST /sapi/v1/futures/transfer
will no longer be supportedPOST /sapi/v1/sub-account/universalTransfer
will no longer be supported for below:- SPOT transfer to USDT_FUTURE, COIN_FUTURE (regardless of master or sub)
- USDT_FUTURE, COIN_FUTURE transfer to SPOT (regardless of master or sub)
- For
- New endpoints for Classic Portfolio Margin(Effective on 06/09):
POST /sapi/v1/portfolio/auto-collection
: all transfers (excluding UM Account’s BNB) from Futures Account to Margin accountPOST /sapi/v1/portfolio/bnb-transfer
: BNB transfer can be between Margin Account and UM Account
**2023-06-06**
- A new endpoint is now available for redundancy: https://api-gcp.binance.com/
- This is using the GCP (Google Cloud Platform) CDN and may have slower performance compared to
api1
-api4
endpoints.
- This is using the GCP (Google Cloud Platform) CDN and may have slower performance compared to
**2023-06-01**
- New WEBSOCKET for Bwap:
- New Base url
wss://api.binance.com/sapi/wss
for BSwap streamsearn_swapprice_<poolid>
andearn_swapprice_all
- New Base url
**2023-05-30**
- Update endpoints for Pay:
GET /sapi/v1/pay/transactions
: add more content in response fieldfundsDetail
**2023-05-26**
Notice: The change below are being rolled out, and will take approximately a week to complete.
- The following base endpoints may give better performance but have less stability than https://api.binance.com:
**2023-05-24**
- The previous market data URLs have been deprecated. Please update your code immediately to prevent interruption of our services.
- API Market data from
data.binance.com
can now be accessed fromdata-api.binance.vision
. - Websocket Market Data from
data-stream.binance.com
can now be accessed fromdata-stream.binance.vision
.
- API Market data from
GET /sapi/v1/portfolio/interest-rate
has be deprecated, users can query the Classic Portfolio Margin Negative Balance Interest Rate by usingGET /sapi/v1/margin/interestRateHistory
.
**2023-05-18**
- New endpoints for Wallet:
POST /sapi/v1/capital/deposit/credit-apply
: apply deposit credit for expired address
**2023-05-09**
- New endpoints for Portfolio Margin:
GET /sapi/v1/portfolio/asset-index-price
: query portfolio margin asset index price
- Update endpoints for Wallet:
POST /sapi/v1/asset/transfer
: add enumMAIN_PORTFOLIO_MARGIN
andPORTFOLIO_MARGIN_MAIN
**2023-04-20**
- New endpoints for Sub-Account:
GET /sapi/v1/managed-subaccount/deposit/address
: get managed sub-account deposit address
- Update endpoints for VIP Loans:
GET /sapi/v1/loan/vip/ongoing/orders
: add fieldstotalCollateralValueAfterHaircut
andlockedCollateralValue
**2023-04-18**
- New endpoints for Spot Algo:
POST /sapi/v1/algo/spot/newOrderTwap
to support new orderDELETE /sapi/v1/algo/spot/order
to support cancel Algo orderGET /sapi/v1/algo/spot/openOrders
to support query Algo open ordersGET /sapi/v1/algo/spot/historicalOrders
to support query Algo historical ordersGET /sapi/v1/algo/spot/subOrders
to support query Algo sub orders for a specified algoId
**2023-03-23**
- Update endpoints for Sub-Account:
GET /sapi/v1/managed-subaccount/queryTransLogForInvestor
: Add response fieldtranId
GET /sapi/v1/managed-subaccount/queryTransLogForTradeParent
: Add response fieldtranId
- New endpoints for Sub-Account:
GET /sapi/v1/managed-subaccount/info
: query investor's managed sub-account listGET /sapi/v1/sub-account/transaction-statistics
: Query sub-account transaction tatistics
**2023-03-13**
Notice: All changes are being rolled out gradually to all our servers, and may take a week to complete.
GENERAL CHANGES
- The error messages for certain issues have been improved for easier troubleshooting.
Situation | Old Error Message | New Error Message |
---|---|---|
An account cannot place or cancel an order, due to trading ability disabled. | This action is disabled on this account. | This account may not place or cancel orders. |
When the permissions configured on the symbol do not match the permissions on the account. | This symbol is not permitted for this account. | |
When the account tries to place an order on a symbol it has no permissions for. | This symbol is restricted for this account. | |
Placing an order when symbol is not TRADING. | Unsupported order combination. | This order type is not possible in this trading phase. |
Placing an order with timeinForce=IOC or FOK on a trading phase that does not support it. | Limit orders require GTC for this phase. |
- Fixed error message for querying archived orders:
- Previously, If an archived order (i.e. order with status
CANCELED
orEXPIRED
whereexecutedQty
== 0 that occurred more than 90 days in the past.) is queried, the error message would be:{"code": -2013,"msg": "Order does not exist."}
- Now, the error message is:
{"code": -2026,"msg": "Order was canceled or expired with no executed qty over 90 days ago and has been archived."}
- Previously, If an archived order (i.e. order with status
- Behavior for API requests with
startTime
andendTime
:- Previously some requests failed if the
startTime
==endTime
. - Now, all API requests that accept
startTime
andendTime
allow the parameters to be equal. This applies to the following requests:- Rest API
GET /api/v3/aggTrades
GET /api/v3/klines
GET /api/v3/allOrderList
GET /api/v3/allOrders
GET /api/v3/myTrades
- Rest API
- Previously some requests failed if the
The following changes will take effect approximately a week from the release date, but the rest of the documentation has been updated to reflect the future changes:
- Changes to Filter Evaluation:
- Previous behavior:
LOT_SIZE
andMARKET_LOT_SIZE
required that (quantity
-minQty
) %stepSize
== 0. - New behavior: This has now been changed to (
quantity
%stepSize
) == 0.
- Previous behavior:
- Bug fix with reverse
MARKET
orders (i.e.,MARKET
usingquoteOrderQty
):- Previous behavior: Reverse market orders would always have the status
FILLED
even if the order did not fully fill due to low liquidity. - New behavior: If the reverse market order did not fully fill due to low liquidity the order status will be
EXPIRED
, andFILLED
only if the order was completely filled.
- Previous behavior: Reverse market orders would always have the status
SPOT API
- Changes to
DELETE /api/v3/order
andPOST /api/v3/order/cancelReplace
:- A new optional parameter
cancelRestrictions
that determines whether the cancel will succeed if the order status isNEW
orPARTIALLY_FILLED
. - If the order cancellation fails due to
cancelRestrictions
, the error will be:{"code": -2011,"msg": "Order was not canceled due to cancel restrictions."}
- A new optional parameter
**2023-02-27**
- New endpoints for Margin:
/sapi/v1/margin/next-hourly-interest-rate
: Get user the next hourly estimate interest
- New endpoints for Porfolio Margin:
GET /sapi/v1/portfolio/interest-history
: get user's portfolio margin interest historyGET /sapi/v1/portfolio/interest-rate
: get portfolio margin interest rate
**2023-02-21**
- Adjusted endpoints for Crypto Loan:
POST /sapi/v1/loan/borrow
: paramaterloanTerm
is restricted to 7 or 30
**2023-02-17**
The Websocket Stream now only allows 300 connections requests every 5 minutes.
This limit is per IP address.
Please be careful when trying to open multiple connections or reconnecting to the Websocket API.
**2023-02-13**
- New endpoints for Sub-Account:
GET /sapi/v4/sub-account/assets
: Fetch sub-account assets
**2023-02-02**
- New endpoints for Margin:
GET /sapi/v1/margin/exchange-small-liability
: Query the coins which can be small liability exchangePOST /sapi/v1/margin/exchange-small-liability
: Cross Margin Small Liability ExchangeGET /sapi/v1/margin/exchange-small-liability-history
: Get Small liability Exchange History
- Update endpoints for Wallet:
- Universal Transfer
POST /sapi/v1/asset/transfer
support option transfer
- Universal Transfer
**2023-01-26**
As per the announcement, Self Trade Prevention will be enabled at 2023-01-26 08:00 UTC.
Please refer to GET /api/v3/exchangeInfo
from the Rest API or exchangeInfo
from the Websocket API on the default and allowed modes.
**2023-01-23**
New API cluster has been added. Note that all endpoints are functionally equal, but may vary in performance.
**2023-01-19**
ACTUAL RELEASE DATE TBD
SPOT API
New Feature: Self-Trade Prevention (aka STP) will be added to the system at a later date. This will prevent orders from matching with orders from the same account, or accounts under the same tradeGroupId
.
Please refer to GET /api/v3/exchangeInfo
from the SPOT API or exchangeInfo
from the Websocket API on the status.
- New order status:
EXPIRED_IN_MATCH
- This means that the order expired due to STP being triggered. - New endpoint:
GET /api/v3/myPreventedMatches
- This queries the orders that expired due to STP being triggered.
- New optional parameter
selfTradePreventionMode
has been added to the following endpoints:POST /api/v3/order
POST /api/v3/order/oco
POST /api/v3/cancelReplace
- New responses that will appear for all order placement endpoints if there was a prevented match (i.e. if an order could have matched with an order of the same account, or the accounts are in the same
tradeGroupId
):tradeGroupId
- This will only appear if account is configured to atradeGroupId
and if there was a prevented match.preventedQuantity
- Only appears if there was a prevented match.- An array
preventedMatches
with the following fields:preventedMatchId
makerOrderId
price
takerPreventedQuantity
- This will only appear ifselfTradePreventionMode
set isEXPIRE_TAKER
orEXPIRE_BOTH
.makerPreventedQuantity
- This will only appear ifselfTradePreventionMode
set isEXPIRE_MAKER
orEXPIRE_BOTH
.
- New fields
preventedMatchId
andpreventedQuantity
that can appear in the order query endpoints if the order had expired due to an STP trigger:GET /api/v3/order
GET /api/v3/openOrders
GET /api/v3/allOrders
USER DATA STREAM
- New execution Type:
TRADE_PREVENTION
- New fields for
executionReport
(These fields will only appear if the order has expired due to STP trigger)u
-tradeGroupId
v
-preventedMatchId
U
-counterOrderId
A
-preventedQuantity
B
-lastPreventedQuantity
**2023-01-13**
- The following endpoints will be discontinued on January 13, 2023 6:00 AM UTC:
POST /sapi/v1/sub-account/subAccountApi/ipRestriction
to support master account enable and disable IP restriction for a sub-account API KeyPOST /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList
to support master account add IP list for a sub-account API Key
- New endpoints for Sub-Account:
GET /sapi/v1/managed-subaccount/fetch-future-asset
: Investor can use this api to query managed sub account futures asset detailsGET /sapi/v1/managed-subaccount/marginAsset
: Investor can use this api to query managed sub account margin asset details
- New endpoin for Margin:
GET /sapi/v1/margin/crossMarginCollateralRatio
: Get cross margin collateral ratio
**2023-01-05**
- New endpoints for Sub-Account:
GET /sapi/v1/managed-subaccount/queryTransLogForInvestor
: Investor can use this api to query managed sub account transfer logGET /sapi/v1/managed-subaccount/queryTransLogForTradeParent
: Trading team can use this api to query managed sub account transfer log
**2022-12-26**
- New endpoints for wallet:
GET /sapi/v1/capital/contract/convertible-coins
: Get a user's auto-conversion settings in deposit/withdrawalPOST /sapi/v1/capital/contract/convertible-coins
: User can use it to turn on or turn off the BUSD auto-conversion from/to a specific stable coin.
**2022-12-15**
- New RSA signature
- Documentation has been updated to show how to sign a request using an RSA key.
- For security reasons, we recommend to use RSA keys instead of HMAC keys when generating an API key.
- We accept
PKCS#8
(BEGIN PUBLIC KEY). - More details on how to upload your RSA public key will be added at a later date.
**2022-12-13**
REST API
Some error messages on error code -1003
have changed:
- Previous error message:
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.
has been updated to:
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.
- Previous error message
Way too much request weight used; IP banned until %s. Please use the websocket for live updates to avoid bans.
has been updated to:
Way too much request weight used; IP banned until %s. Please use WebSocket Streams for live updates to avoid bans.
**2022-12-05**
Notice: These changes are being rolled out gradually to all our servers, and will take approximately a week to complete.
WEBSOCKET
!bookTicker
will be removed by December 7, 2022. Please use the Individual Book Ticker Streams instead. (<symbol>@bookTicker).- Multiple <symbol>@bookTicker streams can be subscribed to over one connection. (E.g.
wss://stream.binance.com:9443/stream?streams=btcusdt@bookTicker/bnbbtc@bookTicker
)
- Multiple <symbol>@bookTicker streams can be subscribed to over one connection. (E.g.
SPOT API
New error code
-1135
- This error code will occur if a parameter requiring a JSON object is invalid.
New error code
-1108
- This error will occur if a value to a parameter being sent was too large, potentially causing overflow.
- This error code can occur in the following endpoints:
POST /api/v3/order
POST /api/v3/order/cancelReplace
POST /api/v3/order/oco
Changes to
GET /api/v3/aggTrades
- Previous behavior:
startTime
andendTime
had to be used in combination and could only be an hour apart. - New behavior:
startTime
andendTime
can be used individually and the 1 hour limit has been removed.- When using
startTime
only, this will return trades from that time, up to thelimit
provided. - When using
endTime
only, this will return trades starting from theendTime
including all trades before that time, up to the limit provided. - If
limit
not provided, regardless of used in combination or sent individually, the endpoint will use the default limit.
- When using
- Previous behavior:
Changes to
GET /api/v3/myTrades
Fixed a bug where
symbol
+orderId
combination would return all trades even if the number of trades went beyond the500
default limit.Previous behavior: The API would send specific error messages depending on the combination of parameters sent. E.g:
{ "code": -1106, "msg": "Parameter X was sent when not required." }
New behavior: If the combinations of optional parameters to the endpoint were not supported, then the endpoint will respond with the generic error:
{ "code": -1128, "msg": "Combination of optional parameters invalid." }
Added a new combination of supported parameters:
symbol
+orderId
+fromId
.The following combinations of parameters were previously supported but no longer accepted, as these combinations were only taking
fromId
into consideration, ignoringstartTime
andendTime
:symbol
+fromId
+startTime
symbol
+fromId
+endTime
symbol
+fromId
+startTime
+endTime
Thus, these are the supported combinations of parameters:
symbol
symbol
+orderId
symbol
+startTime
symbol
+endTime
symbol
+fromId
symbol
+startTime
+endTime
symbol
+orderId
+fromId
Note: These new fields will appear approximately a week from the release date.
- Changes to
GET /api/v3/exchangeInfo
- New fields
defaultSelfTradePreventionMode
andallowedSelfTradePreventionModes
- New fields
- Changes to the Order Placement Endpoints/Order Query/Order Cancellation Endpoints:
- New field
selfTradePreventionMode
will appear in the response. - Affects the following endpoints:
POST /api/v3/order
POST /api/v3/order/oco
POST /api/v3/order/cancelReplace
GET /api/v3/order
DELETE /api/v3/order
DELETE /api/v3/orderList
- New field
- Changes to
GET /api/v3/account
- New field
requireSelfTradePrevention
will appear in the response.
- New field
- New field
workingTime
, indicating when the order started working on the order book, will appear in the following endpoints:POST /api/v3/order
GET /api/v3/order
POST /api/v3/order/cancelReplace
POST /api/v3/order/oco
GET /api/v3/order
GET /api/v3/openOrders
GET /api/v3/allOrders
- Field
trailingTime
, indicating the time when the trailing order is active and tracking price changes, will appear for the following order types (TAKE_PROFIT
,TAKE_PROFIT_LIMIT
,STOP_LOSS
,STOP_LOSS_LIMIT
iftrailingDelta
parameter was provided) for the following endpoints:POST /api/v3/order
GET /api/v3/order
GET /api/v3/openOrders
GET /api/v3/allOrders
POST /api/v3/order/cancelReplace
DELETE /api/v3/order
- Field
commissionRates
will appear in theGET /api/v3/acccount
response
USER DATA STREAM
- eventType
executionReport
has new fieldsV
-selfTradePreventionMode
D
-trailing_time
(Appears if the trailing stop order is active)W
-workingTime
(Appears ifisWorking
=true
)
**2022-12-02**
- Added a new market data base URL
https://data.binance.com
. - Added a new WebSocket URL
wss://data-stream.binance.com
.
**2022-11-29**
- New endpoint for VIP Loan:
GET /sapi/v1/loan/vip/collateral/account
: Check Locked Value of VIP Collateral Account
**2022-11-22**
- New endpoints for Convert:
GET /sapi/v1/convert/exchangeInfo
: Query for all convertible token pairs and the tokens’ respective upper/lower limitsGET /sapi/v1/convert/assetInfo
: Query for supported asset’s precision informationPOST /sapi/v1/convert/getQuote
: Request a quote for the requested token pairsPOST /sapi/v1/convert/acceptQuote
: Accept the offered quote by quote ID.GET /sapi/v1/convert/orderStatus
: Query order status by order ID.
**2022-11-18**
- New endpoint for Wallet:
GET /sapi/v1/asset/ledger-transfer/cloud-mining/queryByPage
: The query of Cloud-Mining payment and refund history
- New endpoints for Sub-account:
GET /sapi/v1/sub-account/apiRestrictions/ipRestriction/thirdPartyList
: To query Sub-Account API key Third Party IP whitelistPOST /sapi/v2/sub-account/subAccountApi/ipRestriction
: To support master account update IP Restriction for Sub-Account API key
**2022-11-14**
- New endpoints for VIP Loan:
GET /sapi/v1/loan/vip/ongoing/orders
: Get VIP Loan Ongoing OrdersPOST /sapi/v1/loan/vip/repay
: VIP Loan RepayGET /sapi/v1/loan/vip/repay/history
: Get VIP Loan Repayment History
**2022-11-02**
- Update endpoints for Wallet:
POST /sapi/v1/capital/withdraw/apply
: Weight changed to Weight(UID): 600
**2022-11-01**
- New endpoints for Crypto Loan:
GET /sapi/v1/loan/loanable/data
: Get interest rate and borrow limit of loanable assets. The borrow limit is shown in USD value.GET /sapi/v1/loan/collateral/data
: Get LTV information and collateral limit of collateral assets. The collateral limit is shown in USD value.GET /sapi/v1/loan/repay/collateral/rate
: Get the the rate of collateral coin / loan coin when using collateral repay, the rate will be valid within 8 second.POST /sapi/v1/loan/customize/margin_call
: Customize margin call for ongoing orders only.
**2022-10-28**
- Update endpoints for Wallet:
POST /sapi/v1/asset/convert-transfer
: New parameteraccountType
POST /sapi/v1/asset/convert-transfer/queryByPage
: request method is changed toGET
, new parameterclientTranId
**2022-10-15**
- New endpoints for Binance Code:
POST /sapi/v1/giftcard/buyCode
: For buying a fixed-value Binance Code.GET /sapi/v1/giftcard/buyCode/token-limit
: To verify which tokens are available for you to purchase fixed-value gift cards as mentioned in section 2 and its’ limitation.
**2022-09-30**
- Delete endpoints for Futures Cross Collateral:
POST /sapi/v1/futures/loan/borrow
POST /sapi/v1/futures/loan/repay
GET /sapi/v1/futures/loan/configs
GET /sapi/v2/futures/loan/configs
GET /sapi/v1/futures/loan/calcAdjustLevel
GET /sapi/v2/futures/loan/calcAdjustLevel
GET /sapi/v1/futures/loan/calcMaxAdjustAmount
GET /sapi/v2/futures/loan/calcMaxAdjustAmount
POST /sapi/v1/futures/loan/adjustCollateral
POST /sapi/v2/futures/loan/adjustCollateral
GET /sapi/v1/futures/loan/collateralRepayLimit
GET /sapi/v1/futures/loan/collateralRepay
POST /sapi/v1/futures/loan/collateralRepay
GET /sapi/v1/futures/loan/collateralRepayResult
**2022-09-30**
Scheduled changes to the removal of !bookTicker
around November 2022.
- The All Book Tickers stream (
!bookTicker
) is set to be removed in November 2022 - More details of the actual removal date will be announced at a later time.
- Please use the Individual Book Ticker Streams instead. (
<symbol>@bookTicker
). - Multiple
<symbol>@bookTicker
streams can be subscribed to over one connection.- Example: wss://stream.binance.com:9443/stream?streams=btcusdt@bookTicker/bnbbtc@bookTicker
**2022-09-29**
- New endpoints for Wallet:
POST /sapi/v1/asset/convert-transfer
: Convert transfer, convert between BUSD and stablecoins.POST /sapi/v1/asset/convert-transfer/queryByPage
: Query convert transfer
**2022-09-22**
- Update endpoint for Sub-Account:
POST /sapi/v1/sub-account/subAccountApi/ipRestriction
: Add new paramthirdParty
POST /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList
: Add new paramthirdPartyName
DELETE /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList
: Add new paramthirdPartyName
- Add Rate Limit for following endpoints:
GET /sapi/v1/bswap/liquidity
: 3/1s per account and per poolGET /sapi/v1/bswap/quote
: 3/1s per account and per poolPOST /sapi/v1/lending/daily/purchase
: 1/3s per accountPOST /sapi/v1/lending/customizedFixed/purchase
: 1/3s per accountPOST /sapi/v1/staking/purchase
: 1/3s per account
**2022-09-16**
- New endpoint for Margin:
GET /sapi/v1/margin/tradeCoeff
: Get personal margin level information
**2022-09-15**
- New endpoints for Crypto Loan
POST /sapi/v1/loan/borrow
: Borrow - Crypto Loan BorrowGET /sapi/v1/loan/borrow/history
: Borrow - Get Loan Borrow HistoryGET/sapi/v1/loan/ongoing/orders
: Borrow - Get Loan Ongoing OrdersPOST/sapi/v1/loan/repay
: Repay - Crypto Loan RepayGET/sapi/v1/loan/repay/history
: Repay - Get Loan Repayment HistoryPOST/sapi/v1/loan/adjust/ltv
: Adjust LTV - Crypto Loan Adjust LTVGET/sapi/v1/loan/ltv/adjustment/history
: Adjust LTV - Get Loan LTV Adjustment History
**2022-09-15**
Note that these are rolling changes, so it may take a few days for it to rollout to all our servers.
- Changes to
GET /api/v3/exchangeInfo
- New optional parameter
permissions
added to display all symbols with the permissions matching the parameter provided. (eg.SPOT
,MARGIN
,LEVERAGED
) - If not provided, the default value will be
["SPOT","MARGIN", "LEVERAGED"]
.- This means the request
GET /api/v3/exchangeInfo
without any parameters will show all symbols that can be used forSPOT
,MARGIN
and/orLEVERAGED
trading. - To search for symbols that can be traded on other permissions (e.g.
TRD_GRP_004
, etc), then this needs to be searched for explicitly. (e.g.permissions
=TRD_GRP_004
)
- This means the request
- Cannot be combined with
symbol
orsymbols
- New optional parameter
**2022-09-12**
- Update endpoint for Sub-account:
To support master account query Third party IP list name for a sub account API key
**2022-09-05**
- Delete endpoint for Futures:
GET /sapi/v1/futures/loan/wallet
**2022-08-23**
SPOT API
Note that these are rolling changes, so it may take a few days for it to rollout to all our servers.
- Changes to
GET /api/v3/ticker
andGET /api/v3/ticker/24hr
- New optional parameter
type
added - Supported values for parameter
type
areFULL
andMINI
FULL
is the default value and the response that is currently being returned from the endpointMINI
omits the following fields from the response:priceChangePercent
,weightedAvgPrice
,bidPrice
,bidQty
,askPrice
,askQty
, andlastQty
- New optional parameter
- New error code
-1008
- This is sent whenever the servers are overloaded with requests.
- This error code only appears for the SPOT API.
- New field
brokered
has been added toGET /api/v3/account
- New endpoint:
GET /api/v3/uiKlines
- New kline interval:
1s
**2022-08-18**
- Update endpoint for Convert:
GET /sapi/v1/convert/tradeFlow
: Update weight from Weight(IP) 3000 to Weight(UID) 3000.
**2022-08-08**
SPOT API
- Changes to
POST /api/v3/order
andPOST /api/v3/order/cancelReplace
- New optional field
strategyId
is a parameter used to identify an order as part of a strategy. - New optional field
strategyType
is a parameter used to identify what strategy was running. (E.g. If all the orders are part of spot grid strategy, it can be set tostrategyType=1000000
) - Note:
strategyType
cannot be less than1000000
.
- New optional field
- Changes to
POST /api/v3/order/oco
- New optional fields
limitStrategyId
,limitStrategyType
.stopStrategyId
,stopStrategyType
- These are the strategy metadata parameters for both legs of the OCO orders.
limitStrategyType
andstopStrategyType
both cannot be less than1000000
.
- New optional fields
- Changes to
GET /api/v3/order
,GET /api/v3/openOrders
, andGET /api/v3/allOrders
- New fields
strategyId
andstrategyType
will appear in the response JSON for orders that had these fields populated upon order placement.
- New fields
- Changes to
DELETE /api/v3/order
andDELETE /api/v3/openOrders
- New fields
strategyId
andstrategyType
will appear in the response JSON for cancelled orders that had these fields populated upon order placement.
- New fields
USER DATA STREAM
- New fields to eventType
executionReport
j
forstrategyId
J
forstrategyType
- Note that these fields only appear if these were populated upon order placement.
**2022-08-05**
- Update endpoint for Convert:
GET /sapi/v1/convert/tradeFlow
: Update weight from Weight(IP) 100 to Weight(IP) 3000.
**2022-07-21**
- New endpoint for Portfolio Margin:
GET /sapi/v1/portfolio/pmLoan
Query Portfolio Margin Bankruptcy Loan RecordPOST /sapi/v1/portfolio/repay
Portfolio Margin Bankruptcy Loan Repay
**2022-07-18**
- New endpoint for Portfolio Margin:
GET /sapi/v1/portfolio/collateralRate
to get Portfolio Margin Collateral Rate.
**2022-07-01**
- New endpoint for Wallet:
POST /sapi/v3/asset/getUserAsset
to get user assets.
- New endpoint for Margin:
GET /sapi/v1/margin/dribblet
to query the historical information of user's margin account small-value asset conversion BNB.
- Update endpoint for Convert:
GET /sapi/v1/convert/tradeFlow
: Update weight from 3000 to 100.
- Update endpoint for Margin:
GET /sapi/v1/margin/repay
: Add response field rawAsset.
**2022-06-20**
SPOT API: Changes to GET /api/v3/ticker
- Weight has been reduced from 5 to 2 per symbol, regardless of
windowSize
. - The max number of symbols that can be processed in a request is 100.
- If the number of
symbols
sent is more than 100, the error will be as follows:
- If the number of
- The max Weight(IP) for this endpoint will cap at 100.
- I.e. If the request has more than 50 symbols, the Weight will still be 100, regardless of
windowSize
.
- I.e. If the request has more than 50 symbols, the Weight will still be 100, regardless of
**2022-06-15**
Note: The update is being rolled out over the next few days, so these changes may not be visible right away.
GET /api/v3/ticker
added- Rolling window price change statistics based on
windowSize
provided. - Contrary to
GET /api/v3/ticker/24hr
the list of symbols cannot be omitted. - If
windowSize
not specified, the value will default to1d
. - Response is similar to
GET /api/v3/ticker/24hr
, minus the following fields:prevClosePrice
,lastQty
,bidPrice
,bidQty
,askPrice
,askQty
- Rolling window price change statistics based on
POST /api/v3/order/cancelReplace
added- Cancels an existing order and places a new order on the same symbol.
- The filters are evaluated before the cancel order is placed.
- e.g. If the
MAX_NUM_ORDERS
filter is 10, and the total number of open orders on the account is also 10, when usingPOST /api/v3/order/cancelReplace
both the cancel order placement and new order will fail because of the filter.
- e.g. If the
- The change is being rolled out in the next few days, thus this feature will be enabled once the upgrade is completed.
GET /api/v3/exchangeInfo
returns new fieldcancelReplaceAllowed
insymbols
list.- New filter
NOTIONAL
has been added.- Defines the allowed notional value (
price * quantity
) based on a configuredminNotional
andmaxNotional
- Defines the allowed notional value (
- New exchange filter
EXCHANGE_MAX_NUM_ICEBERG_ORDERS
has been added.- Defines the limit of open iceberg orders on an account
WEBSOCKETS
- New symbol ticker streams with 1h and 4h windows:
- Individual symbol ticker streams
<symbol>@ticker_<window-size>
- All market ticker streams
!ticker_<window-size>@arr
- Individual symbol ticker streams
**2022-06-02**
- Update endpoint for Subaccount:
GET /sapi/v1/sub-account/sub/transfer/history
: fromEmail and toEmail can be master email.
**2022-05-31**
- Update endpoint for Fiat:
GET /sapi/v1/fiat/orders
: Weight changes from UID(3000) to UID(90000)
- Update endpoint for Pay:
GET /sapi/v1/pay/transactions
: Param names changed: startTimestamp -> startTime; endTimestamp -> endTime.
**2022-05-26**
- Update endpoint for Fiat:
GET /sapi/v1/fiat/orders
: Weight changes from IP(1) to UID(3000)
- Update info for the following margin account endpoints: The max interval between
startTime
andendTime
is 30 days.:GET /sapi/v1/margin/transfer
GET /sapi/v1/margin/loan
GET /sapi/v1/margin/repay
GET /sapi/v1/margin/isolated/transfer
GET /sapi/v1/margin/interestHistory
**2022-05-23**
Changes to Order Book Depth Levels
- Quantities in the Depth levels were returning negative values in situations where they were exceeding the max value, resulting in an overflow.
- Going forward depth levels will not overflow, but will be capped at the max value based on the precision of the base asset. This means that the depth level is at max value or more.
- E.g. If the precision is 8, then the max value for quantity will be at 92,233,720,368.54775807.
- When the fix has been applied, a change in the order book at the affected price level is required for the changes to be visible.
What does this affect?
- SPOT API
GET /api/v3/depth
- Websocket Streams
<symbol>@depth
<symbol>@depth@100ms
<symbol>@depth<levels>
<symbol>@depth<levels>@100ms
- SPOT API
Updates to
MAX_POSITION
- If an order's
quantity
can cause the position to overflow, this will now fail theMAX_POSITION
filter.
- If an order's
**2022-05-19**
- Update endpoint for Mining:
GET /sapi/v1/mining/pub/algoList
andGET /sapi/v1/mining/pub/coinList
: Need no paramter.
- Add error codes (21xxx) for Portfolio Margin Account: -21001, -21002, -21003
**2022-05-17**
SPOT API
- Changes to
GET api/v3/aggTrades
- When providing
startTime
andendTime
, the oldest items are returned.
- When providing
- Changed error messaging on
GET /api/v3/myTrades
where parametersymbol
is not provided:
- The following endpoints now support multi-symbol querying using the parameter
symbols
.GET /api/v3/ticker/24hr
GET /api/v3/ticker/price
GET /api/v3/ticker/bookTicker
- In the above, the request weight will depend on the number of symbols provided in
symbols
.
Please refer to the table below:
Endpoint | Number of Symbols | Weight |
---|---|---|
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 or more | 40 |
**2022-05-05**
- New endpoint for Binance Code:
GET /sapi/v1/giftcard/cryptography/rsa-public-key
to fetch RSA public key.
- Update endpoint for Binance Code:
POST /sapi/v1/giftcard/redeemCode
: new optional parameterexternalUid
. Each external unique ID represents a unique user on the partner platform. The function helps you to identify the redemption behavior of different users.
**2022-04-28**
- New endpoints for Staking:
GET /sapi/v1/staking/productList
to get Staking product listPOST /sapi/v1/staking/purchase
to stake productPOST /sapi/v1/staking/redeem
to redeem productGET /sapi/v1/staking/position
to get Staking product holding positionGET /sapi/v1/staking/stakingRecord
to inquiry Staking history recordsPOST /sapi/v1/staking/setAutoStaking
to set Auto Staking functionGET /sapi/v1/staking/personalLeftQuota
to inquiry Staking left quota
**2022-04-27**
- New endpoint for Futures Algo:
POST /sapi/v1/algo/futures/newOrderTwap
to support Twap new order
FAQ: Time-Weighted Average Price(Twap) Introduction
**2022-04-26**
GET /sapi/v1/margin/rateLimit/order
added- The endpoint will display the user's current margin order count usage for all intervals.
**2022-04-20**
- New endpoint for Portfolio Margin:
GET /sapi/v1/portfolio/account
to support query portfolio margin account info
Only Portfolio Margin Account is accessible to this endpoint. To enroll, kindly refer to: How to Enroll into the Binance Portfolio Margin Program
**2022-04-13**
- New endpoints for Futures Algo:
POST /sapi/v1/algo/futures/newOrderVp
to support VP new orderDELETE /sapi/v1/algo/futures/order
to support cancel Algo orderGET /sapi/v1/algo/futures/openOrders
to support query Algo open ordersGET /sapi/v1/algo/futures/historicalOrders
to support query Algo historical ordersGET /sapi/v1/algo/futures/subOrders
to support query Algo sub orders for a specified algoId
FAQ: Volume Participation(VP) Introduction
**2022-04-13**
Information on Trailing Stops
SPOT API
- Trailing Stops have been enabled.
- This is a type of algo order where the activation is based on a percentage of a price change in the market using the new parameter
trailingDelta
. - This can only used with any of the following order types:
STOP_LOSS
,STOP_LOSS_LIMIT
,TAKE_PROFIT
,TAKE_PROFIT_LIMIT
. - The
trailingDelta
parameter will be done in Basis Points or BIPS.- For example: a STOP_LOSS SELL order with a
trailingDelta
of 100 will trigger after a price decrease of 1%. (100 / 10,000 => 0.01 => 1%)
- For example: a STOP_LOSS SELL order with a
- When used in combination with OCO Orders, the
trailingDelta
will determine when the contingent leg of the OCO will trigger. - When
trailingDelta
is used in combination withstopPrice
, once thestopPrice
condition is met, the trailing stop starts tracking the price change from thestopPrice
based on thetrailingDelta
provided. - When no
stopPrice
is sent, the trailing stop starts tracking the price changes from the last price based on thetrailingDelta
provided.
- This is a type of algo order where the activation is based on a percentage of a price change in the market using the new parameter
- Changes to POST
/api/v3/order
- New optional field
trailingDelta
- New optional field
- Changes to POST
/api/v3/order/test
- New optional field
trailingDelta
- New optional field
- Changes to POST
/api/v3/order/oco
- New optional field
trailingDelta
- New optional field
- A new filter
TRAILING_DELTA
has been added.- This filter is defined by the minimum and maximum values for the
trailingDelta
value.
- This filter is defined by the minimum and maximum values for the
USER DATA STREAM
- New field in
executionReport
- "d" for
trailingDelta
- "d" for
**2022-04-12**
Note: The changes are being rolled out during the next few days, so these will not appear right away.
- Error message changed on
GET api/v3/allOrders
wheresymbol
is not provided: - Fixed a typo with an error message when an account has disabled permissions (e.g. to withdraw, to trade, etc)
- During a market data audit, we detected some issues with the Spot aggregate trade data.
- Missing aggregate trades were recovered.
- Duplicated records were marked invalid with the following values:
- p = '0' // price
- q = '0' // qty
- f = -1 // first_trade_id
- l = -1 // last_trade_id
**2022-04-08**
- Update WEBSOCKET for BLVT:
More details: Websocket BLVT Info Streams and Websocket BLVT NAV Kline/Candlestick Streams
**2022-3-29**
The following updates will take effect on March 31, 2022 08:00 AM UTC
- Update endpoint for Sub-account:
GET /sapi/v1/sub-account/universalTransfer
The query time period must be less then 30 days; If startTime
and endTime
not sent, return records of the last 30 days by default
**2022-03-25**
- Update endpoint for Sub-Account:
- New endpoint
GET /sapi/v1/managed-subaccount/accountSnapshot
to support investor master account query asset snapshot of managed sub-account
- New endpoint
**2022-03-08**
- Update endpoint for Sub-Account:
- New transfer types
MARGIN
,ISOLATED_MARGIN
and parametersymbol
added inPOST /sapi/v1/sub-account/universalTransfer
to support transfer to sub-account cross margin account and isolated margin account
- New transfer types
**2022-02-28**
- New field
allowTrailingStop
has been added toGET /api/v3/exchangeInfo
**2022-02-22**
SPOT API
(price-minPrice) % tickSize == 0
rule inPRICE_FILTER
has been changed toprice % tickSize == 0
.- A new filter
PERCENT_PRICE_BY_SIDE
has been added. - Changes to GET
api/v3/depth
- The
limit
value can be outside of the previous values (i.e. 5, 10, 20, 50, 100, 500, 1000,5000) and will return the correct limit. (i.e. if limit=3 then the response will be the top 3 bids and asks) - The limit still cannot exceed 5000. If the limit provided is greater than 5000, then the response will be truncated to 5000.
- Due to the changes, these are the updated request weights based on the limit value provided:
- The
Limit | Request Weight |
---|---|
1-100 | 1 |
101-500 | 5 |
501-1000 | 10 |
1001-5000 | 50 |
- Changes to GET
api/v3/aggTrades
- When providing
startTime
andendTime
, the oldest items are returned.
- When providing
**2022-2-18*** Update endpoint for Sub-Account: * New fields `isManagedSubAccount`and `isAssetManagementSubAccount` added in`GET /sapi/v1/sub-account/list`to support query whether the sub-account is a managed sub-account or a asset management sub-account
**2022-2-17**
The following updates will take effect on February 24, 2022 08:00 AM UTC
- Update endpoint for Wallet:
GET /sapi/v1/accountSnapshot
The time limit of this endpoint is shortened to only support querying the data of the latest month
**2022-2-09**
- New endpoint for Wallet:
POST /sapi/v1/asset/dust-btc
to get assets that can be converted into BNB
**2022-1-25**
- From January 28, 2022 4:00 AM UTC, You need to open
Enable Spot & Margin Trading
permission for the API key which requests these endpoints as following:POST /sapi/v1/asset/dust
Dust transferPOST /sapi/v1/lending/daily/purchase
Purchase Savings flexible productPOST /sapi/v1/lending/daily/redeem
Redeem Savings flexible productPOST /sapi/v1/lending/customizedFixed/purchase
Purchase Savings Fixed/Activity projectPOST /sapi/v1/lending/positionChanged
Change Savings Fixed/Activity position to Daily positionPOST /sapi/v1/bswap/liquidityAdd
Bswap add liquidityPOST /sapi/v1/bswap/liquidityRemove
Bswap remove liquidityPOST /sapi/v1/bswap/swap
Bswap swapPOST /sapi/v1/bswap/claimRewards
Bswap claim rewards
**2022-1-21**
- New endpoints for Binance Code:
POST /sapi/v1/giftcard/createCode
to create a Binance Code.POST /sapi/v1/giftcard/redeemCode
to redeem a Binance Code.GET /sapi/v1/giftcard/verify
to verify a Binance Code.
**2022-1-4**
New endpoint for Mining:
GET /sapi/v1/mining/payment/uid
to get Mining account earning.
New endpoints for BSwap:
GET /sapi/v1/bswap/unclaimedRewards
to get unclaimed rewards record.POST /sapi/v1/bswap/claimRewards
to claim swap rewards or liquidity rewards.GET /sapi/v1/bswap/claimedHistory
to get history of claimed rewards.
**2021-12-30**
Update endpoint for Margin:
- Removed out
limit
fromGET /sapi/v1/margin/interestRateHistory
; The max interval between startTime and endTime is 30 days.
- Removed out
Update endpoint for Wallet:
- As the Mining account is merged into Funding account, transfer types MAIN_MINING, MINING_MAIN, MINING_UMFUTURE, MARGIN_MINING, and MINING_MARGIN will be discontinued in Universal Transfer endpoint
POST /sapi/v1/asset/transfer
on January 05, 2022 08:00 AM UTC
- As the Mining account is merged into Funding account, transfer types MAIN_MINING, MINING_MAIN, MINING_UMFUTURE, MARGIN_MINING, and MINING_MARGIN will be discontinued in Universal Transfer endpoint
**2021-12-29**
- Removed out dated "Symbol Type" enum; added "Permissions" enum.
**2021-12-24**
- Update endpoints for Sub-Account:
- New parameter
clientTranId
added inPOST /sapi/v1/sub-account/universalTransfer
andGET /sapi/v1/sub-account/universalTransfer
to support custom transfer id
- New parameter
**2021-12-03**
New endpoints for Margin:
GET /sapi/v1/margin/crossMarginData
to get cross margin fee data collectionGET /sapi/v1/margin/isolatedMarginData
to get isolated margin fee data collectionGET /sapi/v1/margin/isolatedMarginTier
to get isolated margin tier data collection
New endpoints for NFT:
GET /sapi/v1/nft/history/transactions
to get NFT transaction historyGET /sapi/v1/nft/history/deposit
to get NFT deposit historyGET /sapi/v1/nft/history/withdraw
to get NFT withdraw historyGET /sapi/v1/nft/user/getAsset
to get NFT asset
**2021-11-30**
New endpoint for Convert:
GET /sapi/v1/convert/tradeFlow
to support user query convert trade history records
New endpoint for Rebate:
GET /sapi/v1/rebate/taxQuery
to support user query spot rebate history records
**2021-11-19**
- New endpoint for Pay:
GET /sapi/v1/pay/transactions
to support user query Pay trade history
- Update endpoint for Wallet:
- New field
info
added inGET /sapi/v1/capital/withdraw/history
to show the reason for withdrawal failure
- New field
**2021-11-18**
The following updates will take effect on November 25, 2021 08:00 AM UTC
- Update endpoint for Wallet:
GET /sapi/v1/accountSnapshot
The query time range of both endpoints are shortened to support data query within the last 6 months only, where startTime does not support selecting a timestamp beyond 6 months. If you do not specify startTime and endTime, the data of the last 7 days will be returned by default.
**2021-11-17**
- The following endpoints will be discontinued on November 17, 2021 13:00 PM UTC:
POST /sapi/v1/account/apiRestrictions/ipRestriction
to support user enable and disable IP restriction for an API KeyPOST /sapi/v1/account/apiRestrictions/ipRestriction/ipList
to support user add IP list for an API KeyGET /sapi/v1/account/apiRestrictions/ipRestriction
to support user query IP restriction for an API KeyDELETE /sapi/v1/account/apiRestrictions/ipRestriction/ipList
to support user delete IP list for an API Key
**2021-11-16**
- New endpoints for Sub-Account:
POST /sapi/v1/sub-account/subAccountApi/ipRestriction
to support master account enable and disable IP restriction for a sub-account API KeyPOST /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList
to support master account add IP list for a sub-account API KeyGET /sapi/v1/sub-account/subAccountApi/ipRestriction
to support master account query IP restriction for a sub-account API KeyDELETE /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList
to support master account delete IP list for a sub-account API Key
**2021-11-09**
- New endpoints for Wallet:
POST /sapi/v1/account/apiRestrictions/ipRestriction
to support user enable and disable IP restriction for an API KeyPOST /sapi/v1/account/apiRestrictions/ipRestriction/ipList
to support user add IP list for an API KeyGET /sapi/v1/account/apiRestrictions/ipRestriction
to support user query IP restriction for an API KeyDELETE /sapi/v1/account/apiRestrictions/ipRestriction/ipList
to support user delete IP list for an API Key
**2021-11-08**
- New endpoint for Crypto Loans:
- New endpoint
GET /sapi/v1/loan/income
to support user query crypto loans income history
- New endpoint
**2021-11-05**
- Update endpoint for Wallet:
- New parameter
walletType
added inPOST /sapi/v1/capital/withdraw/apply
to support user choose wallet typespot wallet
andfunding wallet
when withdraw crypto.
- New parameter
**2021-11-04**
The following updates will take effect on November 11, 2021 08:00 AM UTC
- Update endpoints for Wallet and Futures:
GET /sapi/v1/asset/transfer
GET /sapi/v1/futures/transfer
The query time range of both endpoints are shortened to support data query within the last 6 months only, where startTime does not support selecting a timestamp beyond 6 months. If you do not specify startTime and endTime, the data of the last 7 days will be returned by default.
**2021-11-01**
GET /api/v3/rateLimit/order
added- The endpoint will display the user's current order count usage for all intervals.
- This endpoint will have a request weight of 20.
**2021-10-22**
- Update endpoint for Wallet:
- New transfer types
MAIN_FUNDING
,FUNDING_MAIN
,FUNDING_UMFUTURE
,UMFUTURE_FUNDING
,MARGIN_FUNDING
,FUNDING_MARGIN
,FUNDING_CMFUTURE
andCMFUTURE_FUNDING
added in Universal Transfer endpointPOST /sapi/v1/asset/transfer
andGET /sapi/v1/asset/transfer
to support transfer assets among funding account and other accounts - As the C2C account, Binance Payment, Binance Card and other business account are merged into a Funding account, transfer types
MAIN_C2C
,C2C_MAIN
,C2C_UMFUTURE
,C2C_MINING
,UMFUTURE_C2C
,MINING_C2C
,MARGIN_C2C
,C2C_MARGIN
,MAIN_PAY
andPAY_MAIN
will be discontinued in Universal Transfer endpointPOST /sapi/v1/asset/transfer
andGET /sapi/v1/asset/transfer
on November 04, 2021 08:00 AM UTC
- New transfer types
**2021-10-14**
- Update the time range of the response data for the following margin account endpoints,
startTime
andendTime
time span will not exceed 30 days, without time parameter sent the system will return the last 7 days of data by default, while thearchived
parameter istrue
, the system will return the last 7 days of data 6 months ago by default:GET /sapi/v1/margin/transfer
GET /sapi/v1/margin/loan
GET /sapi/v1/margin/repay
GET /sapi/v1/margin/isolated/transfer
GET /sapi/v1/margin/interestHistory
**2021-09-18**
- New endpoints for BSwap:
GET /sapi/v1/bswap/poolConfigure
to get pool configureGET /sapi/v1/bswap/addLiquidityPreview
to get add liquidity previewGET /sapi/v1/bswap/removeLiquidityPreview
to get remove liquidity preview
**2021-09-17**
- Add
/api/*
and/sapi/*
limit introduction in General Info
**2021-09-08**
Add endpoints for enabled isolated margin account limit:
DELETE /sapi/v1/margin/isolated/account
to disable isolated margin account for a specific symbolPOST /sapi/v1/margin/isolated/account
to enable isolated margin account for a specific symbolGET /sapi/v1/margin/isolated/accountLimit
to query enabled isolated margin account limit
New field "enabled" in response of
GET /sapi/v1/margin/isolated/account
to check if the isolated margin account is enabled
**2021-09-03**
- Update endpoint for Wallet:
sameAddress
means if the coin needs to provide memo to withdrawdepositDust
means minimum creditable amountspecialWithdrawTips
means special tips for withdraw
**2021-08-27**
- Update endpoint for Wallet:
- New parameter
withdrawOrderId
added inGET /sapi/v1/capital/withdraw/history
to support user query withdraw history by withdrawOrderId - New field
unlockConfirm
added inGET /sapi/v1/capital/deposit/hisrec
to support query network confirm times for unlocking
- New parameter
**2021-08-23**
- New endpoints for Margin Account OCO:
POST /sapi/v1/margin/order/oco
DELETE /sapi/v1/margin/orderList
GET /sapi/v1/margin/orderList
GET /sapi/v1/margin/allOrderList
GET /sapi/v1/margin/openOrderList
Same usage as spot account OCO
**2021-08-20**
- Update endpoint for Wallet:
- New parameters
fromSymbol
,toSymbol
and new transfer typesISOLATEDMARGIN_MARGIN
,MARGIN_ISOLATEDMARGIN
andISOLATEDMARGIN_ISOLATEDMARGIN
added inPOST /sapi/v1/asset/transfer
andGET /sapi/v1/asset/transfer
to support user transfer assets between Margin(cross) account and Margin(isolated) account
- New parameters
**2021-08-12**
- GET
api/v3/myTrades
has a new optional fieldorderId
**2021-08-05**
- New endpoint for C2C:
GET /sapi/v1/c2c/orderMatch/listUserOrderHistory
to query user C2C trade history
**2021-08-05**
- Update endpoints for Savings:
GET /sapi/v1/lending/union/purchaseRecord
GET /sapi/v1/lending/union/redemptionRecord
GET /sapi/v1/lending/union/interestHistory
The time between startTime
and endTime
cannot be longer than 30 days. If startTime
and endTime
are both not sent, then the last 30 days' data will be returned
**2021-07-29**
- Update endpoint for Sub-Account:
GET /sapi/v1/sub-account/transfer/subUserHistory
ifstartTime
andendTime
are not sent, the recent 30-day data will be returned by default
**2021-07-27**
- New endpoint for Fiat:
GET /sapi/v1/fiat/orders
to query user fiat deposit and withdraw historyGET /sapi/v1/fiat/payments
to query user fiat payments history
**2021-07-16**
- New endpoint for Wallet:
GET /sapi/v1/account/apiRestrictions
to query user API Key permission
**2021-07-09**
- New endpoint for Wallet:
POST /sapi/v1/asset/get-funding-asset
to query funding wallet, includes Binance Pay, Binance Card, Binance Gift Card, Stock Token
**2021-06-24**
- Update endpoints for Wallet:
GET /sapi/v1/capital/withdraw/history
added default value 1000, max value 1000 for the parameterlimit
GET /sapi/v1/capital/deposit/hisrec
added default value 1000, max value 1000 for the parameterlimit
**2021-06-17**
- Update endpoint for Savings:
GET /sapi/v1/lending/daily/product/list
to include new parameterscurrent
andsize
**2021-06-15**
- New endpoints for Sub-Account:
POST /sapi/v1/managed-subaccount/deposit
to deposit assets into the managed sub-account (only for investor master account)GET /sapi/v1/managed-subaccount/asset
to query managed sub-account asset details (only for investor master account)POST /sapi/v1/managed-subaccount/withdraw
to withdrawal assets from the managed sub-account (only for investor master account)
**2021-06-04**
On August 01, 2021 02:00 AM UTC the WAPI endpoints will be discontinued:
GET /wapi/v3/systemStatus.html
POST /wapi/v3/withdraw.html
GET /wapi/v3/depositHistory.html
GET /wapi/v3/withdrawHistory.html
GET /wapi/v3/depositAddress.html
GET /wapi/v3/accountStatus.html
GET /wapi/v3/apiTradingStatus.html
GET /wapi/v3/userAssetDribbletLog.html
GET /wapi/v3/assetDetail.html
GET /wapi/v3/tradeFee.html
GET /wapi/v3/sub-account/list.html
GET /wapi/v3/sub-account/transfer/history.html
POST /wapi/v3/sub-account/transfer.html
GET /wapi/v3/sub-account/assets.html
The WAPI endpoints have been removed from Binance API Documentation.To ensure your trading strategies are not affected, all API users are encouraged to upgrade trading bots to SAPI endpoints as soon as possible.
**2021-05-26**
- Update endpoint for Wallet:
- New transfer types
MAIN_PAY
,PAY_MAIN
added in Universal Transfer endpointPOST /sapi/v1/asset/transfer
andGET /sapi/v1/asset/transfer
to support trasnfer assets between spot account and pay account
- New transfer types
**2021-05-12**
- Added
Data Source
in the documentation to explain where each endpoint is retrieving its data - Added field
Data Source
to each Spot API endpoint in the documentation - GET
api/v3/exchangeInfo
now supports single or multi-symbol query
**2021-04-28**
On May 15, 2021 08:00 UTC the SAPI Create Margin Account endpoint will be discontinued:
POST /sapi/v1/margin/isolated/create
Isolated Margin account creation and trade preparation can be completed directly through Isolated Margin funds transfer POST /sapi/v1/margin/isolated/transfer
**2021-04-26**
On April 28, 2021 00:00 UTC the weights to the following endpoints will be adjusted:
GET /api/v3/order
weight increased to 2GET /api/v3/openOrders
weight increased to 3GET /api/v3/allOrders
weight increased to 10GET /api/v3/orderList
weight increased to 2GET /api/v3/openOrderList
weight increased to 3GET /api/v3/account
weight increased to 10GET /api/v3/myTrades
weight increased to 10GET /api/v3/exchangeInfo
weight increased to 10
**2021-04-08**
- Update endpoint for Sub-Account:
GET /sapi/v1/sub-account/futures/accountSummary
andGET /sapi/v2/sub-account/futures/accountSummary
the unit of fieldasset
changed to USD valued summary of sub-account assets
**2021-04-02**
- New endpoints for Wallet:
GET /sapi/v1/system/status
to query system statusGET /sapi/v1/account/status
to query account statusGET /sapi/v1/account/apiTradingStatus
to query account API trading statusGET /sapi/v1/asset/dribblet
to query dust logGET /sapi/v1/asset/assetDetail
to query asset detailGET /sapi/v1/asset/tradeFee
to query trade fee
- New endpoint for Sub-Account:
GET /sapi/v3/sub-account/assets
to query sub-account assets
**2021-04-01**
- Update endpoint for Sub-Account:
GET /sapi/v1/sub-account/transfer/subUserHistory
new fieldsfromAccountType
andtoAccountType
added in response
**2021-03-31**
- Update endpoint for Sub-Account:
GET /wapi/v3/sub-account/transfer/history.html
added new parametersfromEmail
andtoEmail
, the original parameteremail
is equal tofromEmail
by default
**2021-03-08**
- New endpoint for Sub-Account:
POST /sapi/v1/sub-account/virtualSubAccount
to support create a virtual sub-accountGET /sapi/v1/sub-account/list
to support query sub-account listPOST /sapi/v1/sub-account/blvt/enable
to support enable blvt for sub-account
**2021-03-05**
- New endpoints for Margin:
GET /sapi/v1/margin/interestRateHistory
to support margin interest rate history query
**2021-02-08**
- New endpoints for Futures:
GET /sapi/v2/futures/loan/wallet
to support BUSD loan queryGET /sapi/v2/futures/loan/configs
to support BUSD loan queryGET /sapi/v2/futures/loan/calcAdjustLevel
to support BUSD loanGET /sapi/v2/futures/loan/calcMaxAdjustAmount
to support adjustment of BUSD loanPOST /sapi/v2/futures/loan/adjustCollateral
to support adjustment of BUSD loan
- Update endpoints for Futures
GET /sapi/v1/futures/loan/adjustCollateral/history
new parameter and fields in responseloanCoin
for BUSD loanGET /sapi/v1/futures/loan/liquidationHistory
new parameter and fields in responseloanCoin
for BUSD loan
**2021-02-04**
- New transfer types
MARGIN_MINING
,MINING_MARGIN
,MARGIN_C2C
,C2C_MARGIN
,MARGIN_CMFUTURE
,CMFUTURE_MARGIN
added in Universal Transfer endpointPOST /sapi/v1/asset/transfer
andGET /sapi/v1/asset/transfer
.
**2021-01-15**
- New endpoint
DELETE /sapi/v1/margin/openOrders
for Margin Trade- This will allow a user to cancel all open orders on a single symbol for margin account.
- This endpoint will cancel all open orders including OCO orders for margin account.
**2021-01-10**
New parameter
pageSize
for Mining endpointGET /sapi/v1/mining/payment/list
New fields in response to Mining endpoint
GET /sapi/v1/mining/payment/list
:- "type" for income type
- "hashTransfer" for resale Hashrate
- "transferAmount" for transferred Income
New Mining endpoints:
GET /sapi/v1/mining/payment/other
GET /sapi/v1/mining/hash-transfer/config/details
GET /sapi/v1/mining/hash-transfer/config/details/list
GET /sapi/v1/mining/hash-transfer/profit/details
POST /sapi/v1/mining/hash-transfer/config
POST /sapi/v1/mining/hash-transfer/config/cancel
**2021-01-01**
USER DATA STREAM
outboundAccountInfo
has been removed.
**2020-12-30**
- New endpoint for Wallet:
POST /sapi/v1/asset/transfer
to support user universal transfer among Spot, Margin, Futures, C2C, MINING accounts.GET /sapi/v1/asset/transfer
to get user universal transfer history.
**2020-12-22**
- New endpoint for Sub-Account:
GET /sapi/v1/sub-account/sub/transfer/history
to get spot asset transfer history.
**2020-12-11**
- Update endpoints for Futures Cross-Collateral:
GET /sapi/v1/futures/loan/wallet
new fields in responseinterestFreeLimit
for total interest free limit,interestFreeLimitUsed
for interest free limit used.GET /sapi/v1/futures/loan/interestHistory
new fields in responseinterestFreeLimitUsed
for interest free limit used.
**2020-12-04**
- Update endpoint for BLVT:
GET /sapi/v1/blvt/tokenInfo
new fields in responsecurrentBaskets
(includesymbol
,amount
,notionalValue
),purchaseFeePct
,dailyPurchaseLimit
,redeemFeePct
,dailyRedeemLimit
.
- New endpoint for BLVT:
GET /sapi/v1/blvt/userLimit
to get BLVT user limit info.
**2020-12-02**
- New endpoints for Sub-Account:
GET /sapi/v2/sub-account/futures/account
to get detail on sub-account's USDT margined futures account and COIN margined futures account.GET /sapi/v2/sub-account/futures/accountSummary
to get summary of sub-account's USDT margined futures account and COIN margined futures account.GET /sapi/v2/sub-account/futures/positionRisk
to get position risk of sub-account's USDT margined futures account and COIN margined futures account.
**2020-12-01**
- Update Margin Trade Endpoint:
POST /sapi/v1/margin/order
new parameterquoteOrderQty
allow a user to specify the totalquoteOrderQty
spent or received in theMARKET
order.
**2020-11-27**
New API clusters have been added in order to improve performance.
Users can access any of the following API clusters, in addition to api.binance.com
If there are any performance issues with accessing api.binance.com
please try any of the following instead:
**2020-11-16**
- Updated endpoints for Margin, new parameter
archived
to query data from 6 months ago:GET /sapi/v1/margin/loan
GET /sapi/v1/margin/repay
GET /sapi/v1/margin/interestHistory
**2020-11-13**
- New endpoints for Sub-Account:
POST /sapi/v1/sub-account/universalTransfer
to transfer spot and futures asset between master account and sub accounts.GET /sapi/v1/sub-account/universalTransfer
to search transfer records.
**2020-11-10**
- New endpoint to toggle BNB Burn:
POST /sapi/v1/bnbBurn
to toggle BNB Burn on spot trade and margin interest.GET /sapi/v1/bnbBurn
to get BNB Burn status.
**2020-11-09**
- New field
tranId
is available from endpoints:GET /sapi/v1/sub-account/futures/internalTransfer
GET /sapi/v1/sub-account/transfer/subUserHistory
**2020-11-03**
Update endpoints for Futures Cross-Collateral:
GET /sapi/v1/futures/loan/repay/history
new fields in responserepayType
(NORMAL
for normal repayment,COLLATERAL
for collateral repayment),price
(collateral repayment rate),repayCollateral
(collateral amount for collateral repayment).GET /sapi/v1/futures/loan/wallet
new fields in responsetotalInterest
(total interest for cross-collateral),principalForInterest
(cross-collateral principal for interest),interest
(cross-collateral interest).GET /sapi/v1/futures/loan/configs
new fields in responseinterestRate
(interest rate for cross-collateral),interestGracePeriod
(interest grace period for cross-collateral).
New endpoints for Futures Cross-Collateral:
GET /sapi/v1/futures/loan/collateralRepayLimit
to check the maximum and minimum limit when repay with collateral.GET /sapi/v1/futures/loan/collateralRepay
to get quote for collateral repayment.POST /sapi/v1/futures/loan/collateralRepay
to repay with collateral.GET /sapi/v1/futures/loan/collateralRepayResult
to check collateral repayment result.GET /sapi/v1/futures/loan/interestHistory
to get cross-collateral interest history.
**2020-10-14**
- Update endpoints for Futures Cross-Collateral:
POST /sapi/v1/futures/loan/borrow
andGET /sapi/v1/futures/loan/borrow/history
new fieldborrowId
in response for ID of Cross-Collateral borrow operation.POST /sapi/v1/futures/loan/repay
andGET /sapi/v1/futures/loan/repay/history
new fieldrepayId
in response for ID of Cross-Collateral repay operation.
**2020-10-10**
- New
type
added in the endpointPOST /sapi/v1/sub-account/futures/transfer
to support transfer asset from subaccount's spot account to its COIN-margined futures account and transfer asset from subaccount's COIN-margined futures account to its spot account.
**2020-09-30**
- Update endpoints for Margin Account:
GET /sapi/v1/margin/maxBorrowable
new fieldborrowLimit
in response for account borrow limit.
**2020-09-28**
- New endpoints for Binance Savings:
POST /sapi/v1/lending/positionChanged
to change fixed/activity position to daily position.
- New parameter
ACTIVITY
replaceREGULAR
in the following Binance Savings endpoints:GET /sapi/v1/lending/project/list
POST /sapi/v1/lending/customizedFixed/purchase
GET /sapi/v1/lending/project/position/list
GET /sapi/v1/lending/union/purchaseRecord
GET /sapi/v1/lending/union/interestHistory
**2020-09-23**
- New SAPI endpoints for BSwap:
GET /sapi/v1/bswap/pools
to list all swap pools.GET /sapi/v1/bswap/liquidity
to get liquidity information of a pool.POST /sapi/v1/bswap/liquidityAdd
to add liquidity.POST /sapi/v1/bswap/liquidityRemove
to remove liquidity.GET /sapi/v1/bswap/liquidityOps
to get liquidity operation record.GET /sapi/v1/bswap/quote
to request quotes.POST /sapi/v1/bswap/swap
to swap.GET /sapi/v1/bswap/swap
to get swap history.
**2020-09-16**
- New SAPI endpoints for BLVT:
GET /sapi/v1/blvt/tokenInfo
to get BLVT info.POST /sapi/v1/blvt/subscribe (HMAC SHA256)
to subscribe BLVT.GET /sapi/v1/blvt/subscribe/record (HMAC SHA256)
to get subscription record。POST /sapi/v1/blvt/redeem (HMAC SHA256)
to redeem BLVT.GET /sapi/v1/blvt/redeem/record (HMAC SHA256
to get redemption record.
- The BLVT NAV system is working relatively with Binance Futures, so some endpoints are based on futures system:
- New endpoint to get historical BLVT Kline.
- New WebSocket streams for BLVT Info and BLVT NAV Kline:
USER DATA STREAM
outboundAccountInfo
has been deprecated.outboundAccountInfo
will be removed in the future. (Exact date unknown) Please useoutboundAccountPosition
instead.outboundAccountInfo
will now only show the balance of non-zero assets and assets that have been reduced to 0.
**2020-09-03**
- New endpoint
POST /sapi/v1/sub-account/futures/internalTransfer
to transfer futures asset between master account and subaccount. - New endpoint
GET /sapi/v1/sub-account/futures/internalTransfer
to get futures transfer history of subaccount.
**2020-09-01**
- New parameter
masterAccountTotalAsset
added in the endpointGET /sapi/v1/sub-account/spotSummary
to get BTC valued asset summary of master account.
**2020-08-27**
- New endpoint
GET /sapi/v1/sub-account/spotSummary
to get BTC valued asset summary of subaccout.
**2020-08-26**
- New parameter
symbols
added in the endpointGET /sapi/v1/margin/isolated/account
.
**2020-07-28**
ISOLATED MARGIN
New parameters "isIsolated" and "symbol" added for isolated margin in the following endpoints:
POST /sapi/v1/margin/loan
POST /sapi/v1/margin/repay
New parameter "isIsolated" and new response field "isIsolated" added for isolated margin in the following endpoints:
POST /sapi/v1/margin/order
DELETE /sapi/v1/margin/order
GET /sapi/v1/margin/order
GET /sapi/v1/margin/openOrders
GET /sapi/v1/margin/allOrders
GET /sapi/v1/margin/myTrades
New parameter "isolatedSymbol" and new response field "isolatedSymbol" added for isolated margin in the following endpoints:
GET /sapi/v1/margin/loan
GET /sapi/v1/margin/repay
GET /sapi/v1/margin/interestHistory
New parameter "isolatedSymbol" and new response field "isIsolated" added for isolated margin in the following endpoint
GET /sapi/v1/margin/forceLiquidationRec
New parameter "isolatedSymbol" added for isolated margin in the following endpoints:
GET /sapi/v1/margin/maxBorrowable
GET /sapi/v1/margin/maxTransferable
New endpoints for isolated margin:
POST /sapi/v1/margin/isolated/create
POST /sapi/v1/margin/isolated/transfer
GET /sapi/v1/margin/isolated/transfer
GET /sapi/v1/margin/isolated/account
GET /sapi/v1/margin/isolated/pair
GET /sapi/v1/margin/isolated/allPairs
New endpoints for listenKey management of isolated margin account:
POST /sapi/v1/userDataStream/isolated
PUT /sapi/v1/userDataStream/isolated
DELETE /sapi/v1/userDataStream/isolated
**2020-07-20**
- The max value of parameter "limit" in
GET /sapi/v1/margin/allOrders
has been changed as 500.
**2020-07-17**
- There is now a request limit specifically for the sapi/v1/margin/allOrders endpoint at 60 raw requests per minute for a single IP address.
**2020-07-13**
- New SAPI Endpoints for futures Cross-Collateral:
POST /sapi/v1/futures/loan/borrow
GET /sapi/v1/futures/loan/borrow/history
POST /sapi/v1/futures/loan/repay
GET /sapi/v1/futures/loan/repay/history
GET /sapi/v1/futures/loan/wallet
GET /sapi/v1/futures/loan/configs
GET /sapi/v1/futures/loan/calcAdjustLevel
GET /sapi/v1/futures/loan/calcMaxAdjustAmount
POST /sapi/v1/futures/loan/adjustCollateral
GET /sapi/v1/futures/loan/adjustCollateral/history
GET /sapi/v1/futures/loan/liquidationHistory
**2020-06-28**
- SAPI Endpoints for futures:
POST /sapi/v1/futures/transfer
GET /sapi/v1/futures/transfer
**2020-05-06**
- New endpoints for Mining:
GET /sapi/v1/mining/pub/algoList
GET /sapi/v1/mining/pub/coinList
GET /sapi/v1/mining/worker/detail
GET /sapi/v1/mining/worker/list
GET /sapi/v1/mining/payment/list
GET /sapi/v1/mining/statistics/user/status
GET /sapi/v1/mining/statistics/user/list
**2020-05-01**
- From 2020-05-01 UTC 00:00, all symbols will have a limit of 200 open orders using the MAX_NUM_ORDERS filter.
- No existing orders will be removed or canceled.
- Accounts that have 200 or more open orders on a symbol will not be able to place new orders on that symbol until the open order count is below 200.
- OCO orders count as 2 open orders before the
LIMIT
order is touched or theSTOP_LOSS
(orSTOP_LOSS_LIMIT
) order is triggered; once this happens the other order is canceled and will no longer count as an open order.
**2020-04-25**SPOT API
- New field
permissions
- Defines the trading permissions that are allowed on accounts and symbols.
permissions
is an enum array; values:SPOT
MARGIN
permissions
will replaceisSpotTradingAllowed
andisMarginTradingAllowed
onGET api/v3/exchangeInfo
in future API versions (v4+).- For an account to trade on a symbol, the account and symbol must share at least 1 permission in common.
- Updates to GET
api/v3/exchangeInfo
- New field
permissions
added. - New field
quoteAssetPrecision
added; a duplicate of thequotePrecision
field.quotePrecision
will be removed in future API versions (v4+).
- New field
- Updates to GET
api/v3/account
- New field
permissions
added.
- New field
- New endpoint DELETE
api/v3/openOrders
- This will allow a user to cancel all open orders on a single symbol.
- This endpoint will cancel all open orders including OCO orders.
- Orders can be canceled via the API on symbols in the
BREAK
orHALT
status.
OutboundAccountInfo
has new fieldP
which shows the trading permissions of the account.
**2020-04-23**
WEB SOCKET STREAM
- WebSocket connections have a limit of 5 incoming messages per second. A message is considered:
- A PING frame
- A PONG frame
- A JSON control message (e.g. subscribe, unsubscribe)
- A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned.
- A single connection can listen to a maximum of 1024 streams.
New fields in response to endpoint
GET /sapi/v1/lending/daily/token/position
:todayPurchasedAmount
for user's purchased amount today
New lending endpoints for customized fixed projects:
GET /sapi/v1/lending/project/list
POST /sapi/v1/lending/customizedFixed/purchase
GET /sapi/v1/lending/project/position/list
**2020-04-02**
- New fields in response to endpoint
GET /sapi/v1/capital/config/getall
:minConfirm
for min number for balance confirmationunLockConfirm
for confirmation number for balance unlock
**2020-03-24**
MAX_POSITION
filter added.This filter defines the allowed maximum position an account can have on the base asset of a symbol. An account's position defined as the sum of the account's:
- free balance of the base asset
- locked balance of the base asset
- sum of the qty of all open BUY orders
BUY
orders will be rejected if the account's position is greater than the maximum position allowed.
**2020-03-13**
- New parameter
transactionFeeFlag
is available in endpoint:POST /sapi/v1/capital/withdraw/apply
andPOST /wapi/v3/withdraw.html
**2020-02-05**
- New sub account endpoints:
POST /sapi/v1/sub-account/futures/transfer
to transfer between futures and spot accout of sub-account.POST /sapi/v1/sub-account/margin/transfer
to transfer between margin and spot accout of sub-account.POST /sapi/v1/sub-account/transfer/subToSub
to transfer to another account by sub-account.POST /sapi/v1/sub-account/transfer/subToMaster
to transfer to same master by sub-account.GET /sapi/v1/sub-account/transfer/subUserHistory
to get transfer history of sub-account.
**2020-01-15**
New parameter
withdrawOrderId
for client customized withdraw id for endpointPOST /wapi/v3/withdraw.html
.New field
withdrawOrderId
in response toGET /wapi/v3/withdrawHistory.html
**2019-12-25**
New endpoints for Binance Savings:
GET /sapi/v1/lending/daily/product/list
GET /sapi/v1/lending/daily/userLeftQuota
POST /sapi/v1/lending/daily/purchase
GET /sapi/v1/lending/daily/userRedemptionQuota
POST /sapi/v1/lending/daily/redeem
GET /sapi/v1/lending/daily/token/position
GET /sapi/v1/lending/union/account
GET /sapi/v1/lending/union/purchaseRecord
GET /sapi/v1/lending/union/redemptionRecord
GET /sapi/v1/lending/union/interestHistory
Added time interval limit in
GET /sapi/v1/capital/withdraw/history
,
GET /wapi/v3/withdrawHistory.html
,
GET /sapi/v1/capital/deposit/hisrec
and
GET /wapi/v3/depositHistory.html
:
**2019-12-18**
- New endpoint to get daily snapshot of account:
GET /sapi/v1/accountSnapshot
**2019-11-30**
Added parameter
sideEffectType
inPOST /sapi/v1/margin/order (HMAC SHA256)
with enums:NO_SIDE_EFFECT
for normal trade order;MARGIN_BUY
for margin trade order;AUTO_REPAY
for making auto repayment after order filled.
New field
marginBuyBorrowAmount
andmarginBuyBorrowAsset
inFULL
response toPOST /sapi/v1/margin/order (HMAC SHA256)
**2019-11-28**
- New SAPI endpont to disable fast withdraw switch:
POST /sapi/v1/account/disableFastWithdrawSwitch (HMAC SHA256)
- New SAPI endpont to enable fast withdraw switch:
POST /sapi/v1/account/enableFastWithdrawSwitch (HMAC SHA256)
**2019-11-22**
- Quote Order Qty Market orders have been enabled on all symbols.
- Quote Order Qty
MARKET
orders allow a user to specify the totalquoteOrderQty
spent or received in theMARKET
order. - Quote Order Qty
MARKET
orders will not breakLOT_SIZE
filter rules; the order will execute a quantity that will have the notional value as close as possible toquoteOrderQty
. - Using
BNBBTC
as an example:- On the
BUY
side, the order will buy as many BNB asquoteOrderQty
BTC can. - On the
SELL
side, the order will sell as much BNB as needed to receivequoteOrderQty
BTC.
- On the
- Quote Order Qty
**2019-11-19**
GET /sapi/v1/sub-account/margin/account
has new field:marginTradeCoeffVo
which containsforceLiquidationBar
for liquidation margin ratiomarginCallBar
for margin call margin rationormalBar
for initial margin ratio
**2019-11-13**Rest API
- api/v3/exchangeInfo has new fields:
quoteOrderQtyMarketAllowed
baseCommissionPrecision
quoteCommissionPrecision
MARKET
orders have a new optional field:quoteOrderQty
used to specify the quote quantity to BUY or SELL. This cannot be used in combination withquantity
.- The exact timing that
quoteOrderQty
MARKET orders will be enabled is TBD. There will be a separate announcement and further details at that time.
- The exact timing that
- All order query endpoints will return a new field
origQuoteOrderQty
in the JSON payload. (e.g. GET api/v3/allOrders)
Updated error messages for -1128
- Sending an
OCO
with astopLimitPrice
but without astopLimitTimeInForce
will return the error:
- Sending an
Updated error messages for -1003 to specify the limit is referring to the request weight, not to the number of requests.
Deprecation of v1 endpoints:
By end of Q1 2020, the following endpoints will be removed from the API. The documentation has been updated to use the v3 versions of these endpoints.
- GET api/v1/depth
- GET api/v1/historicalTrades
- GET api/v1/aggTrades
- GET api/v1/klines
- GET api/v1/ticker/24hr
- GET api/v1/ticker/price
- GET api/v1/exchangeInfo
- POST api/v1/userDataStream
- PUT api/v1/userDataStream
- GET api/v1/ping
- GET api/v1/time
- GET api/v1/ticker/bookTicker
These endpoints however, will NOT be migrated to v3. Please use the following endpoints instead moving forward.
Old V1 Endpoints | New V3 Endpoints |
---|---|
GET api/v1/ticker/allPrices | GET api/v3/ticker/price |
GET api/v1/ticker/allBookTickers | GET api/v3/ticker/bookTicker |
Changes to
executionReport
event- If the C field is empty, it will now properly return
null
, instead of"null"
. - New field Q which represents the
quoteOrderQty
.
- If the C field is empty, it will now properly return
balanceUpdate
event type added- This event occurs when funds are deposited or withdrawn from your account.
- WSS now supports live subscribing/unsubscribing to streams.
**2019-11-08**
- New sapi for subaccount management on margin and futures:
GET /sapi/v1/sub-account/status (HMAC SHA256)
POST /sapi/v1/sub-account/margin/enable (HMAC SHA256)
GET /sapi/v1/sub-account/margin/account (HMAC SHA256)
GET /sapi/v1/sub-account/margin/accountSummary (HMAC SHA256)
POST /sapi/v1/sub-account/futures/enable (HMAC SHA256)
GET /sapi/v1/sub-account/futures/account (HMAC SHA256)
GET /sapi/v1/sub-account/futures/accountSummary (HMAC SHA256)
GET /sapi/v1/sub-account/futures/positionRisk (HMAC SHA256)
**2019-11-04**
- New sapi endpoints for subaccount wallet.
GET /sapi/v1/capital/deposit/subAddress (HMAC SHA256))
: fetch subaccount deposit address.GET /sapi/v1/capital/deposit/subHisrec (HMAC SHA256))
: fetch subaccount deposit history.
**2019-10-29**
- New sapi endpoints for wallet.
POST /sapi/v1/capital/withdraw/apply (HMAC SHA256)
: withdraw.Get /sapi/v1/capital/withdraw/history (HMAC SHA256)
: fetch withdraw history with network.
**2019-10-14**
- New sapi endpoints for wallet.
GET /sapi/v1/capital/config/getall (HMAC SHA256)
: get all coins' information for user.GET /sapi/v1/capital/deposit/hisrec (HMAC SHA256)
: fetch deposit history with network.GET /sapi/v1/capital/deposit/address (HMAC SHA256)
: fetch deposit address with network.
**2019-10-11**
- Added parameter
network
inPOST /wapi/v3/withdraw.html
so that asset can be withdrawed with specific network.
**2019-09-09**
- New WebSocket streams for bookTickers added:
<symbol>@bookTicker
and!bookTicker
.
**2019-09-03**
- Faster order book data with 100ms updates:
<symbol>@depth@100ms
and<symbol>@depth#@100ms
- Added "Update Speed:" to
Websocket Market Streams
- Removed deprecated v1 endpoints as per previous announcement:
- GET api/v1/order
- GET api/v1/openOrders
- POST api/v1/order
- DELETE api/v1/order
- GET api/v1/allOrders
- GET api/v1/account
- GET api/v1/myTrades
**2019-08-16**
GET api/v1/depth
limit
of 10000 has been temporarily removedIn Q4 2017, the following endpoints were deprecated and removed from the API documentation. They have been permanently removed from the API as of this version. We apologize for the omission from the original changelog:
- GET api/v1/order
- GET api/v1/openOrders
- POST api/v1/order
- DELETE api/v1/order
- GET api/v1/allOrders
- GET api/v1/account
- GET api/v1/myTrades
Streams, endpoints, parameters, payloads, etc. described in the documents in this repository are considered official and supported. The use of any other streams, endpoints, parameters, or payloads, etc. is not supported; use them at your own risk and with no guarantees.
**2019-09-15**Rest API
New order type: OCO ("One Cancels the Other")
An OCO has 2 orders: (also known as legs in financial terms)
STOP_LOSS
orSTOP_LOSS_LIMIT
legLIMIT_MAKER
leg
Price Restrictions:
SELL Orders
: Limit Price > Last Price > Stop PriceBUY Orders
: Limit Price < Last Price < Stop Price- As stated, the prices must "straddle" the last traded price on the symbol. EX: If the last price is 10:
- A SELL OCO must have the limit price greater than 10, and the stop price less than 10.
- A BUY OCO must have a limit price less than 10, and the stop price greater than 10.
Quantity Restrictions:
- Both legs must have the same quantity.
ICEBERG
quantities however, do not have to be the same.
Execution Order:
- If the
LIMIT_MAKER
is touched, the limit maker leg will be executed first BEFORE canceling the Stop Loss Leg. - if the Market Price moves such that the
STOP_LOSS
orSTOP_LOSS_LIMIT
will trigger, the Limit Maker leg will be cancelled BEFORE executing theSTOP_LOSS
Leg.
- If the
Cancelling an OCO
- Cancelling either order leg will cancel the entire OCO.
- The entire OCO can be canceled via the
orderListId
or thelistClientOrderId
.
New Enums for OCO:
ListStatusType
RESPONSE
- used when ListStatus is responding to a failed action. (either order list placement or cancellation)EXEC_STARTED
- used when an order list has been placed or there is an update to a list's status.ALL_DONE
- used when an order list has finished executing and is no longer active.
ListOrderStatus
EXECUTING
- used when an order list has been placed or there is an update to a list's status.ALL_DONE
- used when an order list has finished executing and is no longer active.REJECT
- used when ListStatus is responding to a failed action. (either order list placement or cancellation)
ContingencyType
OCO
- specifies the type of order list.
New Endpoints:
- POST api/v3/order/oco
- DELETE api/v3/orderList
- GET api/v3/orderList
recvWindow
cannot exceed 60000.New
intervalLetter
values for headers:- SECOND => S
- MINUTE => M
- HOUR => H
- DAY => D
New Headers
X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)
will give your current used request weight for the (intervalNum)(intervalLetter) rate limiter. For example, if there is a one minute request rate weight limiter set, you will get aX-MBX-USED-WEIGHT-1M
header in the response. The legacy headerX-MBX-USED-WEIGHT
will still be returned and will represent the current used weight for the one minute request rate weight limit.New Header
X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)
that is updated on any valid order placement and tracks your current order count for the interval; rejected/unsuccessful orders are not guaranteed to haveX-MBX-ORDER-COUNT-**
headers in the response.- Eg.
X-MBX-ORDER-COUNT-1S
for "orders per 1 second" andX-MBX-ORDER-COUNT-1D
for orders per "one day"
- Eg.
GET api/v1/depth now supports
limit
5000 and 10000; weights are 50 and 100 respectively.GET api/v1/exchangeInfo has a new parameter
ocoAllowed
.
executionReport
event now contains "g" which has theorderListId
; it will be set to -1 for non-OCO orders.- New Event Type
listStatus
;listStatus
is sent on an update to any OCO order. - New Event Type
outboundAccountPosition
;outboundAccountPosition
is sent any time an account's balance changes and contains the assets that could have changed by the event that generated the balance change (a deposit, withdrawal, trade, order placement, or cancelation).
- -1131 BAD_RECV_WINDOW
recvWindow
must be less than 60000
- -1099 Not found, authenticated, or authorized
- This replaces error code -1999
- OCO_BAD_ORDER_PARAMS
- A parameter for one of the orders is incorrect.
- OCO_BAD_PRICES
- The relationship of the prices for the orders is not correct.
- UNSUPPORTED_ORD_OCO
- OCO orders are not supported for this symbol.
**2019-03-12**Rest API
- X-MBX-USED-WEIGHT header added to Rest API responses.
- Retry-After header added to Rest API 418 and 429 responses.
- When canceling the Rest API can now return
errorCode
-1013 OR -2011 if the symbol'sstatus
isn'tTRADING
. api/v1/depth
no longer has the ignored and empty[]
.api/v3/myTrades
now returnsquoteQty
; the price * qty of for the trade.
<symbol>@depth
and<symbol>@depthX
streams no longer have the ignored and empty[]
.
- Matching Engine stability/reliability improvements.
- Rest API performance improvements.
**2018-11-13**Rest API
- Can now cancel orders through the Rest API during a trading ban.
- New filters:
PERCENT_PRICE
,MARKET_LOT_SIZE
,MAX_NUM_ICEBERG_ORDERS
. - Added
RAW_REQUESTS
rate limit. Limits based on the number of requests over X minutes regardless of weight. - /api/v3/ticker/price increased to weight of 2 for a no symbol query.
- /api/v3/ticker/bookTicker increased weight of 2 for a no symbol query.
- DELETE /api/v3/order will now return an execution report of the final state of the order.
MIN_NOTIONAL
filter has two new parameters:applyToMarket
(whether or not the filter is applied to MARKET orders) andavgPriceMins
(the number of minutes over which the price averaged for the notional estimation).intervalNum
added to /api/v1/exchangeInfo limits.intervalNum
describes the amount of the interval. For example:intervalNum
5, withinterval
minute, means "every 5 minutes".
(qty * price) of all trades / sum of qty of all trades over previous 5 minutes.
If there is no trade in the last 5 minutes, it takes the first trade that happened outside of the 5min window. For example if the last trade was 20 minutes ago, that trade's price is the 5 min average.
If there is no trade on the symbol, there is no average price and market orders cannot be placed. On a new symbol with
applyToMarket
enabled on theMIN_NOTIONAL
filter, market orders cannot be placed until there is at least 1 trade.The current average price can be checked here:
https://api.binance.com/api/v3/avgPrice?symbol=<symbol>
For example: https://api.binance.com/api/v3/avgPrice?symbol=BNBUSDT
Last quote asset transacted quantity
(as variableY
) added to execution reports. Represents thelastPrice
lastQty
(L
l
).
**2018-07-18**Rest API
- New filter:
ICEBERG_PARTS
POST api/v3/order
new defaults fornewOrderRespType
.ACK
,RESULT
, orFULL
;MARKET
andLIMIT
order types default toFULL
, all other orders default toACK
.- POST api/v3/order
RESULT
andFULL
responses now havecummulativeQuoteQty
- GET api/v3/openOrders with no symbol weight reduced to 40.
- GET api/v3/ticker/24hr with no symbol weight reduced to 40.
- Max amount of trades from GET /api/v1/trades increased to 1000.
- Max amount of trades from GET /api/v1/historicalTrades increased to 1000.
- Max amount of aggregate trades from GET /api/v1/aggTrades increased to 1000.
- Max amount of aggregate trades from GET /api/v1/klines increased to 1000.
- Rest API Order lookups now return
updateTime
which represents the last time the order was updated;time
is the order creation time. - Order lookup endpoints will now return
cummulativeQuoteQty
. IfcummulativeQuoteQty
is < 0, it means the data isn't available for this order at this time. REQUESTS
rate limit type changed toREQUEST_WEIGHT
. This limit was always logically request weight and the previous name for it caused confusion.
cummulativeQuoteQty
field added to order responses and execution reports (as variableZ
). Represents the cummulative amount of thequote
that has been spent (with aBUY
order) or received (with aSELL
order). Historical orders will have a value < 0 in this field indicating the data is not available at this time.cummulativeQuoteQty
divided bycummulativeQty
will give the average price for an order.O
(order creation time) added to execution reports
**2018-01-23**
- GET /api/v1/historicalTrades weight decreased to 5
- GET /api/v1/aggTrades weight decreased to 1
- GET /api/v1/klines weight decreased to 1
- GET /api/v1/ticker/24hr all symbols weight decreased to number of trading symbols / 2
- GET /api/v3/allOrders weight decreased to 5
- GET /api/v3/myTrades weight decreased to 5
- GET /api/v3/account weight decreased to 5
- GET /api/v1/depth limit=500 weight decreased to 5
- GET /api/v1/depth limit=1000 weight decreased to 10
- -1003 error message updated to direct users to websockets
**2018-01-20**
- GET /api/v1/ticker/24hr single symbol weight decreased to 1
- GET /api/v3/openOrders all symbols weight decreased to number of trading symbols / 2
- GET /api/v3/allOrders weight decreased to 15
- GET /api/v3/myTrades weight decreased to 15
- GET /api/v3/order weight decreased to 1
- myTrades will now return both sides of a self-trade/wash-trade
**2018-01-14**
- GET /api/v1/aggTrades weight changed to 2
- GET /api/v1/klines weight changed to 2
- GET /api/v3/order weight changed to 2
- GET /api/v3/allOrders weight changed to 20
- GET /api/v3/account weight changed to 20
- GET /api/v3/myTrades weight changed to 20
- GET /api/v3/historicalTrades weight changed to 20
Introduction
#
API Key Setup- Some endpoints will require an API Key. Please refer to this page regarding API key creation.
- Once API key is created, it is recommended to set IP restrictions on the key for security reasons.
- Never share your API key/secret key to ANYONE.
#
API Key Restrictions- After creating the API key, the default restrictions is
Enable Reading
. - To enable withdrawals via the API, the API key restriction needs to be modified through the Binance UI.
#
Enabling Accounts#
Spot AccountA SPOT
account is provided by default upon creation of a Binance Account.
#
Margin AccountTo enable a MARGIN
account for Margin Trading, please refer to the Margin Trading Guide
#
Spot TestnetUsers can use the SPOT Testnet to practice SPOT
trading.
Currently, this is only available via the API.
Please refer to the SPOT Testnet page for more information and how to set up the Testnet API key.
#
API Library#
Python connectorThis is a lightweight library that works as a connector to Binance public API, written in Python.
https://github.com/binance/binance-connector-python
#
Node.js connectorThis is a lightweight library that works as a connector to Binance public API, written for Node.js users.
https://github.com/binance/binance-connector-node
#
Ruby connectorThis is a lightweight library that works as a connector to Binance public API, written for Ruby users.
https://github.com/binance/binance-connector-ruby
#
DotNET connectorThis is a lightweight library that works as a connector to Binance public API, written for C# users.
https://github.com/binance/binance-connector-dotnet
#
Java connectorThis is a lightweight library that works as a connector to Binance public API, written for Java users.
https://github.com/binance/binance-connector-java
#
Postman CollectionsThere is now a Postman collection containing the API endpoints for quick and easy use.
This is recommended for new users who want to get a quick-start into using the API.
For more information please refer to this page: Binance API Postman
#
SwaggerA YAML file with OpenAPI specification on the RESTful API is available to be used, as well as a Swagger UI page for the consulting.
https://github.com/binance/binance-api-swagger
#
Contact Us- Binance API Telegram Group
- For any questions in sudden drop in performance with the API and/or Websockets.
- For any general questions about the API not covered in the documentation.
- Binance Developers
- For any questions on your code implementation with the API and/or Websockets.
- Binance Customer Support
- For cases such as missing funds, help with 2FA, etc.
General Info
#
General API Information- The following base endpoints are available:
- The last 4 endpoints in the point above (
api1
-api4
) might give better performance but have less stability. Please use whichever works best for your setup. - All endpoints return either a JSON object or array.
- Data is returned in ascending order. Oldest first, newest last.
- All time and timestamp related fields are in milliseconds.
- The base endpoint https://data-api.binance.vision can be used to access the following API endpoints that have
NONE
as security type:
#
HTTP Return Codes- HTTP
4XX
return codes are used for malformed requests; the issue is on the sender's side. - HTTP
403
return code is used when the WAF Limit (Web Application Firewall) has been violated. - HTTP
409
return code is used when a cancelReplace order partially succeeds. (e.g. if the cancellation of the order fails but the new order placement succeeds.) - HTTP
429
return code is used when breaking a request rate limit. - HTTP
418
return code is used when an IP has been auto-banned for continuing to send requests after receiving429
codes. - HTTP
5XX
return codes are used for internal errors; the issue is on Binance's side. It is important to NOT treat this as a failure operation; the execution status is UNKNOWN and could have been a success.
#
Error Codes and Messages- If there is an error, the API will return an error with a message of the reason.
The error payload on API and SAPI is as follows:
- Specific error codes and messages defined in Error Codes.
#
General Information on Endpoints- For
GET
endpoints, parameters must be sent as aquery string
. - For
POST
,PUT
, andDELETE
endpoints, the parameters may be sent as aquery string
or in therequest body
with content typeapplication/x-www-form-urlencoded
. You may mix parameters between both thequery string
andrequest body
if you wish to do so. - Parameters may be sent in any order.
- If a parameter sent in both the
query string
andrequest body
, thequery string
parameter will be used.
#
LIMITS#
General Info on Limits- The following
intervalLetter
values for headers:- SECOND => S
- MINUTE => M
- HOUR => H
- DAY => D
intervalNum
describes the amount of the interval. For example,intervalNum
5 withintervalLetter
M means "Every 5 minutes".- The
/api/v3/exchangeInfo
rateLimits
array contains objects related to the exchange'sRAW_REQUESTS
,REQUEST_WEIGHT
, andORDERS
rate limits. These are further defined in theENUM definitions
section underRate limiters (rateLimitType)
. - A 429 will be returned when either request rate limit or order rate limit is violated.
#
IP Limits- Every request will contain
X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)
in the response headers which has the current used weight for the IP for all request rate limiters defined. - Each route has a
weight
which determines for the number of requests each endpoint counts for. Heavier endpoints and endpoints that do operations on multiple symbols will have a heavierweight
. - When a 429 is received, it's your obligation as an API to back off and not spam the API.
- Repeatedly violating rate limits and/or failing to back off after receiving 429s will result in an automated IP ban (HTTP status 418).
- IP bans are tracked and scale in duration for repeat offenders, from 2 minutes to 3 days.
- A
Retry-After
header is sent with a 418 or 429 responses and will give the number of seconds required to wait, in the case of a 429, to prevent a ban, or, in the case of a 418, until the ban is over. - The limits on the API are based on the IPs, not the API keys.
#
Order Rate LimitsEvery successful order response will contain a
X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)
header which has the current order count for the account for all order rate limiters defined.When the order count exceeds the limit, you will receive a 429 error without the
Retry-After
header. Please check the Order Rate Limit rules usingGET api/v3/exchangeInfo
and wait for reactivation accordingly.Rejected/unsuccessful orders are not guaranteed to have
X-MBX-ORDER-COUNT-**
headers in the response.The order rate limit is counted against each account.
To monitor order count usage, refer to GET
api/v3/rateLimit/order
#
Websocket Limits- WebSocket connections have a limit of 5 incoming messages per second. A message is considered:
- A PING frame
- A PONG frame
- A JSON controlled message (e.g. subscribe, unsubscribe)
- A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned.
- A single connection can listen to a maximum of 1024 streams.
- There is a limit of 300 connections per attempt every 5 minutes per IP.
#
/api/ and /sapi/ Limit IntroductionThe /api/*
and /sapi/*
endpoints adopt either of two access limiting rules, IP limits or UID (account) limits.
Endpoints related to
/api/*
:- According to the two modes of IP and UID (account) limit, each are independent.
- Endpoints share the 1200 per minute limit based on IP.
- Responses contain the header
X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)
, defining the weight used by the current IP. - Successful order responses contain the header
X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)
, defining the order limit used by the UID.
Endpoints related to
/sapi/*
:- Endpoints are marked according to IP or UID limit and their corresponding weight value.
- Each endpoint with IP limits has an independent 12000 per minute limit.
- Each endpoint with UID limits has an independent 180000 per minute limit.
- Responses from endpoints with IP limits contain the header
X-SAPI-USED-IP-WEIGHT-1M
, defining the weight used by the current IP. - Responses from endpoints with UID limits contain the header
X-SAPI-USED-UID-WEIGHT-1M
, defining the weight used by the current UID.
#
Data Sources- The API system is asynchronous, so some delay in the response is normal and expected.
- Each endpoint has a data source indicating where the data is being retrieved, and thus which endpoints have the most up-to-date response.
These are the three sources, ordered by which is has the most up-to-date response to the one with potential delays in updates.
- Matching Engine - the data is from the matching Engine
- Memory - the data is from a server's local or external memory
- Database - the data is taken directly from a database
#
Endpoint security type- Each endpoint has a security type that determines how you will
interact with it. This is stated next to the NAME of the endpoint.
- If no security type is stated, assume the security type is NONE.
- API-keys are passed into the Rest API via the
X-MBX-APIKEY
header. - API-keys and secret-keys are case sensitive.
- API-keys can be configured to only access certain types of secure endpoints. For example, one API-key could be used for TRADE only, while another API-key can access everything except for TRADE routes.
- By default, API-keys can access all secure routes.
Security Type | Description |
---|---|
NONE | Endpoint can be accessed freely. |
TRADE | Endpoint requires sending a valid API-Key and signature. |
MARGIN | Endpoint requires sending a valid API-Key and signature. |
USER_DATA | Endpoint requires sending a valid API-Key and signature. |
USER_STREAM | Endpoint requires sending a valid API-Key. |
MARKET_DATA | Endpoint requires sending a valid API-Key. |
TRADE
,MARGIN
andUSER_DATA
endpoints areSIGNED
endpoints.
#
SIGNED (TRADE, USER_DATA, AND MARGIN) Endpoint securitySIGNED
endpoints require an additional parameter,signature
, to be sent in thequery string
orrequest body
.- Endpoints use
HMAC SHA256
signatures. TheHMAC SHA256 signature
is a keyedHMAC SHA256
operation. Use yoursecretKey
as the key andtotalParams
as the value for the HMAC operation. - The
signature
is not case sensitive. totalParams
is defined as thequery string
concatenated with therequest body
.
#
Timing security- A
SIGNED
endpoint also requires a parameter,timestamp
, to be sent which should be the millisecond timestamp of when the request was created and sent. - An additional parameter,
recvWindow
, may be sent to specify the number of milliseconds aftertimestamp
the request is valid for. IfrecvWindow
is not sent, it defaults to 5000.
The logic is as follows:
Serious trading is about timing. Networks can be unstable and unreliable,
which can lead to requests taking varying amounts of time to reach the
servers. With recvWindow
, you can specify that the request must be
processed within a certain number of milliseconds or be rejected by the
server.
#
SIGNED Endpoint Examples for POST /api/v3/order - HMAC KeysHere is a step-by-step example of how to send a vaild signed payload from the
Linux command line using echo
, openssl
, and curl
.
Key | Value |
---|---|
apiKey | vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A |
secretKey | NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j |
Parameter | Value |
---|---|
symbol | LTCBTC |
side | BUY |
type | LIMIT |
timeInForce | GTC |
quantity | 1 |
price | 0.1 |
recvWindow | 5000 |
timestamp | 1499827319559 |
Example 1: As a request body
Example 1
HMAC SHA256 signature:
curl command:
- requestBody:
symbol=LTCBTC
&side=BUY
&type=LIMIT
&timeInForce=GTC
&quantity=1
&price=0.1
&recvWindow=5000
×tamp=1499827319559
Example 2: As a query string
Example 2
HMAC SHA256 signature:
curl command:
- queryString:
symbol=LTCBTC
&side=BUY
&type=LIMIT
&timeInForce=GTC
&quantity=1
&price=0.1
&recvWindow=5000
×tamp=1499827319559
Example 3: Mixed query string and request body
Example 3
HMAC SHA256 signature:
curl command:
- queryString:
symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC
- requestBody:
quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559
Note that the signature is different in example 3. There is no & between "GTC" and "quantity=1".
#
SIGNED Endpoint Example for POST /api/v3/order - RSA Keys- This will be a step by step process how to create the signature payload to send a valid signed payload.
- We support
PKCS#8
currently. - To get your API key, you need to upload your RSA Public Key to your account and a corresponding API key will be provided for you.
For this example, the private key will be referenced as test-prv-key.pem
Key | Value |
---|---|
apiKey | CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ |
Parameter | Value |
---|---|
symbol | BTCUSDT |
side | SELL |
type | LIMIT |
timeInForce | GTC |
quantity | 1 |
price | 0.2 |
recvWindow | 5000 |
timestamp | 1668481559918 |
Signature payload (with the listed parameters):
Step 1: Construct the payload
Arrange the list of parameters into a string. Separate each parameter with a &
.
Step 2: Compute the signature:
2.1 - Encode signature payload as ASCII data.
Step 2.2
2.2 - Sign payload using RSASSA-PKCS1-v1_5 algorithm with SHA-256 hash function.
Step 2.3
2.3 - Encode output as base64 string.
Step 2.4
2.4 - Since the signature may contain /
and =
, this could cause issues with sending the request. So the signature has to be URL encoded.
Step 2.5
2.5 - curl command
Bash script
A sample Bash script containing similar steps is available in the right side.
#
SIGNED Endpoint Examples for POST /api/v3/order - Ed25519 KeysParameter | Value |
---|---|
symbol | BTCUSDT |
side | SELL |
type | LIMIT |
timeInForce | GTC |
quantity | 1 |
price | 0.2 |
timestamp | 1668481559918 |
Python script
A sample code in Python to show how to sign the payload with an Ed25519 key is available on the right side.
#
Public API Definitions#
TerminologyThese terms will be used throughout the documentation, so it is recommended especially for new users to read to help their understanding of the API.
base asset
refers to the asset that is thequantity
of a symbol. For the symbol BTCUSDT, BTC would be thebase asset.
quote asset
refers to the asset that is theprice
of a symbol. For the symbol BTCUSDT, USDT would be thequote asset
.
#
ENUM definitionsSymbol status (status):
PRE_TRADING
TRADING
POST_TRADING
END_OF_DAY
HALT
AUCTION_MATCH
BREAK
Account and Symbol Permissions (permissions):
SPOT
MARGIN
LEVERAGED
TRD_GRP_002
TRD_GRP_003
TRD_GRP_004
TRD_GRP_005
TRD_GRP_006
TRD_GRP_007
TRD_GRP_008
TRD_GRP_009
TRD_GRP_010
TRD_GRP_011
TRD_GRP_012
TRD_GRP_013
Order status (status):
Status | Description |
---|---|
NEW | The order has been accepted by the engine. |
PARTIALLY_FILLED | A part of the order has been filled. |
FILLED | The order has been completed. |
CANCELED | The order has been canceled by the user. |
PENDING_CANCEL | Currently unused |
REJECTED | The order was not accepted by the engine and not processed. |
EXPIRED | The order was canceled according to the order type's rules (e.g. LIMIT FOK orders with no fill, LIMIT IOC or MARKET orders that partially fill) or by the exchange, (e.g. orders canceled during liquidation, orders canceled during maintenance) |
EXPIRED_IN_MATCH | The order was canceled by the exchange due to STP trigger. (e.g. an order with EXPIRE_TAKER will match with existing orders on the book with the same account or same tradeGroupId ) |
OCO Status (listStatusType):
Status | Description |
---|---|
RESPONSE | This is used when the ListStatus is responding to a failed action. (E.g. Orderlist placement or cancellation) |
EXEC_STARTED | The order list has been placed or there is an update to the order list status. |
ALL_DONE | The order list has finished executing and thus no longer active. |
OCO Order Status (listOrderStatus):
Status | Description |
---|---|
EXECUTING | Either an order list has been placed or there is an update to the status of the list. |
ALL_DONE | An order list has completed execution and thus no longer active. |
REJECT | The List Status is responding to a failed action either during order placement or order canceled.) |
ContingencyType
OCO
AllocationType
SOR
WorkingFloor
EXCHANGE
SOR
Order types (orderTypes, type):
LIMIT
MARKET
STOP_LOSS
STOP_LOSS_LIMIT
TAKE_PROFIT
TAKE_PROFIT_LIMIT
LIMIT_MAKER
Order Response Type (newOrderRespType):
ACK
RESULT
FULL
Order side (side):
- BUY
- SELL
Time in force (timeInForce):
This sets how long an order will be active before expiration.
Status | Description |
---|---|
GTC | Good Til Canceled An order will be on the book unless the order is canceled. |
IOC | Immediate Or Cancel An order will try to fill the order as much as it can before the order expires. |
FOK | Fill or Kill An order will expire if the full order cannot be filled upon execution. |
Kline/Candlestick chart intervals:
s-> seconds; m -> minutes; h -> hours; d -> days; w -> weeks; M -> months
- 1s
- 1m
- 3m
- 5m
- 15m
- 30m
- 1h
- 2h
- 4h
- 6h
- 8h
- 12h
- 1d
- 3d
- 1w
- 1M
Rate limiters (rateLimitType)
REQUEST_WEIGHT
ORDERS
RAW_REQUESTS
REQUEST_WEIGHT
ORDERS
RAW_REQUESTS
Rate limit intervals (interval)
- SECOND
- MINUTE
- DAY
#
FiltersFilters define trading rules on a symbol or an exchange.
Filters come in two forms: symbol filters
and exchange filters
.
#
Symbol Filters#
PRICE_FILTERExchangeInfo format:
The PRICE_FILTER
defines the price
rules for a symbol. There are 3 parts:
minPrice
defines the minimumprice
/stopPrice
allowed; disabled onminPrice
== 0.maxPrice
defines the maximumprice
/stopPrice
allowed; disabled onmaxPrice
== 0.tickSize
defines the intervals that aprice
/stopPrice
can be increased/decreased by; disabled ontickSize
== 0.
Any of the above variables can be set to 0, which disables that rule in the price filter
. In order to pass the price filter
, the following must be true for price
/stopPrice
of the enabled rules:
price
>=minPrice
price
<=maxPrice
price
%tickSize
== 0
#
PERCENT_PRICEExchangeInfo format:
The PERCENT_PRICE
filter defines the valid range for the price based on the average of the previous trades.
avgPriceMins
is the number of minutes the average price is calculated over. 0 means the last price is used.
In order to pass the percent price
, the following must be true for price
:
price
<=weightedAveragePrice
*multiplierUp
price
>=weightedAveragePrice
*multiplierDown
#
PERCENT_PRICE_BY_SIDEExchangeInfo format:
The PERCENT_PRICE_BY_SIDE
filter defines the valid range for the price based on the average of the previous trades.
avgPriceMins
is the number of minutes the average price is calculated over. 0 means the last price is used.
There is a different range depending on whether the order is placed on the BUY
side or the SELL
side.
Buy orders will succeed on this filter if:
Order price
<=weightedAveragePrice
*bidMultiplierUp
Order price
>=weightedAveragePrice
*bidMultiplierDown
Sell orders will succeed on this filter if:
Order Price
<=weightedAveragePrice
*askMultiplierUp
Order Price
>=weightedAveragePrice
*askMultiplierDown
#
LOT_SIZEExchangeInfo format:
The LOT_SIZE
filter defines the quantity
(aka "lots" in auction terms) rules for a symbol. There are 3 parts:
minQty
defines the minimumquantity
/icebergQty
allowed.maxQty
defines the maximumquantity
/icebergQty
allowed.stepSize
defines the intervals that aquantity
/icebergQty
can be increased/decreased by.
In order to pass the lot size
, the following must be true for quantity
/icebergQty
:
quantity
>=minQty
quantity
<=maxQty
quantity
%stepSize
== 0
#
MIN_NOTIONALExchangeInfo format:
The MIN_NOTIONAL
filter defines the minimum notional value allowed for an order on a symbol.
An order's notional value is the price
quantity
.
If the order is an Algo order (e.g. STOP_LOSS_LIMIT
), then the notional value of the stopPrice
quantity
will also be evaluated.
If the order is an Iceberg Order, then the notional value of the price
* icebergQty
will also be evaluated.
applyToMarket
determines whether or not the MIN_NOTIONAL
filter will also be applied to MARKET
orders.
Since MARKET
orders have no price, the average price is used over the last avgPriceMins
minutes.
avgPriceMins
is the number of minutes the average price is calculated over. 0 means the last price is used.
#
NOTIONALExchangeInfo format:
The NOTIONAL
filter defines the acceptable notional range allowed for an order on a symbol.
applyMinToMarket
determines whether the minNotional
will be applied to MARKET
orders.
applyMaxToMarket
determines whether the maxNotional
will be applied to MARKET
orders.
In order to pass this filter, the notional (price * quantity
) has to pass the following conditions:
price * quantity
<=maxNotional
price * quantity
>=minNotional
For MARKET
orders, the average price used over the last avgPriceMins
minutes will be used for calculation.
If the avgPriceMins
is 0, then the last price will be used.
#
ICEBERG_PARTSExchangeInfo format:
The ICEBERG_PARTS
filter defines the maximum parts an iceberg order can have. The number of ICEBERG_PARTS
is defined as CEIL(qty / icebergQty)
.
#
MARKET_LOT_SIZEExchangeInfo format:
The MARKET_LOT_SIZE
filter defines the quantity
(aka "lots" in auction terms) rules for MARKET
orders on a symbol. There are 3 parts:
minQty
defines the minimumquantity
allowed.maxQty
defines the maximumquantity
allowed.stepSize
defines the intervals that aquantity
can be increased/decreased by.
In order to pass the market lot size
, the following must be true for quantity
:
quantity
>=minQty
quantity
<=maxQty
quantity
%stepSize
== 0
#
MAX_NUM_ORDERSExchangeInfo format:
The MAX_NUM_ORDERS
filter defines the maximum number of orders an account is allowed to have open on a symbol.
Note that both "algo" orders and normal orders are counted for this filter.
#
MAX_NUM_ALGO_ORDERSExchangeInfo format:
The MAX_NUM_ALGO_ORDERS
filter defines the maximum number of "algo" orders an account is allowed to have open on a symbol.
"Algo" orders are STOP_LOSS
, STOP_LOSS_LIMIT
, TAKE_PROFIT
, and TAKE_PROFIT_LIMIT
orders.
#
MAX_NUM_ICEBERG_ORDERSThe MAX_NUM_ICEBERG_ORDERS
filter defines the maximum number of ICEBERG
orders an account is allowed to have open on a symbol.
An ICEBERG
order is any order where the icebergQty
is > 0.
ExchangeInfo format:
#
MAX_POSITIONThe MAX_POSITION
filter defines the allowed maximum position an account can have on the base asset of a symbol.
An account's position defined as the sum of the account's:
- free balance of the base asset
- locked balance of the base asset
- sum of the qty of all open BUY orders
BUY
orders will be rejected if the account's position is greater than the maximum position allowed.
If an order's quantity
can cause the position to overflow, this will also fail the MAX_POSITION
filter.
ExchangeInfo format:
#
TRAILING_DELTAExchangeInfo format:
The TRAILING_DELTA
filter defines the minimum and maximum value for the parameter trailingDelta
.
In order for a trailing stop order to pass this filter, the following must be true:
For STOP_LOSS BUY
, STOP_LOSS_LIMIT_BUY
,TAKE_PROFIT SELL
and TAKE_PROFIT_LIMIT SELL
orders:
trailingDelta
>=minTrailingAboveDelta
trailingDelta
<=maxTrailingAboveDelta
For STOP_LOSS SELL
, STOP_LOSS_LIMIT SELL
, TAKE_PROFIT BUY
, and TAKE_PROFIT_LIMIT BUY
orders:
trailingDelta
>=minTrailingBelowDelta
trailingDelta
<=maxTrailingBelowDelta
#
Exchange Filters#
EXCHANGE_MAX_NUM_ORDERSExchangeInfo format:
The EXCHANGE_MAX_NUM_ORDERS
filter defines the maximum number of orders an account is allowed to have open on the exchange.
Note that both "algo" orders and normal orders are counted for this filter.
#
EXCHANGE_MAX_NUM_ALGO_ORDERSExchangeInfo format:
The EXCHANGE_MAX_NUM_ALGO_ORDERS
filter defines the maximum number of "algo" orders an account is allowed to have open on the exchange.
"Algo" orders are STOP_LOSS
, STOP_LOSS_LIMIT
, TAKE_PROFIT
, and TAKE_PROFIT_LIMIT
orders.
#
EXCHANGE_MAX_NUM_ICEBERG_ORDERSThe EXCHANGE_MAX_NUM_ICEBERG_ORDERS
filter defines the maximum number of iceberg orders an account is allowed to have open on the exchange.
ExchangeInfo format:
Wallet Endpoints
#
System Status (System)Response
GET /sapi/v1/system/status
Fetch system status.
Weight(IP): 1
#
All Coins' Information (USER_DATA)Get information of coins (available for deposit and withdraw) for user.
Response:
GET /sapi/v1/capital/config/getall
Weight(IP): 10
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Daily Account Snapshot (USER_DATA)Response:
OR
OR
GET /sapi/v1/accountSnapshot
Weight(IP): 2400
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
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 |
- The query time period must be less then 30 days
- Support query within the last one month only
- If startTimeand endTime not sent, return records of the last 7 days by default
#
Disable Fast Withdraw Switch (USER_DATA)Response:
POST /sapi/v1/account/disableFastWithdrawSwitch
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
recvWindow | LONG | NO | |
timestamp | LONG | YES |
Caution:
This request will disable fastwithdraw switch under your account.
You need to enable "trade" option for the api key which requests this endpoint.
#
Enable Fast Withdraw Switch (USER_DATA)Response:
POST /sapi/v1/account/enableFastWithdrawSwitch
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- This request will enable fastwithdraw switch under your account.
You need to enable "trade" option for the api key which requests this endpoint. - When Fast Withdraw Switch is on, transferring funds to a Binance account will be done instantly. There is no on-chain transaction, no transaction ID and no withdrawal fee.
#
Withdraw(USER_DATA)Response:
POST /sapi/v1/capital/withdraw/apply
Submit a withdraw request.
Weight(UID): 600
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
coin | STRING | YES | |
withdrawOrderId | STRING | NO | client id for withdraw |
network | STRING | NO | |
address | STRING | YES | |
addressTag | STRING | NO | Secondary address identifier for coins like XRP,XMR etc. |
amount | DECIMAL | YES | |
transactionFeeFlag | BOOLEAN | NO | When making internal transfer, true for returning the fee to the destination account; false for returning the fee back to the departure account. Default false . |
name | STRING | NO | Description of the address. Space in name should be encoded into %20 . |
walletType | INTEGER | NO | The wallet type for withdraw,0-spot wallet ,1-funding wallet. Default walletType is the current "selected wallet" under wallet->Fiat and Spot/Funding->Deposit |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- If
network
not send, return with default network of the coin. - You can get
network
andisDefault
innetworkList
of a coin in the response ofGet /sapi/v1/capital/config/getall
.
#
Deposit History (supporting network) (USER_DATA)Response:
GET /sapi/v1/capital/deposit/hisrec
Fetch deposit history.
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
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 | Default: 90 days from current timestamp |
endTime | LONG | NO | Default: present timestamp |
offset | INT | NO | Default:0 |
limit | INT | NO | Default:1000, Max:1000 |
recvWindow | LONG | NO | |
timestamp | LONG | YES | |
txId | STRING | NO |
- Please notice the default
startTime
andendTime
to make sure that time interval is within 0-90 days. - If both
startTime
andendTime
are sent, time betweenstartTime
andendTime
must be less than 90 days.
#
Withdraw History (supporting network) (USER_DATA)Response:
GET /sapi/v1/capital/withdraw/history
Fetch withdraw history.
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
coin | STRING | NO | |
withdrawOrderId | STRING | NO | |
status | INT | NO | 0(0:Email Sent,1:Cancelled 2:Awaiting Approval 3:Rejected 4:Processing 5:Failure 6:Completed) |
offset | INT | NO | |
limit | INT | NO | Default: 1000, Max: 1000 |
startTime | LONG | NO | Default: 90 days from current timestamp |
endTime | LONG | NO | Default: present timestamp |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
network
may not be in the response for old withdraw.- Please notice the default
startTime
andendTime
to make sure that time interval is within 0-90 days. - If both
startTime
andendTime
are sent, time betweenstartTime
andendTime
must be less than 90 days. - If
withdrawOrderId
is sent, time betweenstartTime
andendTime
must be less than 7 days. - If
withdrawOrderId
is sent,startTime
andendTime
are not sent, will return last 7 days records by default.
#
Deposit Address (supporting network) (USER_DATA)Response:
GET /sapi/v1/capital/deposit/address
Fetch deposit address with network.
Weight(IP): 10
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
coin | STRING | YES | |
network | STRING | NO | |
amount | DECIMAL | NO | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- If
network
is not send, return with default network of the coin. - You can get
network
andisDefault
innetworkList
in the response ofGet /sapi/v1/capital/config/getall (HMAC SHA256)
. amount
needs to be sent if using LIGHTNING network
#
Account Status (USER_DATA)Response:
GET /sapi/v1/account/status
Fetch account status detail.
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Account API Trading Status (USER_DATA)Response:
GET /sapi/v1/account/apiTradingStatus
Fetch account api trading status detail.
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
DustLog(USER_DATA)Response
GET /sapi/v1/asset/dribblet
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
startTime | LONG | NO | |
endTime | LONG | NO | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- Only return last 100 records
- Only return records after 2020/12/01
#
Get Assets That Can Be Converted Into BNB (USER_DATA)Response
POST /sapi/v1/asset/dust-btc
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Dust Transfer (USER_DATA)Response:
POST /sapi/v1/asset/dust
Convert dust assets to BNB.
Weight(UID): 10
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
asset | ARRAY | YES | The asset being converted. For example: asset=BTC,USDT |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- You need to open
Enable Spot & Margin Trading
permission for the API Key which requests this endpoint.
#
Asset Dividend Record (USER_DATA)Response:
GET /sapi/v1/asset/assetDividend
Query asset dividend record.
Weight(IP): 10
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
asset | STRING | NO | |
startTime | LONG | NO | |
endTime | LONG | NO | |
limit | INT | NO | Default 20, max 500 |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- There cannot be more than 180 days between parameter
startTime
andendTime
.
#
Asset Detail (USER_DATA)Response:
GET /sapi/v1/asset/assetDetail
Fetch details of assets supported on Binance.
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
asset | STRING | NO | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- Please get network and other deposit or withdraw details from
GET /sapi/v1/capital/config/getall
.
#
Trade Fee (USER_DATA)Response:
GET /sapi/v1/asset/tradeFee
Fetch trade fee
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | NO | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
User Universal Transfer (USER_DATA)Response:
POST /sapi/v1/asset/transfer
You need to enable Permits Universal Transfer
option for the API Key which requests this endpoint.
Weight(UID): 900
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
type | ENUM | YES | |
asset | STRING | YES | |
amount | DECIMAL | YES | |
fromSymbol | STRING | NO | |
toSymbol | STRING | NO | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
fromSymbol
must be sent when type are ISOLATEDMARGIN_MARGIN and ISOLATEDMARGIN_ISOLATEDMARGINtoSymbol
must be sent when type are MARGIN_ISOLATEDMARGIN and ISOLATEDMARGIN_ISOLATEDMARGINENUM of transfer types:
- MAIN_UMFUTURE Spot account transfer to USDⓈ-M Futures account
- MAIN_CMFUTURE Spot account transfer to COIN-M Futures account
- MAIN_MARGIN Spot account transfer to Margin(cross)account
- UMFUTURE_MAIN USDⓈ-M Futures account transfer to Spot account
- UMFUTURE_MARGIN USDⓈ-M Futures account transfer to Margin(cross)account
- CMFUTURE_MAIN COIN-M Futures account transfer to Spot account
- CMFUTURE_MARGIN COIN-M Futures account transfer to Margin(cross) account
- MARGIN_MAIN Margin(cross)account transfer to Spot account
- MARGIN_UMFUTURE Margin(cross)account transfer to USDⓈ-M Futures
- MARGIN_CMFUTURE Margin(cross)account transfer to COIN-M Futures
- ISOLATEDMARGIN_MARGIN Isolated margin account transfer to Margin(cross) account
- MARGIN_ISOLATEDMARGIN Margin(cross) account transfer to Isolated margin account
- ISOLATEDMARGIN_ISOLATEDMARGIN Isolated margin account transfer to Isolated margin account
- MAIN_FUNDING Spot account transfer to Funding account
- FUNDING_MAIN Funding account transfer to Spot account
- FUNDING_UMFUTURE Funding account transfer to UMFUTURE account
- UMFUTURE_FUNDING UMFUTURE account transfer to Funding account
- MARGIN_FUNDING MARGIN account transfer to Funding account
- FUNDING_MARGIN Funding account transfer to Margin account
- FUNDING_CMFUTURE Funding account transfer to CMFUTURE account
- CMFUTURE_FUNDING CMFUTURE account transfer to Funding account
- MAIN_OPTION Spot account transfer to Options account
- OPTION_MAIN Options account transfer to Spot account
- UMFUTURE_OPTION USDⓈ-M Futures account transfer to Options account
- OPTION_UMFUTURE Options account transfer to USDⓈ-M Futures account
- MARGIN_OPTION Margin(cross)account transfer to Options account
- OPTION_MARGIN Options account transfer to Margin(cross)account
- FUNDING_OPTION Funding account transfer to Options account
- OPTION_FUNDING Options account transfer to Funding account
- MAIN_PORTFOLIO_MARGIN Spot account transfer to Portfolio Margin account
- PORTFOLIO_MARGIN_MAIN Portfolio Margin account transfer to Spot account
- MAIN_ISOLATED_MARGIN Spot account transfer to Isolated margin account
- ISOLATED_MARGIN_MAIN Isolated margin account transfer to Spot account
#
Query User Universal Transfer History (USER_DATA)Response:
GET /sapi/v1/asset/transfer
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
type | ENUM | YES | |
startTime | LONG | NO | |
endTime | LONG | NO | |
current | INT | NO | Default 1 |
size | INT | NO | Default 10, Max 100 |
fromSymbol | STRING | NO | |
toSymbol | STRING | NO | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
fromSymbol
must be sent when type are ISOLATEDMARGIN_MARGIN and ISOLATEDMARGIN_ISOLATEDMARGINtoSymbol
must be sent when type are MARGIN_ISOLATEDMARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN- Support query within the last 6 months only
- If
startTime
andendTime
not sent, return records of the last 7 days by default
#
Funding Wallet (USER_DATA)Response
POST /sapi/v1/asset/get-funding-asset
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
asset | STRING | NO | |
needBtcValuation | STRING | NO | true or false |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- Currently supports querying the following business assets:Binance Pay, Binance Card, Binance Gift Card, Stock Token
#
User Asset (USER_DATA)Response
POST /sapi/v3/asset/getUserAsset
Get user assets, just for positive data.
Weight(IP): 5
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
asset | STRING | NO | If asset is blank, then query all positive assets user have. |
needBtcValuation | BOOLEAN | NO | Whether need btc valuation or not. |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- If asset is set, then return this asset, otherwise return all assets positive.
- If needBtcValuation is set, then return btcValudation.
#
BUSD Convert (TRADE)Response
POST /sapi/v1/asset/convert-transfer
Convert transfer, convert between BUSD and stablecoins.
Weight(UID): 5
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
clientTranId | STRING | YES | The unique user-defined transaction id, min length 20 |
asset | STRING | YES | The current asset |
amount | BigDecimal | YES | The amount must be positive number |
targetAsset | String | YES | Target asset you want to convert |
accountType | String | NO | Only MAIN and CARD , default MAIN |
- If the clientTranId has been used before, will not do the convert transfer, the original transfer will be returned.
#
BUSD Convert History (USER_DATA)Response
GET /sapi/v1/asset/convert-transfer/queryByPage
Weight(UID): 5
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
tranId | LONG | NO | The transaction id |
clientTranId | STRING | NO | The user-defined transaction id |
asset | STRING | NO | If it is blank, we will match deducted asset and target asset. |
startTime | LONG | YES | inclusive, unit: ms |
endTime | LONG | YES | exclusive, unit: ms |
accountType | STRING | NO | MAIN: main account. CARD: funding account. If it is blank, we will query spot and card wallet, otherwise, we just query the corresponding wallet |
current | INTEGER | NO | current page, default 1, the min value is 1 |
size | INTEGER | NO | page size, default 10, the max value is 100 |
- ENUM of types:
- 244 convert via sapi call
- 11 auto convert when deposit
- 32 auto convert when withdraw
- 34 in case withdraw failed
- 254 busd auto convert job
#
Get Cloud-Mining payment and refund history (USER_DATA)Response
GET /sapi/v1/asset/ledger-transfer/cloud-mining/queryByPage
The query of Cloud-Mining payment and refund history
Weight(UID): 600
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
tranId | LONG | NO | The transaction id |
clientTranId | STRING | NO | The unique flag |
asset | STRING | NO | If it is blank, we will query all assets |
startTime | LONG | YES | inclusive, unit: ms |
endTime | LONG | YES | exclusive, unit: ms |
current | INTEGER | NO | current page, default 1, the min value is 1 |
size | INTEGER | NO | page size, default 10, the max value is 100 |
- Just return the SUCCESS records of payment and refund.
- For response, type = 248 means payment, type = 249 means refund, status =S means SUCCESS.
#
Get API Key Permission (USER_DATA)Response
GET /sapi/v1/account/apiRestrictions
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Query auto-converting stable coins (USER_DATA)Response:
GET /sapi/v1/capital/contract/convertible-coins
Get a user's auto-conversion settings in deposit/withdrawal
Weight(UID): 600
Parameters: None
#
Switch on/off BUSD and stable coins conversion (USER_DATA)Response: Returns code 200 on success without body.
POST /sapi/v1/capital/contract/convertible-coins
User can use it to turn on or turn off the BUSD auto-conversion from/to a specific stable coin.
Weight(UID): 600
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
coin | STRING | YES | Must be USDC, USDP or TUSD |
enable | BOOLEAN | YES | true: turn on the auto-conversion. false: turn off the auto-conversion |
- Params need to be in the POST body
#
One click arrival deposit apply (for expired address deposit) (USER_DATA)Response:
POST /sapi/v1/capital/deposit/credit-apply
Apply deposit credit for expired address (One click arrival)
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
depositId | LONG | NO | Deposit record Id, priority use |
txId | STRING | NO | Deposit txId, used when depositId is not specified |
subAccountId | LONG | NO | Sub-accountId of Cloud user |
subUserId | LONG | NO | Sub-userId of parent user |
- Params need to be in the POST body
Sub-Account Endpoints
- The endpoints documented in this section are for Corporate Accounts.
- To become a corporate account, please refer to this document: Corporate Account Application
#
Create a Virtual Sub-account(For Master Account)Response:
POST /sapi/v1/sub-account/virtualSubAccount
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
subAccountString | STRING | YES | Please input a string. We will create a virtual email using that string for you to register |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- This request will generate a virtual sub account under your master account.
- You need to enable "trade" option for the API Key which requests this endpoint.
#
Query Sub-account List (For Master Account)Response:
GET /sapi/v1/sub-account/list
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | NO | Sub-account email | |
isFreeze | STRING | NO | true or false |
page | INT | NO | Default value: 1 |
limit | INT | NO | Default value: 1, Max value: 200 |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Query Sub-account Spot Asset Transfer History (For Master Account)Response:
GET /sapi/v1/sub-account/sub/transfer/history
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
fromEmail | STRING | NO | |
toEmail | STRING | NO | |
startTime | LONG | NO | |
endTime | LONG | NO | |
page | INT | NO | Default value: 1 |
limit | INT | NO | Default value: 500 |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- fromEmail and toEmail cannot be sent at the same time.
- Return fromEmail equal master account email by default.
#
Query Sub-account Futures Asset Transfer History (For Master Account)Response
GET /sapi/v1/sub-account/futures/internalTransfer
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | YES | Sub-account email | |
futuresType | LONG | YES | 1:USDT-margined Futures,2: Coin-margined Futures |
startTime | LONG | NO | Default return the history with in 100 days |
endTime | LONG | NO | Default return the history with in 100 days |
page | INT | NO | Default value: 1 |
limit | INT | NO | Default value: 50, Max value: 500 |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Sub-account Futures Asset Transfer (For Master Account)Response
POST /sapi/v1/sub-account/futures/internalTransfer
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
fromEmail | STRING | YES | Sender email |
toEmail | STRING | YES | Recipient email |
futuresType | LONG | YES | 1:USDT-margined Futures,2: Coin-margined Futures |
asset | STRING | YES | |
amount | DECIMAL | YES | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- Master account can transfer max 2000 times a minute
- There must be sufficient margin balance in futures wallet to execute transferring.
#
Query Sub-account Assets (For Master Account)Response:
GET /sapi/v3/sub-account/assets
Fetch sub-account assets
Weight(UID): 60
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | YES | Sub account email | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Query Sub-account Spot Assets Summary (For Master Account)Response:
Get BTC valued asset summary of subaccounts.
GET /sapi/v1/sub-account/spotSummary
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | NO | Sub account email | |
page | LONG | NO | default 1 |
size | LONG | NO | default 10, max 20 |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Get Sub-account Deposit Address (For Master Account)Response:
GET /sapi/v1/capital/deposit/subAddress
Fetch sub-account deposit address
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | YES | Sub account email | |
coin | STRING | YES | |
network | STRING | NO | |
amount | DECIMAL | NO | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
amount
needs to be sent if using LIGHTNING network
#
Get Sub-account Deposit History (For Master Account)Response:
GET /sapi/v1/capital/deposit/subHisrec
Fetch sub-account deposit history
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | YES | Sub account email | |
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 |
#
Get Sub-account's Status on Margin/Futures (For Master Account)Response
GET /sapi/v1/sub-account/status
Weight(IP): 10
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | NO | Sub-account email | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- If no email sent, all sub-accounts' information will be returned.
#
Enable Margin for Sub-account (For Master Account)Response
POST /sapi/v1/sub-account/margin/enable
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | YES | Sub-account email | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Get Detail on Sub-account's Margin Account (For Master Account)Response
GET /sapi/v1/sub-account/margin/account
Weight(IP): 10
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | YES | Sub-account email | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Get Summary of Sub-account's Margin Account (For Master Account)Response
GET /sapi/v1/sub-account/margin/accountSummary
Weight(IP): 10
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Enable Futures for Sub-account (For Master Account)Response
POST /sapi/v1/sub-account/futures/enable
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | YES | Sub-account email | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Get Detail on Sub-account's Futures Account (For Master Account)Response
GET /sapi/v1/sub-account/futures/account
Weight(IP): 10
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | YES | Sub-account email | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Get Summary of Sub-account's Futures Account (For Master Account)Response
GET /sapi/v1/sub-account/futures/accountSummary
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Get Futures Position-Risk of Sub-account (For Master Account)Response
GET /sapi/v1/sub-account/futures/positionRisk
Weight(IP): 10
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | YES | Sub-account email | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Futures Transfer for Sub-account (For Master Account)Response
POST /sapi/v1/sub-account/futures/transfer
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | YES | Sub-account email | |
asset | STRING | YES | The asset being transferred, e.g., USDT |
amount | DECIMAL | YES | The amount to be transferred |
type | INT | YES | 1: transfer from subaccount's spot account to its USDT-margined futures account 2: transfer from subaccount's USDT-margined futures account to its spot account 3: transfer from subaccount's spot account to its COIN-margined futures account 4:transfer from subaccount's COIN-margined futures account to its spot account |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.
#
Margin Transfer for Sub-account (For Master Account)Response
POST /sapi/v1/sub-account/margin/transfer
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | YES | Sub-account email | |
asset | STRING | YES | The asset being transferred, e.g., BTC |
amount | DECIMAL | YES | The amount to be transferred |
type | INT | YES | 1: transfer from subaccount's spot account to margin account 2: transfer from subaccount's margin account to its spot account |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.
#
Transfer to Sub-account of Same Master (For Sub-account)Response
POST /sapi/v1/sub-account/transfer/subToSub
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
toEmail | STRING | YES | Sub-account email |
asset | STRING | YES | |
amount | DECIMAL | YES | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.
#
Transfer to Master (For Sub-account)Response
POST /sapi/v1/sub-account/transfer/subToMaster
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
asset | STRING | YES | |
amount | DECIMAL | YES | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.
#
Sub-account Transfer History (For Sub-account)Response
GET /sapi/v1/sub-account/transfer/subUserHistory
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
asset | STRING | NO | If not sent, result of all assets will be returned |
type | INT | NO | 1: transfer in, 2: transfer out |
startTime | LONG | NO | |
endTime | LONG | NO | |
limit | INT | NO | Default 500 |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- If type is not sent, the records of type 2: transfer out will be returned by default.
- If startTime and endTime are not sent, the recent 30-day data will be returned.
#
Universal Transfer (For Master Account)Response
POST /sapi/v1/sub-account/universalTransfer
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
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 | Must be unique |
symbol | STRING | NO | Only supported under ISOLATED_MARGIN type |
asset | STRING | YES | |
amount | DECIMAL | YES | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- You need to enable "internal transfer" option for the api key which requests this endpoint.
- Transfer from master account by default if fromEmail is not sent.
- Transfer to master account by default if toEmail is not sent.
- At least either fromEmail or toEmail need to be sent when the fromAccountType and the toAccountType are the same.
- Supported transfer scenarios:
SPOT
transfer toSPOT
,USDT_FUTURE
,COIN_FUTURE
(regardless of master or sub)SPOT
,USDT_FUTURE
,COIN_FUTURE
transfer toSPOT
(regardless of master or sub)- Master account
SPOT
transfer to sub-accountMARGIN(Cross)
,ISOLATED_MARGIN
- Sub-account
MARGIN(Cross)
,ISOLATED_MARGIN
transfer to master accountSPOT
- Sub-account
MARGIN(Cross)
transfer to Sub-accountMARGIN(Cross)
#
Query Universal Transfer History (For Master Account)Response
GET /sapi/v1/sub-account/universalTransfer
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
fromEmail | STRING | NO | |
toEmail | STRING | NO | |
clientTranId | STRING | NO | |
startTime | LONG | NO | |
endTime | LONG | NO | |
page | INT | NO | Default 1 |
limit | INT | NO | Default 500, Max 500 |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- fromEmail and toEmail cannot be sent at the same time.
- Return fromEmail equal master account email by default.
- The query time period must be less then 30 days.
- If startTime and endTime not sent, return records of the last 30 days by default.
#
Get Detail on Sub-account's Futures Account V2 (For Master Account)Response
USDT Margined Futures:
COIN Margined Futures:
GET /sapi/v2/sub-account/futures/account
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | YES | Sub-account email | |
futuresType | INT | YES | 1:USDT Margined Futures, 2:COIN Margined Futures |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Get Summary of Sub-account's Futures Account V2 (For Master Account)Response
USDT Margined Futures:
COIN Margined Futures:
GET /sapi/v2/sub-account/futures/accountSummary
Weight(IP): 10
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
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 |
#
Get Futures Position-Risk of Sub-account V2 (For Master Account)Response
USDT Margined Futures:
COIN Margined Futures:
GET /sapi/v2/sub-account/futures/positionRisk
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | YES | Sub-account email | |
futuresType | INT | YES | 1:USDT Margined Futures, 2:COIN Margined Futures |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Enable Leverage Token for Sub-account (For Master Account)Response
POST /sapi/v1/sub-account/blvt/enable
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | YES | Sub-account email | |
enableBlvt | BOOLEAN | YES | Only true for now |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Get IP Restriction for a Sub-account API Key (For Master Account)Response:
GET /sapi/v1/sub-account/subAccountApi/ipRestriction
Weight(UID): 3000
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | YES | Sub-account email | |
subAccountApiKey | STRING | YES | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Delete IP List For a Sub-account API Key (For Master Account)Response:
DELETE /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList
Weight(UID): 3000
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | YES | Sub-account email | |
subAccountApiKey | STRING | YES | |
ipAddress | STRING | NO | Can be added in batches, separated by commas |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- You need to enable Enable Spot & Margin Trading option for the api key which requests this endpoint
#
Add IP Restriction for Sub-Account API key (For Master Account)Response:
POST /sapi/v2/sub-account/subAccountApi/ipRestriction
Weight(UID): 3000
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | YES | Sub-account email | |
subAccountApiKey | STRING | YES | |
status | STRING | YES | IP Restriction status. 1 = IP Unrestricted. 2 = Restrict access to trusted IPs only. |
ipAddress | STRING | NO | Insert static IP in batch, separated by commas. |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- You need to enable Enable Spot & Margin Trading option for the api key which requests this endpoint
#
Deposit Assets Into The Managed Sub-account(For Investor Master Account)Response
POST /sapi/v1/managed-subaccount/deposit
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
toEmail | STRING | YES | |
asset | STRING | YES | |
amount | DECIMAL | YES | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- You need to enable
Enable Spot & Margin Trading
option for the api key which requests this endpoint
#
Query Managed Sub-account Asset Details(For Investor Master Account)Response
GET /sapi/v1/managed-subaccount/asset
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | YES | ||
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Withdrawl Assets From The Managed Sub-account(For Investor Master Account)Response
POST /sapi/v1/managed-subaccount/withdraw
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
fromEmail | STRING | YES | |
asset | STRING | YES | |
amount | DECIMAL | YES | |
transferDate | LONG | NO | Withdrawals is automatically occur on the transfer date(UTC0). If a date is not selected, the withdrawal occurs right now |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- You need to enable
Enable Spot & Margin Trading
option for the api key which requests this endpoint
#
Query Managed Sub-account Snapshot(For Investor Master Account)Response:
OR
OR
GET /sapi/v1/managed-subaccount/accountSnapshot
Weight(IP): 2400
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | YES | ||
type | STRING | YES | "SPOT", "MARGIN"(cross), "FUTURES"(UM) |
startTime | LONG | NO | |
endTime | LONG | NO | |
limit | INT | NO | min 7, max 30, default 7 |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- The query time period must be less then 30 days
- Support query within the last one month only
- If startTimeand endTime not sent, return records of the last 7 days by default
#
Query Managed Sub Account Transfer Log (For Investor Master Account) (USER_DATA)Response
GET /sapi/v1/managed-subaccount/queryTransLogForInvestor
Investor can use this api to query managed sub account transfer log. This endpoint is available for investor of Managed Sub-Account. A Managed Sub-Account is an account type for investors who value flexibility in asset allocation and account application, while delegating trades to a professional trading team. Please refer to link
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | YES | Managed Sub Account Email | |
startTime | LONG | YES | Start Time |
endTime | LONG | YES | End Time (The start time and end time interval cannot exceed half a year) |
page | INT | YES | Page |
limit | INT | YES | Limit (Max: 500) |
transfers | STRING | NO | Transfer Direction (FROM/TO) |
transferFunctionAccountType | STRING | NO | Transfer function account type (SPOT/MARGIN/ISOLATED_MARGIN/USDT_FUTURE/COIN_FUTURE) |
#
Query Managed Sub Account Transfer Log (For Trading Team Master Account) (USER_DATA)Response
GET /sapi/v1/managed-subaccount/queryTransLogForTradeParent
Trading team can use this api to query managed sub account transfer log. This endpoint is available for trading team of Managed Sub-Account. A Managed Sub-Account is an account type for investors who value flexibility in asset allocation and account application, while delegating trades to a professional trading team. Please refer to link
Weight(UID): 60
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | YES | Managed Sub Account Email | |
startTime | LONG | YES | Start Time |
endTime | LONG | YES | End Time (The start time and end time interval cannot exceed half a year) |
page | INT | YES | Page |
limit | INT | YES | Limit (Max: 500) |
transfers | STRING | NO | Transfer Direction (FROM/TO) |
transferFunctionAccountType | STRING | NO | Transfer function account type (SPOT/MARGIN/ISOLATED_MARGIN/USDT_FUTURE/COIN_FUTURE) |
#
Query Managed Sub-account Futures Asset Details(For Investor Master Account)(USER_DATA)Response
GET /sapi/v1/managed-subaccount/fetch-future-asset
Investor can use this api to query managed sub account futures asset details
Weight(UID): 60
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | YES | Managed Sub Account Email |
#
Query Managed Sub-account Margin Asset Details (For Investor Master Account) (USER_DATA)Response
GET /sapi/v1/managed-subaccount/marginAsset
Investor can use this api to query managed sub account margin asset details
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | YES | Managed Sub Account Email |
#
Query Sub-account Assets (For Master Account)(USER_DATA)Response
GET /sapi/v4/sub-account/assets
Fetch sub-account assets
Weight(UID): 60
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | YES | Managed Sub Account Email | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Query Managed Sub-account List (For Investor)(USER_DATA)Response
GET /sapi/v1/managed-subaccount/info
Get investor's managed sub-account list.
Weight(UID): 60
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | NO | Managed sub-account email | |
page | INT | NO | Default value: 1 |
limit | INT | NO | Default value: 20, Max value: 20 |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Query Sub-account Transaction Statistics (For Master Account) (USER_DATA)Response example:
OR
GET /sapi/v1/sub-account/transaction-statistics
Query Sub-account Transaction statistics (For Master Account).
Weight(UID): 60
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | YES | Sub user email | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Get Managed Sub-account Deposit Address (For Investor Master Account) (USER_DATA)Response:
GET /sapi/v1/managed-subaccount/deposit/address
Get investor's managed sub-account deposit address.
Weight(UID): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | YES | Sub user email | |
coin | STRING | YES | |
network | STRING | NO | networks can be found in GET /sapi/v1/capital/deposit/address |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- If
network
is not send, return with defaultnetwork
of thecoin
.
#
Enable Options for Sub-account (For Master Account)(USER_DATA)Response:
POST /sapi/v1/sub-account/eoptions/enable
Enable Options for Sub-account (For Master Account).
Weight(IP): 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
STRING | YES | Sub user email | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Query Managed Sub Account Transfer Log (For Trading Team Sub Account)(USER_DATA)Response:
GET /sapi/v1/managed-subaccount/query-trans-log
Query Managed Sub Account Transfer Log (For Trading Team Sub Account)
Weight(UID): 60
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
startTime | LONG | YES | Start Time |
endTime | LONG | YES | End Time (The start time and end time interval cannot exceed half a year) |
page | INT | YES | Page |
limit | INT | YES | Limit (Max: 500) |
transfers | STRING | NO | Transfer Direction (FROM/TO) |
transferFunctionAccountType | STRING | NO | Transfer function account type (SPOT/MARGIN/ISOLATED_MARGIN/USDT_FUTURE/COIN_FUTURE) |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
Market Data Endpoints
#
Test ConnectivityResponse:
GET /api/v3/ping
Test connectivity to the Rest API.
Weight(IP): 1
Parameters:
NONE
Data Source: Memory
#
Check Server TimeResponse:
GET /api/v3/time
Test connectivity to the Rest API and get the current server time.
Weight(IP): 1
Parameters:
NONE
Data Source: Memory
#
Exchange InformationResponse:
GET /api/v3/exchangeInfo
Current exchange trading rules and symbol information
Weight(IP): 20
Parameters:
There are 4 possible options:
Options | Example |
---|---|
No parameter | curl -X GET "https://api.binance.com/api/v3/exchangeInfo" |
symbol | curl -X GET "https://api.binance.com/api/v3/exchangeInfo?symbol=BNBBTC" |
symbols | curl -X GET "https://api.binance.com/api/v3/exchangeInfo?symbols=%5B%22BNBBTC%22,%22BTCUSDT%22%5D" or curl -g -X GET 'https://api.binance.com/api/v3/exchangeInfo?symbols=["BTCUSDT","BNBBTC"]' |
permissions | 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"]' |
Notes:
- If the value provided to
symbol
orsymbols
do not exist, the endpoint will throw an error saying the symbol is invalid. - All parameters are optional.
permissions
can support single or multiple values (e.g.SPOT
,["MARGIN","LEVERAGED"]
)- If
permissions
parameter not provided, the default values will be["SPOT","MARGIN","LEVERAGED"]
.- If one wants to view all symbols on
GET /api/v3/exchangeInfo
, then one has to search with all permissions explicitly specified (i.e.permissions=["SPOT","MARGIN","LEVERAGED","TRD_GRP_002","TRD_GRP_003","TRD_GRP_004","TRD_GRP_005","TRD_GRP_006","TRD_GRP_007","TRD_GRP_008","TRD_GRP_009","TRD_GRP_010","TRD_GRP_011","TRD_GRP_012","TRD_GRP_013"]
)
- If one wants to view all symbols on
Data Source: Memory
#
Order BookResponse:
GET /api/v3/depth
Weight(IP):
Adjusted based on the limit:
Limit | Weight |
---|---|
1-100 | 2 |
101-500 | 10 |
501-1000 | 20 |
1001-5000 | 100 |
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
limit | INT | NO | Default 100; max 5000. If limit > 5000, then the response will truncate to 5000. |
Data Source: Memory
#
Recent Trades ListResponse:
GET /api/v3/trades
Get recent trades.
Weight(IP): 2
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
limit | INT | NO | Default 500; max 1000. |
Data Source: Memory
#
Old Trade LookupResponse:
GET /api/v3/historicalTrades
Get older market trades.
Weight(IP): 10
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
limit | INT | NO | Default 500; max 1000. |
fromId | LONG | NO | Trade id to fetch from. Default gets most recent trades. |
Data Source: Database
#
Compressed/Aggregate Trades ListResponse:
GET /api/v3/aggTrades
Get compressed, aggregate trades. Trades that fill at the time, from the same order, with the same price will have the quantity aggregated.
Weight(IP): 2
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
fromId | LONG | NO | id to get aggregate trades from INCLUSIVE. |
startTime | LONG | NO | Timestamp in ms to get aggregate trades from INCLUSIVE. |
endTime | LONG | NO | Timestamp in ms to get aggregate trades until INCLUSIVE. |
limit | INT | NO | Default 500; max 1000. |
- If fromId, startTime, and endTime are not sent, the most recent aggregate trades will be returned.
- Note that if a trade has the following values, this was a duplicate aggregate trade and marked as invalid:
- p = '0' // price
- q = '0' // qty
- f = -1 // first_trade_id
- l = -1 // last_trade_id
Data Source: Database
#
Kline/Candlestick DataResponse:
GET /api/v3/klines
Kline/candlestick bars for a symbol.
Klines are uniquely identified by their open time.
Weight(IP): 2
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
interval | ENUM | YES | |
startTime | LONG | NO | |
endTime | LONG | NO | |
limit | INT | NO | Default 500; max 1000. |
- If startTime and endTime are not sent, the most recent klines are returned.
Data Source: Database
#
UIKlinesResponse: