DECLARATION by SECURITIES AND EXCHANGE COMMISSION re [8] MOTION for Leave to File Excess Pages filed by SECURITIES AND EXCHANGE COMMISSION. (Attachments: # (1) Exhibit A-23.3, # (2) Exhibit A-24)(Scarlato, Matthew)
Page 1 EXHIBIT A-23Page 2Page 3 Search items, collections, creators, and collectors
Exclusives
Browse
Create
Connect Wallet
Exclusives
Browse
Create
Connect Wallet
Express Bus on Tower Bridge
Hi everyone,
0.
I
New day
Owner
PanBalaga...
PanBalaga...
Creator
janvaleck...
BNB
is a
Owner
janvaleck...
TakamasaN...
TakamasaN...
Mind Chaos #
Shanghai
Torii Gate
II
Creator
FrancisAn...
0.
BNB
New Ukiyo-e Wind
detective
rocks.
Owner
FrancisAn...
BNB
Blue thoughts
project designed to preserve andFirst
enhance
animated
the blockchain
piece of theecosystem.
"MindCrypto
Chaos"
Brain蟷螂子
willseries,
come
(Kamakiriko)
limited
as a collection
to Japan
5 pieces.
inIllustrator
theBuyer
following
will
/ Graphic
getprocesses
a high-resolution
Designer
What and
better
A is work
currently
way
video
that
to relax
file,
combines
on sale.
asthan
well bringing
ukiyo-e
as a veryand
back
high-quality
digital
those
Owner
Creator
Owner
NRL
NRL
mazormedi...
mazormedi...
0.
Robot neon cats
illusion forte
kinda the part two of the other painting
Creator
Unidoodle...
I
Creator
JapaneseG...
BNB
made
le illusion
calledforte
"Neon cat
girl
and her companion".
This abstract
These
painting
are some
is available
robo-cats,
as analsoanimation
part of The
that
andDogecoin
universe.
as a physical
burn painting
it's an original
with this
tattoo
purchase.
design
Creator
Owner
Creator
Owner
Unidoodle...
na_seo_il
na_seo_il
Ezoe
Ezoe
BNB
BNB
Escape from the sunlight
Charcoal on paper Dimensions 228mm X 300mm Warm sunlight
Creator
Owner
DarlingOm...
DarlingOm...
Orblus
Creator
menasauri...
0.
BNB
Mega Asset
the palm of her hand.
Creator
0.
BNB
in
BNB
Wondering Eyes - Animated Painting
The Dogecoin burn tattoo concept
Owner
Sunflower
0.
Creator
BNB
Unlisted
0.
in
Owner
Creator
is
sunrise
i
Crypto Brain
This
at
am Pan Balagan and am an artist photographer
This photo wasand
taken
I would
in Dolomites
like to share
after with
a tough
you night
one
Thisofseries
with
my heavy
favorite
of works
rain
photos
was
and born
thunder.
as NFTfrom the artist's fantasy
This isof called
what would
Meoto happen
Iwa, translated
if a world-famous
as wedded
Creator
Crypto Brain
COU and NAN
This
made
Owner
menasauri...
BNB
darkwater
Inspired by colourful memories from the 80s, anime,
A large
my freshwater
childhood, fish
retroand
wavelotusandleaves,
the dusty
an Asian
familiar
Owner
Creator
Owner
Orblus
randis
randis
BNB
【Hokusai】"Kanagawa Okinami Viking
Ura" Pug
Creator
Noriko_ki...
16.
BNB
Unicorn - The Third Eye
Owner
Noriko_ki...
BNB
Rise Again 1/
Among the works of Katsushika Hokusai, the mostGotwell-known
inspired byin Hethe Man
worldto create,
is "Kanagawa
a weird Pug warrior!
Okinami
Think Hope
ofUra",
magical
you guys
things,
which
like isand
it! a 36-view
magical view
thingsof will
Mt. happen!✨
Fuji.
Re Source
I scanned
With
\ Rise
this
myAgain
ukiyo-e,
thirdResource
eye,which
I absorb
(n.)
is said
past
everything
toparticiple
be close
5.
Creator
Owner
JapaneseU...
JapaneseU...
BNB
Colors Falling
The art of
smiling
Creator
Ronaldwoo...
0.
Owner
Creator
Owner
Creator
Owner
Ronaldwoo...
DSienaDig...
DSienaDig...
Mikepinet...
Mikepinet...
0.
BNB
items
items
Engine City
Postcards from
different plane
LOST BETWEEN
SCI FI AND
REALITY
The World We
Made
BSC Rocks
Formula E: High
Voltage
3.
BNB
items
a
items
BNB
≥ 150000 BTC
and
≥ 11000 BNB
0.0200%
/
0.0400%
0.0150%
/
0.0300%
is
an order that trades at
a
market price, “Maker”
is
an order that trades at
a
P2P
Taker BNB 25% off
2020-05-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 the STOP_LOSS (or STOP_LOSS_LIMIT ) order is triggered;
once this happens the other order is canceled and will no longer
count as an open order.
2020-04-SPOT API
New
field permissions
Defines the trading permissions that are allowed on accounts and
symbols.
permissions is an enum array; values:
SPOT
MARGIN
replace
permissions will
on
ngAllowed
and isMarginTradi
future API versions
isSpotTradingAllowed
GET api/v3/exchangeInfo in
(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 the quotePre
cision field. quotePrecision will be removed in future API
versions (v4+).
Updates to GET api/v3/account
New field permissions added.
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 or HALT
status.
USER DATA STREAM
has new
the account.
permissions
of
which shows the trading
field P
OutboundAccountInfo
2020-04-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.
2020-04-New fields
sition :
response
in
endpoint
to
GET /sapi/v1/lending/daily/token/po
user's purchased amount today
customized fixed projects:
todayPurchasedAmount for
New lending endpoints
for
GET /sapi/v1/lending/project/list
POST /sapi/v1/lending/customizedFixed/purchase
GET /sapi/v1/lending/project/position/list
2020-04-New fields
l :
response
in
endpoint
to
GET /sapi/v1/capital/config/getal
min number for balance confirmation
for confirmation number for balance unlock
minConfirm for
unLockConfirm
2020-03-added.
MAX_POSITION filter
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-New parameter
available in endpoint:
/sapi/v1/capital/withdraw/apply and
POST
transactionFeeFlag
is
POST /wapi/v3/withdraw.html
2020-02-New sub account endpoints:
POST /sapi/v1/sub-account/futures/transfer
futures and spot accout
sub-account.
of
POST /sapi/v1/sub-account/margin/transfer
margin and spot accout
transfer between
to
transfer between
to
sub-account.
of
POST /sapi/v1/sub-account/transfer/subToSub
transfer
to
to
another account by sub-account.
POST /sapi/v1/sub-account/transfer/subToMaster
transfer
to
to
same master by sub-account.
get
GET /sapi/v1/sub-account/transfer/subUserHistory to
transfer history
sub-account.
of
2020-01-New parameter
endpoint POST
New
client customized withdraw
for
withdrawOrderId
/wapi/v3/withdraw.html
.
response
field withdrawOrderId in
id for
to GET /wapi/v3/withdrawHistor
y.html
2019-12-New endpoints
Binance Savings:
for
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
,
,
and
GET /sapi/v1/capital/deposit/hisrec
GET /wapi/v3/depositHistory.html
:
The default startTime is 90 days from current time, and the
default endTime is current time.
Please notice the default startTime and endTime to make sure
that time interval is within 0-90 days.
If both startTime and endTime are sent, time between startTime
and endTime must be less than 90 days.
2019-12-New endpoint
get daily snapshot
to
account:
of
GET /sapi/v1/accountSnapshot
2019-11-Added parameter sideEffectType
SHA256) with enums:
in POST /sapi/v1/margin/order
normal trade order;
MARGIN_BUY for margin trade order;
AUTO_REPAY for making auto repayment after order filled.
New field marginBuyBorrowAmount and marginBuyBorrowAsset in
response to POST /sapi/v1/margin/order (HMAC SHA256)
(HMAC
NO_SIDE_EFFECT for
FULL
2019-11-New SAPI endpont
disable fast withdraw switch:
to
POST /sapi/v1/account/disableFastWithdrawSwitch
New SAPI endpont
(HMAC SHA256)
enable fast withdraw switch:
to
POST /sapi/v1/account/enableFastWithdrawSwitch
(HMAC SHA256)
2019-11-Quote Order Qty Market orders have been enabled on all symbols.
Quote Order Qty MARKET orders allow a user to specify the total qu
oteOrderQty spent or received in the MARKET order.
Quote Order Qty MARKET orders will not break LOT_SIZE filter
rules; the order will execute a quantity that will have the notional
value as close as possible to quoteOrderQty
Using BNBBTC as an example:
On the BUY side, the order will buy as many BNB as quoteOr
derQty BTC can.
On the SELL side, the order will sell as much BNB as needed
to receive quoteOrderQty BTC.
.
2019-11-has new
GET /sapi/v1/sub-account/margin/account
field: marginTradeCoe
which contains
ffVo
liquidation margin ratio
for margin call margin ratio
initial margin ratio
forceLiquidationBar for
marginCallBar
normalBar for
2019-11-Rest API
api/v3/exchangeInfo has new
fields:
quoteOrderQtyMarketAllowed
baseCommissionPrecision
quoteCommissionPrecision
orders have a new optional field: quoteOrderQty used to specify
the quote quantity to BUY or SELL. This cannot be used in combination
with quantity
The exact timing that quoteOrderQty MARKET orders will be
enabled is TBD. There will be a separate announcement and
further details at that time.
All order query endpoints will return a new field origQuoteOrderQty in
the JSON payload. (e.g. GET api/v3/allOrders)
MARKET
.
Updated error messages
Sending an
-
for
{
with a stopLimitPrice but without a stopLimitTi
meInForce will return the error:
Updated error messages for -1003 to specify the limit is referring to the
request weight, not to the number of requests.
OCO
Deprecation of v1 endpoints
"code" : -1128 ,
"msg" : "Combination of optional parameters invalid. Recommendation:
'stopLimitTimeInForce'
}
:
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
USER DATA STREAM
Changes
event
to executionReport
the
If
C field
"null"
New
empty,
is
now properly return
will
it
null
instead
,
of
.
Q which represents the
event type added
field
balanceUpdate
quoteOrderQty
.
This event occurs when funds are deposited or withdrawn from
your account.
WEB SOCKET STREAM
WSS now supports
subscribing/unsubscribing
live
streams.
to
2019-11-New sapi
subaccount management on margin and futures:
for
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-New sapi endpoints
subaccount wallet.
for
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-New sapi endpoints
wallet.
for
POST /sapi/v1/capital/withdraw/apply
(HMAC SHA256)
withdraw.
fetch
:
Get /sapi/v1/capital/withdraw/history (HMAC SHA256)
:
withdraw history with network.
2019-10-New sapi endpoints
wallet.
for
GET /sapi/v1/capital/config/getall
information
(HMAC SHA256)
get
:
coins'
all
user.
for
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-Added parameter network in POST /wapi/v3/withdraw.html so that asset
can be withdrawed with specific network.
2019-09-New WebSocket streams
and !bookTicker
bookTickers added:
for @bookTicker
.
2019-09-Faster order book data with 100ms updates:
and @depth@100ms
<
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-GET api/v1/depth
10000 has been temporarily removed
limit of
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:
In
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-Rest API
New order type: OCO ("One Cancels the Other")
An OCO has
orders: (also known as legs in financial terms)
STOP_LOSS or STOP_LOSS_LIMIT leg
LIMIT_MAKER leg
Price Restrictions:
SELL Orders
Limit Price > Last Price > Stop Price
BUY 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 or STOP_L
OSS_LIMIT will trigger, the Limit Maker leg will be cancelled
BEFORE executing the STOP_LOSS Leg.
Cancelling an OCO
Cancelling either order leg will cancel the entire OCO.
The entire OCO can be canceled via the orderListId or the
:
:
.
listClientOrderId
New Enums
.
OCO:
for
ListStatusType
used when ListStatus is responding to
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.
RESPONSE
a
-
ListOrderStatus
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)
EXECUTING
-
ContingencyType
OCO
specifies the type
-
order
of
list.
New Endpoints:
POST api/v3/order/oco
DELETE api/v3/orderList
GET api/v3/orderList
recvWindow cannot exceed 60000.
New
values
intervalLetter
headers:
for
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 a X-MBX-USED-WEIGHT-1M header in the
response. The legacy header X-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
have X-MBX-ORDER-COUNT-** headers in the response.
Eg.
to
"orders per 1 second" and X-MBX-ORD
ER-COUNT-1D for orders per "one day"
GET api/v1/depth now supports limit 5000 and 10000; weights are and 100 respectively.
X-MBX-ORDER-COUNT-1S for
GET api/v1/exchangeInfo has
new parameter
a
ocoAllowed
.
USER DATA STREAM
event now contains "g" which has the orderListId 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).
executionReport
;
;
;
NEW ERRORS
-1131 BAD_RECV_WINDOW
recvWindow must be less than -1099 Not found, authenticated, or authorized
This replaces error code -
NEW -2011 ERRORS
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-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 -status isn't TRADING
if the symbol's
api/v1/depth no longer has the ignored and empty []
api/v3/myTrades now returns quoteQty the price * qty of for the trade.
.
.
;
Websocket streams
and @depthX streams no longer have the
ignored and empty [] @depth
.
System improvements
Matching Engine stability/reliability improvements.
Rest API performance improvements.
2018-11-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) and avgPriceMins (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, with i
nterval minute, means "every 5 minutes".
,
Explanation
.
the average price calculation:
for
(qty * price)
minutes.
,
trades
of all
numTrades
/
the trades over previous
of
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 the MIN_NOTIONAL filter, market orders cannot be placed until there is
at least 1 trade.
If
The current average price can be checked here: https://api.binance.co
m/api/v3/avgPrice?symbol= For example:
https://api.binance.com/api/v3/avgPrice?symbol=BNBUSDT
User data stream
variable
Last quote asset transacted quantity (as
execution reports. Represents the
lastPrice
Y
added
)
lastQty
*
L
(
to
l
*
).
2018-07-Rest API
New
filter: ICEBERG_PARTS
new defaults for newOrderRespType
and LIMIT order types default to FULL
POST api/v3/order
FULL
MARKET
;
default to ACK
POST api/v3/order
ACK
.
or
,
other orders
all
,
RESULT
,
.
and
RESULT
responses now have
FULL
cummulativeQu
oteQty
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 If cummulat
iveQuoteQty is < 0, it means the data isn't available for this order at this
time.
REQUESTS rate limit type changed to REQUEST_WEIGHT This limit was
always logically request weight and the previous name for it caused
confusion.
.
.
User data stream
added to order responses and execution
reports (as variable ). Represents the cummulative amount of the quot
e that has been spent (with a BUY order) or received (with a SELL order).
Historical orders will have a value < 0 in this field indicating the data is
not available at this time. cummulativeQuoteQty divided by cummulativeQt
y will give the average price for an order.
O (order creation time) added to execution reports
cummulativeQuoteQty field
Z
2018-01-GET /api/v1/historicalTrades weight decreased to GET /api/v1/aggTrades weight decreased to GET /api/v1/klines weight decreased to GET /api/v1/ticker/24hr all symbols weight decreased to number
trading symbols / GET /api/v3/allOrders weight decreased to GET /api/v3/myTrades weight decreased to GET /api/v3/account weight decreased to GET /api/v1/depth limit=500 weight decreased to GET /api/v1/depth limit=1000 weight decreased to -1003 error message updated to direct users to websockets
of
2018-01-GET /api/v1/ticker/24hr single symbol weight decreased to GET /api/v3/openOrders all symbols weight decreased to number
trading symbols / GET /api/v3/allOrders weight decreased to GET /api/v3/myTrades weight decreased to GET /api/v3/order weight decreased to myTrades will now return both sides of a self-trade/wash-trade
of
2018-01-GET
GET
GET
GET
GET
GET
GET
/api/v1/aggTrades weight changed to /api/v1/klines weight changed to /api/v3/order weight changed to /api/v3/allOrders weight changed to /api/v3/account weight changed to /api/v3/myTrades weight changed to /api/v3/historicalTrades weight changed
to
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.
the API keys were accidentally shared, please delete them
immediately and create a new key.
If
API Key Restrictions
After creating the API key, the default restrictions set will be to enable
trade, allowing to make orders on the API.
To enable withdrawals via the API the API key restriction needs to be
modified through the Binance UI.
,
Enabling Accounts
Spot Account
A
account
SPOT
provided by default upon creation
is
Binance Account.
of a
Margin Account
To enable a MARGIN account
Trading Guide
Margin Trading, please refer
for
the Margin
to
Spot Testnet
Users can use the SPOT Testnet
Currently, this
practice
via
the API.
only available
to
is
Please refer to the SPOT Testnet page
up the Testnet API key.
trading.
SPOT
more information and how
for
set
to
API Library
Python connector
This is a lightweight library that works as
written in Python.
connector
a
Binance public API,
to
https://github.com/binance/binance-connector-python
Node.js connector
This is a lightweight library that works as
written for Node.js users.
connector
a
Binance public API,
to
https://github.com/binance/binance-connector-node
Postman Collections
There is now a Postman collection containing the API endpoints
and easy use.
This is recommended
the API.
new users who want
for
For more information please refer
get
to
quick
for
quick-start into using
a
page: Binance API Postman
to this
Swagger
A YAML file with OpenAPI specification on the RESTful API
used, as well as a Swagger UI page for the consulting.
available
is
be
to
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 base endpoint is: https://api.binance.com
If there are performance issues with the endpoint above, these API
clusters are also available:
https://api1.binance.com
https://api2.binance.com
https://api3.binance.com
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
.
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 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 receiving 429 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
there
reason.
an error, the API
is
If
return an error with
will
Specific error codes and messages defined
message
a
Error Codes
in
the
of
.
The error payload on API and SAPI
as follows:
is
General Information on Endpoints
{
For
For
endpoints, parameters must be sent as a query string
POST PUT and DELETE endpoints, the parameters may be sent as a
query string or in the request body with content type application/x-w
ww-form-urlencoded You may mix parameters between both the query st
ring and request body if you wish to do so.
Parameters may be sent in any order.
If a parameter sent in both the query string and request body
the quer
y string parameter will be used.
GET
"code" : - 1121 ,
"msg" : "Invalid symbol."
.
,
,
}
.
,
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, interval
Num 5 with intervalLetter M means "Every 5 minutes".
The /api/v3/exchangeInfo rateLimits array contains objects related to
the exchange's RAW_REQUESTS REQUEST_WEIGHT and ORDERS rate limits.
These are further defined in the ENUM definitions section under Rate li
,
miters (rateLimitType)
A
,
.
be returned when either rate
will
limit
violated.
is
Limits
IP
Every request will contain X-MBX-USED-WEIGHT-(intervalNum)(intervalLett
er) 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 heavier weight
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 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.
.
.
We recommend using the websocket for getting data as much as
possible, as this will not count to the request rate limit.
Order Rate Limits
Every successful order response will contain a X-MBX-ORDER-COUNT-(interv
alNum)(intervalLetter) header which has the current order count for the
account for all order rate limiters defined.
Rejected/unsuccessful orders are not guaranteed to have X-MBX-ORDER-CO
UNT-** headers in the response.
The order rate limit is counted against each account
.
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.
/api/ and /sapi/ Limit Introduction
The /api/* and /sapi/* endpoints adopt either
rules, IP limits or UID (account) limits.
Endpoints related
to /api/*
two access limiting
of
:
According to the two modes of IP and UID (account) limit, each are
independent.
Endpoints share the 1200 per minute limit based on IP, excluding
the new order endpoint POST /api/v3/order which has specific
limits of 50 per 10 seconds and 160000 per day based on UID.
Responses contain the header X-MBX-USED-WEIGHT-(intervalNum)(i
ntervalLetter) 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 12,000 per minute
limit.
Each endpoint with UID limits has an independent 180,000 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-SA
PI-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
Some endpoints can have more than 1 data source. (e.g. Memory
=> Database)
This means that the endpoint will check the first Data Source, and if it
cannot find the value it's looking for it will check the next one.
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
signature.
a
valid API-Key and
MARGIN
Endpoint requires sending
signature.
a
valid API-Key and
USER_DATA
Endpoint requires sending
signature.
a
valid API-Key and
USER_STREAM
Endpoint requires sending
a
valid API-Key.
MARKET_DATA
Endpoint requires sending
a
valid API-Key.
TRADE
and
MARGIN
,
endpoints are
USER_DATA
endpoints.
SIGNED
SIGNED (TRADE, USER_DATA, AND MARGIN)
Endpoint security
endpoints require an additional parameter, signature to be sent
in the query string or request body
Endpoints use HMAC SHA256 signatures. The HMAC SHA256 signature is a
keyed HMAC SHA256 operation. Use your secretKey as the key and totalP
arams as the value for the HMAC operation.
The signature is not case sensitive
totalParams is defined as the query string concatenated with the reque
SIGNED
,
.
.
st 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 after timestamp the request is valid for. If recvWindow is
not sent, it defaults to ,
,
.
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.
The logic
as follows:
is
,
recommended to use a small recvWindow
max cannot go beyond 60,000!
5000 or
of
It is
if ( timestamp < ( serverTime + 1000 ) && ( serverTime - timestamp ) <= recvWindow
{
// process request
}
else
{
// reject request
}
The
less!
SIGNED Endpoint Examples for POST /api/v3/order
Here is a step-by-step example
the Linux command line using
how
of
echo
send
to
openssl
,
vaild signed payload from
and curl
a
,
.
Key
Value
apiKey
vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A
secretKey
NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j
Parameter
Value
symbol
LTCBTC
side
BUY
type
LIMIT
timeInForce
GTC
quantity
price
0.
recvWindow
timestamp
Example
As
1:
request body
a
requestBody:
Example
symbol=LTCBTC
&side=BUY
&type=LIMIT
&timeInForce=GTC
&quantity=&price=0.&recvWindow=×tamp=Example
As
2:
HMAC SHA256 signature:
$ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559"
( stdin )= c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b
curl command:
query string
a
( HMAC SHA256 )
$ curl -H "X-MBX-APIKEY: vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A"
queryString:
symbol=LTCBTC
&side=BUY
&type=LIMIT
&timeInForce=GTC
&quantity=&price=0.&recvWindow=×tamp=Example
Example
HMAC SHA256 signature:
$ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559"
( stdin )= c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b
Mixed query string and request body
3:
queryString:
curl command:
symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC
( HMAC SHA256 )
$ curl -H "X-MBX-APIKEY: vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A"
requestBody:
quantity=1&price=0.1&recvWindow=5000×tamp=Note that the signature is different
"GTC" and "quantity=1".
example
in
There
3.
Example
no & between
is
HMAC SHA256 signature:
$ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTCquantity=1&price=0.1&recvWindow=5000×tamp=1499827319559"
( stdin )= 0fd168b8ddb4876a0358a8d14d0c9f3da0e9b20c5d52b2a00fcf7d1c602f9a
curl command:
( HMAC SHA256 )
$ curl -H "X-MBX-APIKEY: vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A"
Public API Definitions
Terminology
These terms will be used throughout the documentation, so it is
recommended especially for new users to read to help their understanding
of the API.
refers to the asset that is the quantity of a symbol. For the
symbol BTCUSDT, BTC would be the base asset.
quote asset refers to the asset that is the price of a symbol. For the
symbol BTCUSDT, USDT would be the quote asset
base asset
.
ENUM definitions
Symbol status (status):
PRE_TRADING
TRADING
POST_TRADING
END_OF_DAY
HALT
AUCTION_MATCH
BREAK
Symbol type:
SPOT
Order status (status):
Status
Description
NEW
The order has been accepted by the engine.
PARTIALLY_FILLED
A part
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)
the order has been
of
filled.
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
the order
list
has been placed or there
status.
list
has finished executing and thus no longer
list
The order
active.
ALL_DONE
an update
is
to
OCO Order Status (listOrderStatus):
Status
Description
EXECUTING
Either an order list has been placed or there
to the status of the list.
ALL_DONE
An order
active.
REJECT
The List Status is responding to a failed action either
during order placement or order canceled.)
an update
is
has completed execution and thus no longer
list
ContingencyType
OCO
Order types (orderTypes, type):
More information on how the order types definitions can be found here:
Types of Orders
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
force (timeInForce):
in
This sets how long an order
be active before expiration.
will
Status
Description
GTC
Good Til Canceled
An order will be on the book unless the order
Immediate Or Cancel
An order will try to fill the order as much as
order expires.
IOC
or Kill
An order will expire
execution.
FOK
canceled.
is
can before the
it
Fill
the
if
order cannot be
full
upon
filled
Kline/Candlestick chart intervals:
m -> minutes;
-> hours;
h
-> days; w -> weeks; M -> months
d
1m
3m
5m
15m
30m
1h
2h
4h
6h
8h
12h
1d
3d
1w
1M
Rate limiters (rateLimitType)
REQUEST_WEIGHT
REQUEST_WEIGHT
ORDERS
RAW_REQUESTS
{
"rateLimitType" : "REQUEST_WEIGHT" ,
"interval" : "MINUTE" ,
"intervalNum" : 1 ,
"limit" :
Rate limit intervals (interval)
}
SECOND
MINUTE
DAY
ORDERS
{
"rateLimitType" : "ORDERS" ,
"interval" : "SECOND" ,
"intervalNum" : 10 ,
"limit" : },
{
"rateLimitType" : "ORDERS" ,
"interval" : "DAY" ,
"intervalNum" : 1 ,
"limit" : }
RAW_REQUESTS
{
"rateLimitType" : "RAW_REQUESTS" ,
"interval" : "MINUTE" ,
"intervalNum" : 5 ,
"limit" : }
Filters
define trading rules on a symbol or an exchange. Filters come
forms: symbol filters and exchange filters
Filters
two
in
.
Symbol Filters
PRICE_FILTER
The
defines the
PRICE_FILTER
rules
price
symbol. There are
for a
parts:
ExchangeInfo format:
defines the minimum price / stopPrice allowed; disabled on
inPrice == 0.
maxPrice defines the maximum price / stopPrice allowed; disabled on
axPrice == 0.
tickSize defines the intervals that a price / stopPrice can be
increased/decreased by; disabled on tickSize == 0.
minPrice
Any
m
{
"filterType"
"minPrice" :
"maxPrice" :
"tickSize" :
m
: "PRICE_FILTER" ,
"0.00000100" ,
"100000.00000000" ,
"0.00000100"
}
the above variables can be set to 0, which disables that rule in the pr
filter In order to pass the price filter the following must be true
price / stopPrice of the enabled rules:
of
ice
.
for
>=
<=
price
price
price
(
,
minPrice
maxPrice
minPrice
-
%
)
==
tickSize
PERCENT_PRICE
The PERCENT_PRICE filter defines valid range for a 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.
ExchangeInfo format:
{
order
In
pass the
to
<=
>=
price
price
percent price
the following must be true
,
weightedAveragePrice
*
multiplierUp
weightedAveragePrice
*
multiplierDown
for price
"filterType" : "PERCENT_PRICE" ,
"multiplierUp" : "1.3000" ,
"multiplierDown" : "0.7000" ,
"avgPriceMins" :
:
}
LOT_SIZE
The
defines the
symbol. There are 3 parts:
LOT_SIZE filter
for a
(aka "lots"
quantity
auction terms) rules
in
ExchangeInfo format:
defines the minimum quantity / icebergQty allowed.
maxQty defines the maximum quantity / icebergQty allowed.
stepSize defines the intervals that a quantity / icebergQty can be
increased/decreased by.
minQty
{
"filterType" : "LOT_SIZE" ,
"minQty" : "0.00100000" ,
"maxQty" : "100000.00000000" ,
"stepSize" : "0.00100000"
}
order
In
pass the
to
bergQty
the following must be true
,
for quantity
ice
/
:
>=
<=
quantity
quantity
quantity
(
lot size
minQty
maxQty
minQty
-
%
)
==
stepSize
MIN_NOTIONAL
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. avgPric
eMins is the number of minutes the average price is calculated over. means the last price is used.
ExchangeInfo format:
.
{
"filterType" : "MIN_NOTIONAL" ,
"minNotional" : "0.00100000" ,
"applyToMarket" : true ,
"avgPriceMins" : }
ICEBERG_PARTS
The ICEBERG_PARTS filter defines the maximum parts an iceberg order can
have. The number of ICEBERG_PARTS is defined as CEIL(qty / icebergQty)
ExchangeInfo format:
.
{
MARKET_LOT_SIZE
"filterType" : "ICEBERG_PARTS" ,
"limit" :
The MARKET_LOT_SIZE filter defines the quantity (aka "lots" in auction
terms) rules for MARKET orders on a symbol. There are 3 parts:
}
defines the minimum quantity allowed.
maxQty defines the maximum quantity allowed.
stepSize defines the intervals that a quantity can be
increased/decreased by.
minQty
In
order
ty
:
pass the
to
market lot size
ExchangeInfo format:
{
the following must be true
,
"filterType" : "MARKET_LOT_SIZE" ,
"minQty" : "0.00100000" ,
"maxQty" : "100000.00000000" ,
"stepSize" : "0.00100000"
for quanti
}
>=
<=
quantity
quantity
quantity
(
minQty
maxQty
minQty
-
%
)
==
stepSize
MAX_NUM_ORDERS
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.
ExchangeInfo format:
{
"filterType" : "MAX_NUM_ORDERS" ,
"maxNumOrders" :
MAX_NUM_ALGO_ORDERS
}
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
TOP_LOSS STOP_LOSS_LIMIT TAKE_PROFIT and TAKE_PROFIT_LIMIT orders.
,
,
S
ExchangeInfo format:
,
MAX_NUM_ICEBERG_ORDERS
{
"filterType" : "MAX_NUM_ALGO_ORDERS" ,
"maxNumAlgoOrders" :
The MAX_NUM_ICEBERG_ORDERS filter defines the maximum number of ICEBER
G orders an account is allowed to have open on a symbol. An ICEBERG
order is any order where the icebergQty is > 0.
}
MAX_POSITION
ExchangeInfo format:
The 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:
{
"filterType" : "MAX_NUM_ICEBERG_ORDERS" ,
"maxNumIcebergOrders" : }
free balance of the base asset
locked balance of the base asset
sum of the qty of all open BUY orders
orders will be rejected if the account's position
maximum position allowed.
BUY
greater than the
is
Exchange Filters
ExchangeInfo format:
EXCHANGE_MAX_NUM_ORDERS
{
The 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.
"filterType" : "MAX_POSITION" ,
"maxPosition" : "10.00000000"
}
EXCHANGE_MAX_NUM_ALGO_ORDERS
The MAX_ALGO_ORDERS
an account is allowed
P_LOSS
defines the maximum number of "algo" orders
have open on the exchange. "Algo" orders are STO
TAKE_PROFIT and TAKE_PROFIT_LIMIT orders.
filter
to
STOP_LOSS_LIMIT
,
ExchangeInfo format:
,
{
"filterType" : "EXCHANGE_MAX_NUM_ORDERS" ,
"maxNumOrders" :
,
}
ExchangeInfo format:
{
"filterType" : "EXCHANGE_MAX_ALGO_ORDERS" ,
"maxNumAlgoOrders" : }
Wallet Endpoints
System Status (System)
GET /sapi/v1/system/status
Response
Fetch system status.
{
Weight(IP):
"status" : 0 ,
"msg" : "normal"
// 0: normal,1:system maintenance
// normal|system maintenance
}
Coins' Information (USER_DATA)
All
Get information
coins (available
of
deposit and withdraw)
for
GET /sapi/v1/capital/config/getall
user.
for
(HMAC SHA256)
Response:
Weight(IP): [
Parameters:
{
Name
Type
Mandatory
recvWindow
LONG
NO
timestamp
LONG
YES
"coin" : "BTC" ,
"depositAllEnable" : true ,
"free" : "0.08074558" ,
"freeze" : "0.00000000" ,
"ipoable" : "0.00000000" ,
"ipoing" : "0.00000000" ,
"isLegalMoney" : false ,
"locked" : "0.00000000" ,
"name" : "Bitcoin" ,
"networkList" : [
{
"addressRegex" : "^(bnb1)[0-9a-z]{38}$" ,
"coin" : "BTC" ,
"depositDesc" : "Wallet Maintenance, Deposit Suspended" , //
"depositEnable" : false ,
"isDefault" : false ,
"memoRegex" : "^[0-9A-Za-z\\-_]{1,120}$" ,
"minConfirm" : 1 , // min number for balance confirmation
"name" : "BEP2" ,
"network" : "BNB" ,
"resetAddressStatus" : false ,
"specialTips" : "Both a MEMO and an Address are required to
"unLockConfirm" : 0 , // confirmation number for balance unlock
"withdrawDesc" : "Wallet Maintenance, Withdrawal Suspended" ,
"withdrawEnable" : false ,
"withdrawFee" : "0.00000220" ,
"withdrawIntegerMultiple" : "0.00000001" ,
"withdrawMax" : "9999999999.99999999" ,
"withdrawMin" : "0.00000440" ,
"sameAddress" : true // If the coin needs to provide memo to
},
{
"addressRegex" : "^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$|^(bc1)[0-9A-Za-z]{39,59}$"
"coin" : "BTC" ,
"depositEnable" : true ,
"isDefault" : true ,
"memoRegex" : "" ,
"minConfirm" : 1 ,
"name" : "BTC" ,
"network" : "BTC" ,
"resetAddressStatus" : false ,
"specialTips" : "" ,
"unLockConfirm" : 2 ,
"withdrawEnable" : true ,
"withdrawFee" : "0.00050000" ,
"withdrawIntegerMultiple" : "0.00000001" ,
"withdrawMax" : "750" ,
"withdrawMin" : "0.00100000" ,
"sameAddress" : false
}
],
"storage" : "0.00000000" ,
"trading" : true ,
"withdrawAllEnable" : true ,
"withdrawing" : "0.00000000"
Description
shown
successfully
}
]
Daily Account Snapshot (USER_DATA)
GET /sapi/v1/accountSnapshot (HMAC SHA256)
Response:
Weight(IP): {
Parameters:
Name
Type
Mandatory
Description
type
STRING
YES
"SPOT", "MARGIN", "FUTURES"
startTime
LONG
NO
endTime
LONG
NO
limit
INT
NO
recvWindow
LONG
NO
timestamp
LONG
YES
min
max 30, default
5,
"code" : 200 , // 200 for success; others are error codes
"msg" : "" , // error message
"snapshotVos" :[
{
"data" :{
"balances" :[
{
"asset" : "BTC" ,
"free" : "0.09905021" ,
"locked" : "0.00000000"
},
{
"asset" : "USDT" ,
"free" : "1.89109409" ,
"locked" : "0.00000000"
}
],
"totalAssetOfBtc" : "0.09942700"
},
"type" : "spot" ,
"updateTime" : }
]
The query time period must be less then 30 days
}
OR
{
"code" : 200 , // 200 for success; others are error codes
"msg" : "" , // error message
"snapshotVos" :[
{
"data" :{
"marginLevel" : "2748.02909813" ,
"totalAssetOfBtc" : "0.00274803" ,
"totalLiabilityOfBtc" : "0.00000100" ,
"totalNetAssetOfBtc" : "0.00274750" ,
"userAssets" :[
{
"asset" : "XRP" ,
"borrowed" : "0.00000000" ,
"free" : "1.00000000" ,
"interest" : "0.00000000" ,
"locked" : "0.00000000" ,
"netAsset" : "1.00000000"
}
]
},
"type" : "margin" ,
"updateTime" : }
]
}
OR
{
"code" : 200 , // 200 for success; others are error codes
"msg" : "" , // error message
"snapshotVos" :[
{
"data" :{
"assets" :[
{
"asset" : "USDT" ,
"marginBalance" : "118.99782335" ,
"walletBalance" : "120.23811389"
}
],
"position" :[
{
"entryPrice" : "7130.41000000" ,
"markPrice" : "7257.66239673" ,
"positionAmt" : "0.01000000" ,
"symbol" : "BTCUSDT" ,
"unRealizedProfit" : "1.24029054" // Only show the value
}
]
},
"type" : "futures" ,
"updateTime" : }
]
at
}
Disable Fast Withdraw Switch (USER_DATA)
POST /sapi/v1/account/disableFastWithdrawSwitch
Weight(IP):
(HMAC SHA256)
Response:
Parameters:
{}
Name
Type
Mandatory
recvWindow
LONG
NO
timestamp
LONG
YES
Description
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)
POST /sapi/v1/account/enableFastWithdrawSwitch
Weight(IP):
(HMAC SHA256)
Response:
{}
Parameters:
Name
Type
Mandatory
recvWindow
LONG
NO
timestamp
LONG
YES
Description
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)
POST /sapi/v1/capital/withdraw/apply
Submit
(HMAC SHA256)
Response:
withdraw request.
a
{
Weight(IP):
"id" : "7213fea8e94b4a5593d507237e5a555b"
}
Parameters:
Name
Type
Mandatory
coin
STRING
YES
withdrawOrderId
STRING
NO
network
STRING
NO
address
STRING
YES
addressTag
STRING
NO
amount
DECIMAL
YES
transactionFeeFlag
BOOLEAN
NO
Description
client
Secondary address
identifier for coins like
XRP,XMR etc.
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
withdraw
id for
NO
.
Description of the
address. Space in
name should be
encoded into %
recvWindow
LONG
NO
timestamp
LONG
YES
.
not send, return with default network of the coin.
You can get network and isDefault in networkList of a coin in the
response of Get /sapi/v1/capital/config/getall (HMAC SHA256)
network
If
.
Deposit History(supporting network) (USER_DATA)
GET /sapi/v1/capital/deposit/hisrec (HMAC SHA256)
Response:
Fetch deposit history.
[
Weight(IP):
{
"amount" : "0.00999800" ,
"coin" : "PAXG" ,
"network" : "ETH" ,
"status" : 1 ,
"address" : "0x788cabe9236ce061e5a892e1a59395a81fc8d62c" ,
"addressTag" : "" ,
"txId" : "0xaad4654a3234aa6118af9b4b335f5ae81c360b2394721c019b5d1e75328b09f3"
"insertTime" : 1599621997000 ,
"transferType" : 0 ,
"unlockConfirm" : "12/12" , // confirm times for unlocking
"confirmTimes" : "12/12"
Parameters:
Name
Type
Mandatory
coin
STRING
NO
status
INT
NO
Description
0(0:pending,6: credited but
cannot withdraw, 1:success)
startTime
LONG
NO
Default: 90 days from current
timestamp
endTime
LONG
NO
Default: present timestamp
offset
INT
NO
Default:
limit
INT
NO
Default:1000, Max:
recvWindow
LONG
NO
},
{
"amount" : "0.50000000" ,
"coin" : "IOTA" ,
"network" : "IOTA" ,
"status" : 1 ,
"address" : "SIZ9VLMHWATXKV99LH99CIGFJFUMLEHGWVZVNNZXRJJVWBPHYWPPBOSDORZ9EQSHCZAMPVAPGFYQAUUV9DROOXJLNW"
"addressTag" : "" ,
"txId" : "ESBFVQUTPIWQNJSPXFNHNYHSQNTGKRVKPRABQWTAXCDWOAKDKYWPTVG9BGXNVNKTLEJGESAVXIKIZ9999"
"insertTime" : 1599620082000 ,
"transferType" : 0 ,
"unlockConfirm" : "1/12" ,
"confirmTimes" : "1/1"
}
timestamp
LONG
]
YES
Please notice the default startTime and endTime to make sure that time
interval is within 0-90 days.
If both startTime and endTime are sent, time between startTime and en
dTime must be less than 90 days.
Withdraw History (supporting network)
(USER_DATA)
GET /sapi/v1/capital/withdraw/history (HMAC SHA256)
Response:
Fetch withdraw history.
[
Weight(IP):
{
"address" : "0x94df8b352de7f46f64b01d3666bf6e936e44ce60" ,
"amount" : "8.91000000" ,
"applyTime" : "2019-10-12 11:12:02" ,
"coin" : "USDT" ,
"id" : "b6ae22b3aa844210a7041aee7589627c" ,
"withdrawOrderId" : "WITHDRAWtest123" , // will not be returned if there's
"network" : "ETH" ,
"transferType" : 0 ,
// 1 for internal transfer, 0 for external transfer
"status" : 6 ,
"transactionFee" : "0.004" ,
"confirmNo" : 3 , // confirm times for withdraw
"txId" : "0xb5ef8c13b968a406cc62a93a8bd80f9e9a906ef1b3fcf20a2e48573c17659268"
Parameters:
Name
Type
Mandatory
coin
STRING
NO
withdrawOrderId
STRING
NO
status
INT
NO
Description
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:
startTime
LONG
NO
Default: 90 days from
current timestamp
endTime
LONG
NO
Default: present
timestamp
recvWindow
LONG
NO
timestamp
LONG
YES
},
{
"address" : "1FZdVHtiBqMrWdjPyRPULCUceZPJ2WLCsB" ,
"amount" : "0.00150000" ,
"applyTime" : "2019-09-24 12:43:45" ,
"coin" : "BTC" ,
"id" : "156ec387f49b41df8724fa744fa82719" ,
"network" : "BTC" ,
"status" : 6 ,
"transactionFee" : "0.004" ,
"transferType" : 0 ,
// 1 for internal transfer, 0 for external transfer
"confirmNo" : 2 ,
"txId" : "60fd9007ebfddc753455f95fafa808c4302c836e4d1eebc5a132c36c1d8ac354"
}
]
may not be in the response for old withdraw.
Please notice the default startTime and endTime to make sure that time
interval is within 0-90 days.
If both startTime and endTime are sent, time between startTime and en
dTime must be less than 90 days.
network
Deposit Address (supporting network) (USER_DATA)
GET /sapi/v1/capital/deposit/address (HMAC SHA256)
Response:
Fetch deposit address with network.
{
Weight(IP):
"address" : "1HPn8Rx2y6nNSfagQBKy27GB99Vbzg89wv" ,
"coin" : "BTC" ,
"tag" : "" ,
"url" : "https://btc.com/1HPn8Rx2y6nNSfagQBKy27GB99Vbzg89wv"
Parameters:
}
Name
Type
Mandatory
coin
STRING
YES
network
STRING
NO
recvWindow
LONG
NO
timestamp
LONG
YES
Description
not send, return with default network of the coin.
You can get network and isDefault in networkList in the response
network is
If
et /sapi/v1/capital/config/getall
(HMAC SHA256)
of G
.
Account Status (USER_DATA)
GET /sapi/v1/account/status
Response:
Fetch account status detail.
{
Weight(IP):
"data" : "Normal"
}
Parameters:
Name
Type
Mandatory
recvWindow
LONG
NO
timestamp
LONG
YES
Description
Account API Trading Status (USER_DATA)
GET /sapi/v1/account/apiTradingStatus (HMAC SHA256)
Response:
Fetch account api trading status detail.
{
Weight(IP):
"data" : {
// API trading status detail
"isLocked" : false ,
// API trading function is locked or not
"plannedRecoverTime" : 0 , // If API trading function is locked,
"triggerCondition" : {
"GCR" : 150 , // Number of GTC orders
"IFER" : 150 , // Number of FOK/IOC orders
"UFR" : // Number of orders
},
"indicators" : { // The indicators updated every 30 seconds
"BTCUSDT" : [ // The symbol
{
"i" : "UFR" , // Unfilled Ratio (UFR)
"c" : 20 ,
// Count of all orders
"v" : 0.05 ,
// Current UFR value
"t" : 0.// Trigger UFR value
},
{
"i" : "IFER" , // IOC/FOK Expiration Ratio (IFER)
"c" : 20 ,
// Count of FOK/IOC orders
"v" : 0.99 ,
// Current IFER value
"t" : 0.// Trigger IFER value
},
{
"i" : "GCR" , // GTC Cancellation Ratio (GCR)
"c" : 20 ,
// Count of GTC orders
"v" : 0.99 ,
// Current GCR value
"t" : 0.// Trigger GCR value
}
],
"ETHUSDT" : [
{
"i" : "UFR" ,
"c" : 20 ,
"v" : 0.05 ,
"t" : 0.},
{
"i" : "IFER" ,
"c" : 20 ,
"v" : 0.99 ,
"t" : 0.},
{
"i" : "GCR" ,
"c" : 20 ,
"v" : 0.99 ,
"t" : 0.}
]
},
"updateTime" : }
Parameters:
Name
Type
Mandatory
recvWindow
LONG
NO
timestamp
LONG
YES
Description
}
DustLog(USER_DATA)
GET /sapi/v1/asset/dribblet (HMAC SHA256)
Weight(IP):
Response
{
Parameters:
Name
Type
Mandatory
startTime
LONG
NO
endTime
LONG
NO
recvWindow
LONG
NO
timestamp
LONG
YES
"total" : 8 ,
//Total counts of exchange
"userAssetDribblets" : [
{
"operateTime" : 1615985535000 ,
"totalTransferedAmount" : "0.00132256" ,
// Total transfered
"totalServiceChargeAmount" : "0.00002699" ,
//Total service
"transId" : 45178372831 ,
"userAssetDribbletDetails" : [
//Details of this
{
"transId" : 4359321 ,
"serviceChargeAmount" : "0.000009" ,
"amount" : "0.0009" ,
"operateTime" : 1615985535000 ,
"transferedAmount" : "0.000441" ,
"fromAsset" : "USDT"
},
{
"transId" : 4359321 ,
"serviceChargeAmount" : "0.00001799" ,
"amount" : "0.0009" ,
"operateTime" : 1615985535000 ,
"transferedAmount" : "0.00088156" ,
"fromAsset" : "ETH"
}
]
},
{
"operateTime" : 1616203180000 ,
"totalTransferedAmount" : "0.00058795" ,
"totalServiceChargeAmount" : "0.000012" ,
"transId" : 4357015 ,
"userAssetDribbletDetails" : [
{
"transId" : 4357015 ,
"serviceChargeAmount" : "0.00001" ,
"amount" : "0.001" ,
"operateTime" : 1616203180000 ,
"transferedAmount" : "0.00049" ,
"fromAsset" : "USDT"
},
{
"transId" : 4357015 ,
"serviceChargeAmount" : "0.000002" ,
"amount" : "0.0001" ,
"operateTime" : 1616203180000 ,
"transferedAmount" : "0.00009795" ,
"fromAsset" : "ETH"
}
]
}
]
Description
exchange.
}
}
Dust Transfer (USER_DATA)
POST /sapi/v1/asset/dust (HMAC SHA256)
Convert dust assets
Response:
BNB.
to
{
Weight(Uid):
"totalServiceCharge" : "0.02102542" ,
"totalTransfered" : "1.05127099" ,
"transferResult" :[
{
"amount" : "0.03000000" ,
"fromAsset" : "ETH" ,
"operateTime" : 1563368549307 ,
"serviceChargeAmount" : "0.00500000" ,
"tranId" : 2970932918 ,
"transferedAmount" : "0.25000000"
},
{
"amount" : "0.09000000" ,
"fromAsset" : "LTC" ,
"operateTime" : 1563368549404 ,
"serviceChargeAmount" : "0.01548000" ,
"tranId" : 2970932918 ,
"transferedAmount" : "0.77400000"
},
{
"amount" : "248.61878453" ,
"fromAsset" : "TRX" ,
"operateTime" : 1563368549489 ,
"serviceChargeAmount" : "0.00054542" ,
"tranId" : 2970932918 ,
"transferedAmount" : "0.02727099"
}
]
Parameters:
Name
Type
Mandatory
Description
asset
ARRAY
YES
The asset being converted. For
example:
asset=BTC&asset=USDT
recvWindow
LONG
NO
timestamp
LONG
YES
}
Asset Dividend Record (USER_DATA)
GET /sapi/v1/asset/assetDividend
(HMAC SHA256)
Response:
Query asset dividend record.
{
Weight(IP):
"rows" :[
{
"amount" : "10.00000000" ,
"asset" : "BHFT" ,
"divTime" : 1563189166000 ,
"enInfo" : "BHFT distribution" ,
"tranId" :
Parameters:
Name
Type
Mandatory
asset
STRING
NO
startTime
LONG
NO
endTime
LONG
NO
limit
INT
NO
recvWindow
LONG
NO
timestamp
LONG
YES
Description
},
{
"amount" : "10.00000000" ,
"asset" : "BHFT" ,
"divTime" : 1563189165000 ,
"enInfo" : "BHFT distribution" ,
"tranId" : }
],
"total" :
Default 20, max }
Asset Detail (USER_DATA)
GET /sapi/v1/asset/assetDetail
Fetch details
(HMAC SHA256)
Response:
assets supported on Binance.
of
{
Weight(IP):
"CTR" : {
"minWithdrawAmount" : "70.00000000" , //min withdraw amount
"depositStatus" : false , //deposit status (false if ALL of networks'
"withdrawFee" : 35 , // withdraw fee
"withdrawStatus" : true , //withdraw status (false if ALL of networks'
"depositTip" : "Delisted, Deposit Suspended" //reason
},
"SKY" : {
"minWithdrawAmount" : "0.02000000" ,
"depositStatus" : true ,
"withdrawFee" : 0.01 ,
"withdrawStatus" : true
}
Parameters:
Name
Type
Mandatory
asset
STRING
NO
recvWindow
LONG
NO
timestamp
LONG
YES
Description
}
Please get network and other deposit or withdraw details from
i/v1/capital/config/getall
GET /sap
.
Trade Fee (USER_DATA)
GET /sapi/v1/asset/tradeFee (HMAC SHA256)
Response:
Fetch trade fee
[
Weight(IP):
{
"symbol" : "ADABNB" ,
"makerCommission" : "0.001" ,
"takerCommission" : "0.001"
Parameters:
Name
Type
Mandatory
symbol
STRING
NO
recvWindow
LONG
NO
timestamp
LONG
YES
},
{
Description
"symbol" : "BNBBTC" ,
"makerCommission" : "0.001" ,
"takerCommission" : "0.001"
}
]
User Universal Transfer (USER_DATA)
POST /sapi/v1/asset/transfer
(HMAC SHA256)
You need to enable Permits Universal
which requests this endpoint.
Response:
option
Transfer
the api key
for
{
"tranId" :
Weight(IP):
}
Parameters:
Name
Type
Mandatory
type
ENUM
YES
asset
STRING
YES
amount
DECIMAL
YES
fromSymbol
STRING
NO
toSymbol
STRING
NO
recvWindow
LONG
NO
timestamp
LONG
YES
Description
must be sent when type are ISOLATEDMARGIN_MARGIN and
ISOLATEDMARGIN_ISOLATEDMARGIN
toSymbol must be sent when type are MARGIN_ISOLATEDMARGIN and
ISOLATEDMARGIN_ISOLATEDMARGIN
fromSymbol
ENUM
transfer types:
of
MAIN_C2C Spot account transfer to C2C account
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
MAIN_MINING Spot account transfer to Mining account
C2C_MAIN C2C account transfer to Spot account
C2C_UMFUTURE C2C account transfer to USDⓈ-M Futures account
C2C_MINING C2C account transfer to Mining account
C2C_MARGIN C2C account transfer to Margin(cross) account
UMFUTURE_MAIN USDⓈ-M Futures account transfer to Spot
account
UMFUTURE_C2C USDⓈ-M Futures account transfer to C2C 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
MARGIN_MINING Margin(cross)account transfer to Mining
account
MARGIN_C2C Margin(cross)account transfer to C2C account
MINING_MAIN Mining account transfer to Spot account
MINING_UMFUTURE Mining account transfer to USDⓈ-M Futures
account
MINING_C2C Mining account transfer to C2C account
MINING_MARGIN Mining account transfer to Margin(cross)
account
MAIN_PAY Spot account transfer to Pay account
PAY_MAIN Pay account transfer to Spot account
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
Query User Universal Transfer History (USER_DATA)
GET /sapi/v1/asset/transfer (HMAC SHA256)
Weight(IP):
Response:
{
Parameters:
Name
Type
Mandatory
type
ENUM
YES
startTime
LONG
NO
endTime
LONG
NO
current
INT
NO
Default
size
INT
NO
Default 10, Max
fromSymbol
STRING
NO
toSymbol
STRING
NO
recvWindow
LONG
NO
timestamp
LONG
YES
"total" : 2 ,
"rows" :[
{
"asset" : "USDT" ,
"amount" : "1" ,
"type" : "MAIN_UMFUTURE" ,
"status" : "CONFIRMED" ,
"tranId" : 11415955596 ,
"timestamp" : },
{
"asset" : "USDT" ,
"amount" : "2" ,
"type" : "MAIN_UMFUTURE" ,
"status" : "CONFIRMED" ,
"tranId" : 11366865406 ,
"timestamp" : }
]
Description
}
must be sent when type are ISOLATEDMARGIN_MARGIN and
ISOLATEDMARGIN_ISOLATEDMARGIN
toSymbol must be sent when type are MARGIN_ISOLATEDMARGIN and
ISOLATEDMARGIN_ISOLATEDMARGIN
fromSymbol
Funding Wallet (USER_DATA)
POST /sapi/v1/asset/get-funding-asset (HMAC SHA256)
Weight(IP):
Response
[
Parameters:
{
Name
Type
Mandatory
asset
STRING
NO
needBtcValuation
STRING
NO
recvWindow
LONG
NO
timestamp
LONG
YES
"asset" : "USDT" ,
"free" : "1" ,
// avalible balance
"locked" : "0" , // locked asset
"freeze" : "0" , // freeze asset
"withdrawing" : "0" ,
"btcValuation" : "0.00000091"
Description
}
true or false
]
Currently supports querying the following business assets:Binance Pay,
Binance Card, Binance Gift Card, Stock Token
Get API Key Permission (USER_DATA)
GET /sapi/v1/account/apiRestrictions (HMAC SHA256)
Weight(IP):
Response
{
Parameters:
Name
Type
Mandatory
recvWindow
LONG
NO
timestamp
LONG
YES
"ipRestrict" : false ,
"createTime" : 1623840271000 ,
"enableWithdrawals" : false ,
// This option allows you to withdraw via
"enableInternalTransfer" : true , // This option authorizes this key to
"permitsUniversalTransfer" : true , // Authorizes this key to be used for
"enableVanillaOptions" : false , // Authorizes this key to Vanilla options
"enableReading" : true ,
"enableFutures" : false , // API Key created before your futures account
"enableMargin" : false ,
// This option can be adjusted after the Cross
"enableSpotAndMarginTrading" : false , // Spot and margin trading
"tradingAuthorityExpirationTime" : 1628985600000 // Expiration time for
Description
API.
transfer
spot
}
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
Virtual Sub-account(For Master Account)
a
POST /sapi/v1/sub-account/virtualSubAccount
Weight(IP):
(HMAC SHA256)
Response:
{
Parameters:
"email" : "addsdd_virtual@aasaixwqnoemail.com"
}
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
(For Master Account)
List
GET /sapi/v1/sub-account/list (HMAC SHA256)
Weight(IP):
Response:
{
Parameters:
Name
Type
Mandatory
Description
email
STRING
NO
Sub-account email
isFreeze
STRING
NO
true or false
page
INT
NO
Default value:
limit
INT
NO
Default value:
1,
recvWindow
LONG
NO
timestamp
LONG
YES
"subAccounts" :[
{
"email" : "testsub@gmail.com" ,
"isFreeze" : false ,
"createTime" : },
{
"email" : "virtual@oxebmvfonoemail.com" ,
"isFreeze" : false ,
"createTime" : }
]
Max value:
}
Query Sub-account Spot Asset Transfer History (For
Master Account)
GET /sapi/v1/sub-account/sub/transfer/history
Weight(IP):
(HMAC SHA256)
Response:
[
Parameters:
{
Name
Type
Mandatory
Description
fromEmail
STRING
NO
Sub-account email
toEmail
STRING
NO
Sub-account email
startTime
LONG
NO
endTime
LONG
NO
page
INT
NO
Default value:
limit
INT
NO
Default value:
"from" : "aaa@test.com" ,
"to" : "bbb@test.com" ,
"asset" : "BTC" ,
"qty" : "10" ,
"status" : "SUCCESS" ,
"tranId" : 6489943656 ,
"time" : },
{
"from" : "bbb@test.com" ,
"to" : "ccc@test.com" ,
"asset" : "ETH" ,
"qty" : "2" ,
"status" : "SUCCESS" ,
"tranId" : 6489938713 ,
"time" :
}
]
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)
GET /sapi/v1/sub-account/futures/internalTransfer
Weight(IP):
(HMAC SHA256)
Response
{
Parameters:
Name
Type
Mandatory
Description
email
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:
limit
INT
NO
Default value: 50, Max value:
recvWindow
LONG
NO
timestamp
LONG
YES
"success" : true ,
"futuresType" : 2 ,
"transfers" :[
{
"from" : "aaa@test.com" ,
"to" : "bbb@test.com" ,
"asset" : "BTC" ,
"qty" : "1" ,
"tranId" : 11897001102 ,
"time" : },
{
"from" : "bbb@test.com" ,
"to" : "ccc@test.com" ,
"asset" : "ETH" ,
"qty" : "2" ,
"tranId" : 11631474902 ,
"time" : }
]
}
Sub-account Futures Asset Transfer (For Master
Account)
POST /sapi/v1/sub-account/futures/internalTransfer
Weight(IP):
(HMAC SHA256)
Response
Parameters:
Name
Type
Mandatory
Description
email
STRING
YES
Sub account email
recvWindow
LONG
NO
timestamp
LONG
YES
}
Query Sub-account Spot Assets Summary (For
Master Account)
Get BTC valued asset summary
subaccounts.
of
Response:
GET /sapi/v1/sub-account/spotSummary (HMAC SHA256)
{
Weight(IP):
"totalCount" : 2 ,
"masterAccountTotalAsset" : "0.23231201" ,
"spotSubUserAssetBtcVoList" :[
{
"email" : "sub123@test.com" ,
"totalAsset" : "9999.00000000"
},
{
"email" : "test456@test.com" ,
"totalAsset" : "0.00000000"
}
]
Parameters:
Name
Type
Mandatory
Description
email
STRING
NO
Sub account email
page
LONG
NO
default
size
LONG
NO
default 10, max
recvWindow
LONG
NO
timestamp
LONG
YES
Parameters:
}
Name
Type
Mandatory
Description
email
STRING
YES
Sub account email
coin
STRING
YES
network
STRING
NO
recvWindow
LONG
NO
timestamp
LONG
YES
Get Sub-account Deposit History (For Master
Account)
GET /sapi/v1/capital/deposit/subHisrec
(HMAC SHA256)
Response:
Fetch sub-account deposit history
[
Weight(IP):
{
"amount" : "0.00999800" ,
"coin" : "PAXG" ,
"network" : "ETH" ,
"status" : 1 ,
"address" : "0x788cabe9236ce061e5a892e1a59395a81fc8d62c" ,
"addressTag" : "" ,
"txId" : "0xaad4654a3234aa6118af9b4b335f5ae81c360b2394721c019b5d1e75328b09f3"
"insertTime" : 1599621997000 ,
"transferType" : 0 ,
"confirmTimes" : "12/12"
Parameters:
Name
Type
Mandatory
Description
email
STRING
YES
Sub account email
coin
STRING
NO
status
INT
NO
startTime
LONG
NO
endTime
LONG
NO
limit
INT
NO
offset
INT
NO
},
{
0(0:pending,6: credited but
cannot withdraw, 1:success)
"amount" : "0.50000000" ,
"coin" : "IOTA" ,
"network" : "IOTA" ,
"status" : 1 ,
"address" : "SIZ9VLMHWATXKV99LH99CIGFJFUMLEHGWVZVNNZXRJJVWBPHYWPPBOSDORZ9EQSHCZAMPVAPGFYQAUUV9DROOXJLNW"
"addressTag" : "" ,
"txId" : "ESBFVQUTPIWQNJSPXFNHNYHSQNTGKRVKPRABQWTAXCDWOAKDKYWPTVG9BGXNVNKTLEJGESAVXIKIZ9999"
"insertTime" : 1599620082000 ,
"transferType" : 0 ,
"confirmTimes" : "1/1"
default:
}
]
recvWindow
LONG
NO
timestamp
LONG
YES
Get Sub-account's Status on Margin/Futures (For
Master Account)
GET /sapi/v1/sub-account/status
(HMAC SHA256)
Response
Weight(IP): [
Parameters:
{
Name
Type
Mandatory
Description
email
STRING
NO
Sub-account email
recvWindow
LONG
NO
timestamp
LONG
no email sent,
If
email
or false
or false
account create time
or false for margin
or false for futures.
mobile number
}
]
YES
sub-accounts' information
all
"email" : "123@test.com" ,
// user
"isSubUserEnabled" : true ,
// true
"isUserActive" : true ,
// true
"insertTime" : 1570791523523 , // sub
"isMarginEnabled" : true ,
// true
"isFutureEnabled" : true ,
// true
"mobile" : // user
be returned.
will
Enable Margin for Sub-account (For Master
Account)
POST /sapi/v1/sub-account/margin/enable
Weight(IP):
(HMAC SHA256)
Response
{
Parameters:
Name
Type
Mandatory
recvWindow
LONG
NO
timestamp
LONG
YES
"totalInitialMargin" : "9.83137400" ,
"totalMaintenanceMargin" : "0.41568700" ,
"totalMarginBalance" : "23.03235621" ,
"totalOpenOrderInitialMargin" : "9.00000000" ,
"totalPositionInitialMargin" : "0.83137400" ,
"totalUnrealizedProfit" : "0.03219710" ,
"totalWalletBalance" : "22.15879444" ,
"asset" : "USD" , // The sum of BUSD and USDT
"subAccountList" :[
{
"email" : "123@test.com" ,
"totalInitialMargin" : "9.00000000" ,
"totalMaintenanceMargin" : "0.00000000" ,
"totalMarginBalance" : "22.12659734" ,
"totalOpenOrderInitialMargin" : "9.00000000" ,
"totalPositionInitialMargin" : "0.00000000" ,
"totalUnrealizedProfit" : "0.00000000" ,
"totalWalletBalance" : "22.12659734" ,
"asset" : "USD" //The sum of BUSD and USDT
},
{
"email" : "345@test.com" ,
"totalInitialMargin" : "0.83137400" ,
"totalMaintenanceMargin" : "0.41568700" ,
"totalMarginBalance" : "0.90575887" ,
"totalOpenOrderInitialMargin" : "0.00000000" ,
"totalPositionInitialMargin" : "0.83137400" ,
"totalUnrealizedProfit" : "0.03219710" ,
"totalWalletBalance" : "0.87356177" ,
"asset" : "USD"
}
]
Description
}
Get Futures Position-Risk of Sub-account (For
Master Account)
GET /sapi/v1/sub-account/futures/positionRisk
(HMAC SHA256)
Response
Weight(IP): [
Parameters:
{
Name
Type
Mandatory
Description
email
String
YES
Sub-account email
recvWindow
LONG
NO
timestamp
LONG
YES
"entryPrice" : "9975.12000" ,
"leverage" : "50" ,
// current initial leverage
"maxNotional" : "1000000" ,
// notional value limit of current
"liquidationPrice" : "7963.54" ,
"markPrice" : "9973.50770517" ,
"positionAmount" : "0.010" ,
"symbol" : "BTCUSDT" ,
"unrealizedProfit" : "-0.01612295"
initial
}
]
Futures Transfer for Sub-account (For Master
Account)
POST /sapi/v1/sub-account/futures/transfer
Weight(IP):
(HMAC SHA256)
Response
{
Parameters:
"txnId" : "2966662589"
}
Name
Type
Mandatory
Description
email
String
YES
Sub-account email
asset
STRING
YES
The asset being transferred,
e.g., USDT
amount
DECIMAL
YES
The amount
transferred
type
INT
YES
1:
recvWindow
LONG
NO
timestamp
LONG
YES
be
to
transfer from subaccount's
spot account to its USDTmargined futures account 2:
transfer from subaccount's
USDT-margined futures
account to its spot account 3:
transfer from subaccount's
spot account to its COINmargined futures account
4:transfer from subaccount's
COIN-margined futures
account to its spot account
Margin Transfer for Sub-account (For Master
Account)
POST /sapi/v1/sub-account/margin/transfer
Weight(IP):
(HMAC SHA256)
Response
{
Parameters:
"txnId" : "2966662589"
}
Name
Type
Mandatory
Description
email
String
YES
Sub-account email
asset
STRING
YES
The asset being transferred,
e.g., BTC
amount
DECIMAL
YES
The amount
transferred
type
INT
YES
1:
recvWindow
LONG
NO
timestamp
LONG
YES
be
to
transfer from subaccount's
spot account to margin
account 2: transfer from
subaccount's margin account
to its spot account
Transfer to Sub-account of Same Master (For Subaccount)
POST /sapi/v1/sub-account/transfer/subToSub
Weight(IP):
(HMAC SHA256)
Response
{
Parameters:
"txnId" : "2966662589"
}
Name
Type
Mandatory
Description
toEmail
String
YES
Sub-account email
asset
STRING
YES
amount
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Transfer to Master (For Sub-account)
POST /sapi/v1/sub-account/transfer/subToMaster
Weight(IP):
(HMAC SHA256)
Response
{
Parameters:
"txnId" : "2966662589"
}
Name
Type
Mandatory
asset
STRING
YES
amount
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Description
Sub-account Transfer History (For Sub-account)
GET /sapi/v1/sub-account/transfer/subUserHistory (HMAC SHA256)
Weight(IP):
Response
[
Parameters:
{
Name
Type
Mandatory
Description
asset
STRING
NO
If
type
INT
NO
1:
startTime
LONG
NO
endTime
LONG
NO
limit
INT
NO
recvWindow
LONG
NO
timestamp
LONG
YES
not sent, result
will be returned
transfer
"counterParty" : "master" ,
"email" : "master@test.com" ,
"type" : 1 , // 1 for transfer in, 2 for transfer out
"asset" : "BTC" ,
"qty" : "1" ,
"fromAccountType" : "SPOT" ,
"toAccountType" : "SPOT" ,
"status" : "SUCCESS" ,
"tranId" : 11798835829 ,
"time" :
assets
of all
transfer out
in, 2:
},
{
"counterParty" : "subAccount" ,
"email" : "sub2@test.com" ,
"type" : 1 ,
"asset" : "ETH" ,
"qty" : "2" ,
"fromAccountType" : "SPOT" ,
"toAccountType" : "SPOT" ,
"status" : "SUCCESS" ,
"tranId" : 11798829519 ,
"time" :
Default
}
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.
If
]
Universal Transfer (For Master Account)
POST /sapi/v1/sub-account/universalTransfer
Weight(IP):
(HMAC SHA256)
Response
{
Parameters:
"tranId" : }
Name
Type
Mandatory
Description
fromEmail
STRING
NO
toEmail
STRING
NO
fromAccountType
STRING
YES
"SPOT","USDT_FUTURE","COIN_FUTURE"
toAccountType
STRING
YES
"SPOT","USDT_FUTURE","COIN_FUTURE"
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.
Transfer between futures accounts is not supported.
Query Universal Transfer History (For Master
Account)
GET /sapi/v1/sub-account/universalTransfer
Weight(IP):
(HMAC SHA256)
Response
[
Parameters:
{
"tranId" : 11945860693 ,
"fromEmail" : "master@test.com" ,
"toEmail" : "subaccount1@test.com" ,
"asset" : "BTC" ,
"amount" : "0.1" ,
"fromAccountType" : "SPOT" ,
"toAccountType" : "COIN_FUTURE" ,
"status" : "SUCCESS" ,
"createTimeStamp" :
Name
Type
Mandatory
Description
fromEmail
STRING
NO
toEmail
STRING
NO
startTime
LONG
NO
endTime
LONG
NO
page
INT
NO
Default
limit
INT
NO
Default 500, Max
recvWindow
LONG
NO
timestamp
LONG
YES
},
{
"tranId" : 11945857955 ,
"fromEmail" : "master@test.com" ,
"toEmail" : "subaccount2@test.com" ,
"asset" : "ETH" ,
"amount" : "0.2" ,
"fromAccountType" : "SPOT" ,
"toAccountType" : "USDT_FUTURE" ,
"status" : "SUCCESS" ,
"createTimeStamp" :
}
]
fromEmail and toEmail cannot be sent at the same time.
Return fromEmail equal master account email by default.
Only get the latest history of past 30 days.
Get Detail on Sub-account's Futures Account V2 (For
Master Account)
GET /sapi/v2/sub-account/futures/account
Weight(IP):
(HMAC SHA256)
Response
{
Parameters:
"email" : "123@test.com" ,
"enableBlvt" : true
}
Name
Type
Mandatory
Description
email
String
YES
Sub-account email
enableBlvt
BOOLEAN
YES
Only true
recvWindow
LONG
NO
timestamp
LONG
YES
now
for
Deposit assets into the managed sub-account(For
Investor Master Account)
POST /sapi/v1/managed-subaccount/deposit
Weight(IP):
(HMAC SHA256)
Response
{
Parameters:
"tranId" : }
Name
Type
Mandatory
toEmail
STRING
YES
asset
STRING
YES
amount
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Description
Query managed sub-account asset details(For
Investor Master Account)
GET /sapi/v1/managed-subaccount/asset (HMAC SHA256)
Weight(IP):
Response
{
Parameters:
"tranId" : }
Name
Type
Mandatory
fromEmail
STRING
YES
asset
STRING
YES
amount
DECIMAL
YES
transferDate
LONG
NO
recvWindow
LONG
NO
timestamp
LONG
YES
Description
Withdrawals is automatically
occur on the transfer
date(UTC0). If a date is not
selected, the withdrawal
occurs right now
Market Data Endpoints
Test Connectivity
GET /api/v3/ping
Response:
Test connectivity
the Rest API.
to
{}
Weight(IP):
Parameters:
NONE
Data Source: Memory
Check Server Time
GET /api/v3/time
Response:
Test connectivity
the Rest API and get the current server time.
to
{
Weight(IP):
"serverTime" :
}
Parameters:
NONE
Data Source: Memory
Exchange Information
GET /api/v3/exchangeInfo
Response:
Current exchange trading rules and symbol information
{
Weight(IP):
"timezone" : "UTC" ,
"serverTime" : 1565246363776 ,
"rateLimits" : [
{
//These are defined in the `ENUM definitions` section under `Rate
//All limits are optional
}
],
"exchangeFilters" : [
//These are the defined filters in the `Filters` section.
//All filters are optional.
],
"symbols" : [
{
"symbol" : "ETHBTC" ,
"status" : "TRADING" ,
"baseAsset" : "ETH" ,
"baseAssetPrecision" : 8 ,
"quoteAsset" : "BTC" ,
"quotePrecision" : 8 ,
"quoteAssetPrecision" : 8 ,
"orderTypes" : [
"LIMIT" ,
"LIMIT_MAKER" ,
"MARKET" ,
"STOP_LOSS" ,
"STOP_LOSS_LIMIT" ,
"TAKE_PROFIT" ,
"TAKE_PROFIT_LIMIT"
],
"icebergAllowed" : true ,
"ocoAllowed" : true ,
"isSpotTradingAllowed" : true ,
"isMarginTradingAllowed" : true ,
"filters" : [
//These are defined in the Filters section.
//All filters are optional
],
"permissions" : [
"SPOT" ,
"MARGIN"
]
}
]
Parameters:
There are
possible options:
Options
Example
No
parameter
curl
symbol
curl
symbols
curl
-X GET "https://api.binance.com/api/v3/exchangeInfo"
-X GET "https://api.binance.com/api/v3/exchangeInfo?
symbol=BNBBTC"
-X GET "https://api.binance.com/api/v3/exchangeInfo?
symbols=%5B%22BNBBTC%22,%22BTCUSDT%22%5D" or
curl -g GET 'https://api.binance.com/api/v3/exchangeInfo?
symbols=["BTCUSDT","BNBBTC"]'
any symbol provided in either
endpoint will throw an error.
or
symbol
If
do not
symbols
the
exist,
Data Source: Memory
Limiters
}
Order Book
GET /api/v3/depth
Response:
Weight(IP):
{
Adjusted based on the
Limit
Weight
10, 20, 50,
5,
"lastUpdateId" : 1027024 ,
"bids" : [
[
"4.00000000" ,
// PRICE
"431.00000000"
// QTY
]
],
"asks" : [
[
"4.00000200" ,
"12.00000000"
]
]
limit:
}
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
limit
INT
NO
Description
Default 100; max 5000. Valid limits:
[5, 10, 20, 50, 100, 500, 1000, 5000]
Data Source: Memory
Recent Trades
List
GET /api/v3/trades
Response:
Get recent trades.
[
Weight(IP):
{
"id" : 28457 ,
"price" : "4.00000100" ,
"qty" : "12.00000000" ,
"quoteQty" : "48.000012" ,
"time" : 1499865549590 ,
"isBuyerMaker" : true ,
"isBestMatch" : true
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
INT
limit
Description
}
NO
]
Default 500; max 1000.
Data Source: Memory
Old Trade Lookup (MARKET_DATA)
GET /api/v3/historicalTrades
Response:
Get older market trades.
[
Weight(IP):
{
"id" : 28457 ,
"price" : "4.00000100" ,
"qty" : "12.00000000" ,
"quoteQty" : "48.000012" ,
"time" : 1499865549590 , // Trade executed timestamp, as same as `T` in
"isBuyerMaker" : true ,
"isBestMatch" : true
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
Description
the
}
]
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
List
GET /api/v3/aggTrades
Response:
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):
"a"
"p"
"q"
"f"
"l"
"T"
"m"
"M"
Parameters:
Name
Type
Mandatory
Description
symbol
STRING
YES
fromId
LONG
NO
id to
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.
:
:
:
:
:
:
:
:
26129 ,
"0.01633102" ,
"4.70443515" ,
27781 ,
27781 ,
1498793709153 ,
true ,
true
//
//
//
//
//
//
//
//
Aggregate tradeId
Price
Quantity
First tradeId
Last tradeId
Timestamp
Was the buyer the maker?
Was the trade the best price match?
1499040000000 ,
"0.01634790" ,
"0.80000000" ,
"0.01575800" ,
"0.01577100" ,
"148976.11427815" ,
1499644799999 ,
"2434.19055334" ,
308 ,
"1756.87402397" ,
"28.46694368" ,
"17928899.62484339"
//
//
//
//
//
//
//
//
//
//
//
//
Open time
Open
High
Low
Close
Volume
Close time
Quote asset volume
Number of trades
Taker buy base asset volume
Taker buy quote asset volume
Ignore.
}
]
get aggregate trades from
INCLUSIVE.
startTime and endTime are sent, time between startTime and endTime
must be less than 1 hour.
If fromId, startTime, and endTime are not sent, the most recent
aggregate trades will be returned.
If
Data Source: Database
Kline/Candlestick Data
GET /api/v3/klines
Response:
Kline/candlestick bars for a symbol.
Klines are uniquely identified by their open time.
[
[
Weight(IP):
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
interval
ENUM
YES
startTime
LONG
NO
endTime
LONG
NO
limit
INT
NO
Description
]
]
Default 500; max 1000.
startTime and endTime are not sent, the most recent klines are
returned.
If
Data Source: Database
Current Average Price
GET /api/v3/avgPrice
Response:
Current average price
symbol.
for a
{
Weight(IP):
"mins" : 5 ,
"price" : "9.35751834"
}
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
Description
Data Source: Memory
24hr Ticker Price Change Statistics
GET /api/v3/ticker/24hr
Response:
24 hour rolling window price change statistics. Careful when accessing this
with no symbol.
{
"symbol" : "BNBBTC" ,
"priceChange" : "-94.99999800" ,
"priceChangePercent" : "-95.960" ,
"weightedAvgPrice" : "0.29628482" ,
"prevClosePrice" : "0.10002000" ,
"lastPrice" : "4.00000200" ,
"lastQty" : "200.00000000" ,
"bidPrice" : "4.00000000" ,
"askPrice" : "4.00000200" ,
"openPrice" : "99.00000000" ,
"highPrice" : "100.00000000" ,
"lowPrice" : "0.10000000" ,
"volume" : "8913.30000000" ,
"quoteVolume" : "15.30000000" ,
"openTime" : 1499783499040 ,
"closeTime" : 1499869899040 ,
"firstId" : 28385 ,
// First tradeId
"lastId" : 28460 ,
// Last tradeId
"count" : // Trade count
Weight(IP):
single symbol;
40 when the symbol parameter
1 for a
omitted;
is
Parameters:
Name
Type
Mandatory
symbol
STRING
NO
the symbol
array.
not sent, tickers
is
If
Description
for
symbols
all
be returned
will
an
in
Data Source: Memory
}
OR
[
{
"symbol" : "BNBBTC" ,
"priceChange" : "-94.99999800" ,
"priceChangePercent" : "-95.960" ,
"weightedAvgPrice" : "0.29628482" ,
"prevClosePrice" : "0.10002000" ,
"lastPrice" : "4.00000200" ,
"lastQty" : "200.00000000" ,
"bidPrice" : "4.00000000" ,
"askPrice" : "4.00000200" ,
"openPrice" : "99.00000000" ,
"highPrice" : "100.00000000" ,
"lowPrice" : "0.10000000" ,
"volume" : "8913.30000000" ,
"quoteVolume" : "15.30000000" ,
"openTime" : 1499783499040 ,
"closeTime" : 1499869899040 ,
"firstId" : 28385 ,
// First tradeId
"lastId" : 28460 ,
// Last tradeId
"count" : // Trade count
}
]
Symbol Price Ticker
GET /api/v3/ticker/price
Latest price
Response:
symbol or symbols.
for a
{
Weight(IP):
"symbol" : "LTCBTC" ,
"price" : "4.00000200"
}
single symbol;
when the symbol parameter
1 for a
omitted
is
OR
Parameters:
Name
Type
Mandatory
symbol
STRING
NO
the symbol
array.
{
"symbol" : "LTCBTC" ,
"price" : "4.00000200"
not sent, prices
is
If
[
Description
for
symbols
all
be returned
will
},
{
an
in
"symbol" : "ETHBTC" ,
"price" : "0.07946600"
}
]
Data Source: Memory
Symbol Order Book Ticker
GET /api/v3/ticker/bookTicker
Response:
Best price/qty on the order book
symbol or symbols.
for a
{
Weight(IP):
single symbol;
when the symbol parameter
"symbol" :
"bidPrice"
"bidQty" :
"askPrice"
"askQty" :
1 for a
omitted
is
"LTCBTC" ,
: "4.00000000" ,
"431.00000000" ,
: "4.00000200" ,
"9.00000000"
}
Parameters:
Name
Type
Mandatory
symbol
STRING
NO
OR
Description
[
{
the symbol
an array.
not sent, bookTickers
is
If
for
symbols
all
be returned
will
in
Data Source: Memory
"symbol" :
"bidPrice"
"bidQty" :
"askPrice"
"askQty" :
"LTCBTC" ,
: "4.00000000" ,
"431.00000000" ,
: "4.00000200" ,
"9.00000000"
"symbol" :
"bidPrice"
"bidQty" :
"askPrice"
"askQty" :
"ETHBTC" ,
: "0.07946700" ,
"9.00000000" ,
: "100000.00000000" ,
"1000.00000000"
},
{
}
]
Websocket Market Streams
The base endpoint is: wss://stream.binance.com:Streams can be accessed either in a single raw stream or in a combined
stream
Raw streams are accessed at /ws/
Combined streams are accessed at /stream?streams= //
Combined stream events are wrapped as follows: {"stream":" ","data":}
All symbols for streams are lowercase
A single connection to stream.binance.com is only valid for 24 hours;
expect to be disconnected at the 24 hour mark
The websocket server will send a ping frame every 3 minutes. If the
websocket server does not receive a pong frame back from the
connection within a 10 minute period, the connection will be
disconnected. Unsolicited pong frames are allowed.
Live Subscribing/Unsubscribing to streams
The following data can be sent through the websocket instance in order
to subscribe/unsubscribe from streams. Examples can be seen below.
The id used in the JSON payloads is an unsigned INT used as an
identifier to uniquely identify the messages going back and forth.
In the response, if the result received is null this means the request
sent was a success.
Subscribe to
stream
a
Request
Response
{
"method": "SUBSCRIBE",
"params":
{
"result" : null ,
"id" :
[
}
"btcusdt@aggTrade",
"btcusdt@depth"
],
"id": }
Unsubscribe to
stream
a
Request
Response
{
"method": "UNSUBSCRIBE",
"params":
{
[
}
"result" : null ,
"id" :
"btcusdt@depth"
],
"id":
}
Listing Subscriptions
Request
Response
{
"method": "LIST_SUBSCRIPTIONS",
{
"result" : [
"btcusdt@aggTrade"
],
"id" :
"id": }
}
Setting Properties
Currently, the only property can be set is to set whether combined stream
payloads are enabled or not. The combined property is set to false when
connecting using /ws/ ("raw streams") and true when connecting using
stream/
/
.
Request
Response
{
"method": "SET_PROPERTY",
"params":
{
"result" : null ,
"id" :
[
}
"combined",
true
],
"id": }
Retrieving Properties
Request
Response
{
"method": "GET_PROPERTY",
"params":
{
[
}
"result" : true , // Indicates that combined is set to true.
"id" :
"combined"
],
"id": }
Error Messages
Error Message
Description
{"code": 0, "msg": "Unknown property",
"id": '%s'}
Parameter used in the
SET_PROPERTY or
GET_PROPERTY was invalid
{"code": 1, "msg": "Invalid value type:
expected Boolean", "id": '%s'}
Value should only be
true or false
{"code": 2, "msg": "Invalid request: property
name must be a string"}
Property name provided
was invalid
{"code": 2, "msg": "Invalid request: request
ID must be an unsigned integer"}
Parameter id had to be
provided or the value
provided in the id
parameter is an
unsupported type
{"code": 2, "msg": "Invalid request:
unknown variant %s, expected one
Possible typo in the
provided method or
provided method was
neither of the expected
values
SUBSCRIBE
UNSUBSCRIBE
,
LIST_SUBSCRIPTIONS
of
,
SET_PROPERTY
,
,
column 28"}
GET_PROPERTY at line
{"code": 2, "msg": "Invalid request: too
many parameters"}
Unnecessary parameters
provided in the data
{"code": 2, "msg": "Invalid request: property
name must be a string"}
Property name was not
provided
{"code":
method
"msg": "Invalid request: missing
method at line 1 column 73"}
field
2,
was not provided
the data
in
{"code":3,"msg":"Invalid JSON: expected
value at line %s column %s"}
JSON data sent has
incorrect syntax.
Aggregate Trade Streams
The Aggregate Trade Streams push trade information that
a single taker order.
Stream Name:
aggregated
is
for
Payload: @aggTrade
{
"e"
"E"
"s"
"a"
"p"
"q"
"f"
"l"
"T"
"m"
"M"
Update Speed: Real-time
:
:
:
:
:
:
:
:
:
:
:
"aggTrade" ,
123456789 ,
"BNBBTC" ,
12345 ,
"0.001" ,
"100" ,
100 ,
105 ,
123456785 ,
true ,
true
//
//
//
//
//
//
//
//
//
//
//
Event type
Event time
Symbol
Aggregate trade ID
Price
Quantity
First trade ID
Last trade ID
Trade time
Is the buyer the market maker?
Ignore
//
//
//
//
//
//
//
//
//
//
//
Event type
Event time
Symbol
Trade ID
Price
Quantity
Buyer order ID
Seller order ID
Trade time
Is the buyer the market maker?
Ignore
}
Trade Streams
The Trade Streams push raw trade information; each trade has
buyer and seller.
Stream Name:
unique
a
Payload: @trade
{
"e"
"E"
"s"
"t"
"p"
"q"
"b"
"a"
"T"
"m"
"M"
Update Speed: Real-time
:
:
:
:
:
:
:
:
:
:
:
"trade" ,
123456789 ,
"BNBBTC" ,
12345 ,
"0.001" ,
"100" ,
88 ,
50 ,
123456785 ,
true ,
true
}
Kline/Candlestick Streams
The Kline/Candlestick Stream push updates
every second.
Stream Name:
the current klines/candlestick
to
Payload: @kline_
{
"e" :
"E" :
"s" :
"k" :
"t"
"T"
"s"
"i"
"f"
"L"
"o"
"c"
"h"
"l"
"v"
"n"
"x"
"q"
"V"
"Q"
"B"
}
Update Speed: 2000ms
Kline/Candlestick chart intervals:
m -> minutes;
-> hours;
h
-> days; w -> weeks; M -> months
d
1m
3m
5m
15m
30m
1h
2h
4h
6h
8h
12h
1d
3d
1w
1M
"kline" ,
123456789 ,
"BNBBTC" ,
{
: 123400000 ,
: 123460000 ,
: "BNBBTC" ,
: "1m" ,
: 100 ,
: 200 ,
: "0.0010" ,
: "0.0020" ,
: "0.0025" ,
: "0.0015" ,
: "1000" ,
: 100 ,
: false ,
: "1.0000" ,
: "500" ,
: "0.500" ,
: "123456"
// Event type
// Event time
// Symbol
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
Kline start time
Kline close time
Symbol
Interval
First trade ID
Last trade ID
Open price
Close price
High price
Low price
Base asset volume
Number of trades
Is this kline closed?
Quote asset volume
Taker buy base asset volume
Taker buy quote asset volume
Ignore
}
Individual Symbol Mini Ticker Stream
24hr rolling window mini-ticker statistics. These are NOT the statistics
UTC day, but a 24hr rolling window for the previous 24hrs.
Stream Name:
the
of
Payload: @miniTicker
{
"e"
"E"
"s"
"c"
"o"
"h"
"l"
"v"
"q"
Update Speed: 1000ms
:
:
:
:
:
:
:
:
:
"24hrMiniTicker" ,
123456789 ,
"BNBBTC" ,
"0.0025" ,
"0.0010" ,
"0.0025" ,
"0.0010" ,
"10000" ,
"18"
//
//
//
//
//
//
//
//
//
Event type
Event time
Symbol
Close price
Open price
High price
Low price
Total traded base asset volume
Total traded quote asset volume
}
Market Mini Tickers Stream
All
24hr rolling window mini-ticker statistics for all symbols that changed in an
array. These are NOT the statistics of the UTC day, but a 24hr rolling window
for the previous 24hrs. Note that only tickers that have changed will be
present in the array.
Payload:
[
{
Stream Name:
// Same as @miniTicker payload
!miniTicker@arr
}
]
Update Speed: 1000ms
Individual Symbol Ticker Streams
24hr rolling window ticker statistics for a single symbol. These are NOT the
statistics of the UTC day, but a 24hr rolling window for the previous 24hrs.
Payload:
Stream Name:
{ @ticker
"e"
"E"
"s"
"p"
"P"
"w"
"x"
"c"
"Q"
"b"
"B"
"a"
"A"
"o"
"h"
"l"
"v"
"q"
"O"
"C"
"F"
"L"
"n"
Update Speed: 1000ms
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
"24hrTicker" ,
123456789 ,
"BNBBTC" ,
"0.0015" ,
"250.00" ,
"0.0018" ,
"0.0009" ,
"0.0025" ,
"10" ,
"0.0024" ,
"10" ,
"0.0026" ,
"100" ,
"0.0010" ,
"0.0025" ,
"0.0010" ,
"10000" ,
"18" ,
0,
86400000 ,
0,
18150 ,
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
Event type
Event time
Symbol
Price change
Price change percent
Weighted average price
First trade(F)-1 price (first trade before the 24hr
Last price
Last quantity
Best bid price
Best bid quantity
Best ask price
Best ask quantity
Open price
High price
Low price
Total traded base asset volume
Total traded quote asset volume
Statistics open time
Statistics close time
First trade ID
Last trade Id
Total number of trades
}
Market Tickers Stream
All
24hr rolling window ticker statistics for all symbols that changed in an array.
These are NOT the statistics of the UTC day, but a 24hr rolling window for
the previous 24hrs. Note that only tickers that have changed will be present
in the array.
Payload:
[
{
Stream Name:
// Same as @ticker
!ticker@arr
payload
}
]
Update Speed: 1000ms
Individual Symbol Book Ticker Streams
Pushes any update
a specified symbol.
Stream Name:
the best bid or ask's price or quantity
to
real-time
in
for
Payload: @bookTicker
{
"u"
"s"
"b"
"B"
"a"
"A"
Update Speed: Real-time
: 400900217 ,
// order book updateId
: "BNBUSDT" ,
// symbol
: "25.35190000" , // best bid price
: "31.21000000" , // best bid qty
: "25.36520000" , // best ask price
: "40.66000000" // best ask qty
}
Book Tickers Stream
All
Pushes any update
all symbols.
Stream Name:
the best bid or ask's price or quantity
to
real-time
in
for
Payload:
!bookTicker
{
// Same as @bookTicker payload
}
Update Speed: Real-time
Partial Book Depth Streams
Top bids and asks, Valid are
Stream Names:
s
10, or 20.
5,
Payload:
OR @depth @depth@100m
{
.
"lastUpdateId" : 160 ,
"bids" : [
[
"0.0024" ,
"10"
]
],
"asks" : [
[
"0.0026" ,
"100"
]
]
Update Speed: 1000ms or 100ms
// Last update ID
// Bids to be updated
// Price level to be updated
// Quantity
// Asks to be updated
// Price level to be updated
// Quantity
}
Diff. Depth Stream
Stream Name:
OR @depth @depth@100ms
Payload:
Update Speed: 1000ms or 100ms
{
Order book price and quantity depth updates used
order book.
locally manage an
to
"e" :
"E" :
"s" :
"U" :
"u" :
"b" :
[
"depthUpdate" , // Event type
123456789 ,
// Event time
"BNBBTC" ,
// Symbol
157 ,
// First update ID in event
160 ,
// Final update ID in event
[
// Bids to be updated
"0.0024" ,
"10"
// Price level to be updated
// Quantity
]
],
"a" : [
[
"0.0026" ,
"100"
]
]
// Asks to be updated
// Price level to be updated
// Quantity
}
How to manage
local order book correctly
a
Open a stream to wss://stream.binance.com:9443/ws/bnbbtc@depth
Buffer the events you receive from the stream.
Get a depth snapshot from https://api.binance.com/api/v3/depth?
symbol=BNBBTC&limit=Drop any event where u is <= lastUpdateId in the snapshot.
The first processed event should have U <= lastUpdateId +1 AND u >=
lastUpdateId +1.
While listening to the stream, each new event's U should be equal to the
previous event's u +1.
The data in each event is the absolute quantity for a price level.
If the quantity is 0, remove the price level.
Receiving an event that removes a price level that is not in your local
order book can happen and is normal.
.
.
Spot Account/Trade
Test New Order (TRADE)
POST /api/v3/order/test
(HMAC SHA256)
Response:
Test new order creation and signature/recvWindow long. Creates and
validates a new order but does not send it into the matching engine.
Weight:
{}
Parameters:
Same as
POST /api/v3/order
Data Source: Memory
New Order (TRADE)
POST /api/v3/order (HMAC SHA256)
Send
Response ACK:
new order.
in a
{
Weight(Uid):
"symbol" : "BTCUSDT" ,
"orderId" : 28 ,
"orderListId" : - 1 , //Unless OCO, value will be -"clientOrderId" : "6gCrw2kRUAF9CvJDGP16IP" ,
"transactTime" :
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
side
ENUM
YES
type
ENUM
YES
timeInForce
ENUM
NO
quantity
DECIMAL
NO
quoteOrderQty
DECIMAL
NO
price
DECIMAL
NO
newClientOrderId
STRING
NO
stopPrice
DECIMAL
}
Description
Response RESULT:
{
"symbol" : "BTCUSDT" ,
"orderId" : 28 ,
"orderListId" : - 1 , //Unless OCO, value will be -"clientOrderId" : "6gCrw2kRUAF9CvJDGP16IP" ,
"transactTime" : 1507725176595 ,
"price" : "0.00000000" ,
"origQty" : "10.00000000" ,
"executedQty" : "10.00000000" ,
"cummulativeQuoteQty" : "10.00000000" ,
"status" : "FILLED" ,
"timeInForce" : "GTC" ,
"type" : "MARKET" ,
"side" : "SELL"
A unique id among
open orders.
Automatically
generated if not sent.
NO
Used with
STOP_LOSS
STOP_LOSS_LIMIT
TAKE_PROFIT
}
Response FULL:
,
{
,
and
,
"symbol" : "BTCUSDT" ,
"orderId" : 28 ,
"orderListId" : - 1 , //Unless OCO, value will be -"clientOrderId" : "6gCrw2kRUAF9CvJDGP16IP" ,
"transactTime" : 1507725176595 ,
"price" : "0.00000000" ,
"origQty" : "10.00000000" ,
"executedQty" : "10.00000000" ,
"cummulativeQuoteQty" : "10.00000000" ,
"status" : "FILLED" ,
"timeInForce" : "GTC" ,
"type" : "MARKET" ,
"side" : "SELL" ,
"fills" : [
{
"price" : "4000.00000000" ,
"qty" : "1.00000000" ,
"commission" : "4.00000000" ,
"commissionAsset" : "USDT"
},
{
"price" : "3999.00000000" ,
"qty" : "5.00000000" ,
"commission" : "19.99500000" ,
"commissionAsset" : "USDT"
},
{
"price" : "3998.00000000" ,
"qty" : "2.00000000" ,
"commission" : "7.99600000" ,
"commissionAsset" : "USDT"
},
{
"price" : "3997.00000000" ,
"qty" : "1.00000000" ,
"commission" : "3.99700000" ,
"commissionAsset" : "USDT"
},
{
"price" : "3995.00000000" ,
"qty" : "1.00000000" ,
"commission" : "3.99500000" ,
"commissionAsset" : "USDT"
}
]
TAKE_PROFIT_LIMIT
orders.
icebergQty
DECIMAL
NO
Used with
LIMIT
,
STOP_LOSS_LIMIT
,
and
TAKE_PROFIT_LIMIT to
create an iceberg
order.
newOrderRespType
ENUM
NO
Set the response
JSON. ACK RESULT or
FULL MARKET and
LIMIT order types
default to FULL all
other orders default
,
,
;
,
to ACK
recvWindow
LONG
NO
timestamp
LONG
YES
.
The value cannot be
greater than
Additional mandatory parameters based on
type
:
Type
Additional mandatory parameters
LIMIT
timeInForce
MARKET
quantity
STOP_LOSS
quantity
STOP_LOSS_LIMIT
timeInForce
TAKE_PROFIT
quantity
TAKE_PROFIT_LIMIT
timeInForce
LIMIT_MAKER
quantity
Other
quantity
,
or
price
,
quoteOrderQty
stopPrice
,
quantity
,
,
price
,
stopPrice
,
price
,
stopPrice
stopPrice
,
quantity
,
}
price
,
info:
are LIMIT orders that will be rejected if they would
immediately match and trade as a taker.
STOP_LOSS and TAKE_PROFIT will execute a MARKET order when the stopP
rice is reached.
Any LIMIT or LIMIT_MAKER type order can be made an iceberg order by
sending an icebergQty
Any order with an icebergQty MUST have timeInForce set to GTC
MARKET orders using the quantity field specifies the amount of the base
asset the user wants to buy or sell at the market price.
For example, sending a MARKET order on BTCUSDT will specify how
much BTC the user is buying or selling.
MARKET orders using quoteOrderQty specifies the amount the user wants
to spend (when buying) or receive (when selling) the quote asset; the
correct quantity will be determined based on the market liquidity and q
LIMIT_MAKER
.
.
uoteOrderQty
.
Using BTCUSDT as an example:
On the BUY side, the order will buy as many BTC as quoteOrd
erQty USDT can.
On the SELL side, the order will sell as much BTC needed to
receive quoteOrderQty USDT.
MARKET orders using quoteOrderQty will not break LOT_SIZE filter rules;
the order will execute a quantity that will have the notional value as
close as possible to quoteOrderQty
same newClientOrderId can be accepted only when the previous one is
filled, otherwise the order will be rejected.
.
Trigger order price rules against market price
versions:
Price above market price:
Price below market price:
STOP_LOSS
BUY
STOP_LOSS
SELL
both MARKET and LIMIT
for
TAKE_PROFIT
,
SELL
TAKE_PROFIT
,
BUY
Data Source: Matching Engine
Cancel Order (TRADE)
DELETE /api/v3/order (HMAC SHA256)
Response:
Cancel an active order.
{
Weight(IP):
"symbol" : "LTCBTC" ,
"origClientOrderId" : "myOrder1" ,
"orderId" : 4 ,
"orderListId" : - 1 , //Unless part of an OCO, the value will always be -1.
"clientOrderId" : "cancelMyOrder1" ,
"price" : "2.00000000" ,
"origQty" : "1.00000000" ,
"executedQty" : "0.00000000" ,
"cummulativeQuoteQty" : "0.00000000" ,
"status" : "CANCELED" ,
"timeInForce" : "GTC" ,
"type" : "LIMIT" ,
"side" : "BUY"
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
orderId
LONG
NO
origClientOrderId
STRING
NO
Description
}
newClientOrderId
STRING
NO
Used
recvWindow
LONG
NO
The value cannot be
greater than
timestamp
LONG
YES
Either
or
orderId
uniquely identify
this cancel. Automatically
generated by default.
to
must be sent.
origClientOrderId
Data Source: Matching Engine
Cancel
Open Orders on
all
Symbol (TRADE)
a
DELETE api/v3/openOrders
Response:
Cancels all active orders on
This includes OCO orders.
symbol.
a
[
{
Weight(IP):
"symbol" : "BTCUSDT" ,
"origClientOrderId" : "E6APeyTJvkMvLMYMqu1KQ4" ,
"orderId" : 11 ,
"orderListId" : - 1 ,
"clientOrderId" : "pXLV6Hz6mprAcVYpVMTGgx" ,
"price" : "0.089853" ,
"origQty" : "0.178622" ,
"executedQty" : "0.000000" ,
"cummulativeQuoteQty" : "0.000000" ,
"status" : "CANCELED" ,
"timeInForce" : "GTC" ,
"type" : "LIMIT" ,
"side" : "BUY"
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
orderId
LONG
NO
origClientOrderId
STRING
NO
recvWindow
LONG
NO
timestamp
LONG
YES
Description
The value cannot be
greater than }
Notes:
Either orderId or origClientOrderId must be sent.
For some historical orders cummulativeQuoteQty will be <
data is not available at this time.
meaning the
0,
Data Source: Database
Current Open Orders (USER_DATA)
GET /api/v3/openOrders
Get all open orders on
symbol.
(HMAC SHA256)
Response:
symbol. Careful when accessing this with no
a
[
{
Weight(IP):
omitted
single symbol; 40 when the symbol parameter
3 for a
"symbol" : "LTCBTC" ,
"orderId" : 1 ,
"orderListId" : - 1 , //Unless OCO, the value will always be -"clientOrderId" : "myOrder1" ,
"price" : "0.1" ,
"origQty" : "1.0" ,
"executedQty" : "0.0" ,
"cummulativeQuoteQty" : "0.0" ,
"status" : "NEW" ,
"timeInForce" : "GTC" ,
"type" : "LIMIT" ,
"side" : "BUY" ,
"stopPrice" : "0.0" ,
"icebergQty" : "0.0" ,
"time" : 1499827319559 ,
"updateTime" : 1499827319559 ,
"isWorking" : true ,
"origQuoteOrderQty" : "0.000000"
is
Parameters:
Name
Type
Mandatory
symbol
STRING
NO
recvWindow
LONG
NO
timestamp
LONG
YES
the symbol
array.
The value cannot be greater
than
not sent, orders
is
If
Description
for
symbols
all
be returned
will
an
in
}
]
Data Source: Database
Orders (USER_DATA)
All
GET /api/v3/allOrders (HMAC SHA256)
Get
Response:
account orders; active, canceled, or
all
filled.
[
Weight(IP): 10 with symbol
{
"symbol" : "LTCBTC" ,
"orderId" : 1 ,
"orderListId" : - 1 , //Unless OCO, the value will always be -"clientOrderId" : "myOrder1" ,
"price" : "0.1" ,
"origQty" : "1.0" ,
"executedQty" : "0.0" ,
"cummulativeQuoteQty" : "0.0" ,
"status" : "NEW" ,
"timeInForce" : "GTC" ,
"type" : "LIMIT" ,
"side" : "BUY" ,
"stopPrice" : "0.0" ,
"icebergQty" : "0.0" ,
"time" : 1499827319559 ,
"updateTime" : 1499827319559 ,
"isWorking" : true ,
"origQuoteOrderQty" : "0.000000"
Parameters:
Name
Type
Mandatory
Description
symbol
STRING
YES
orderId
LONG
NO
startTime
LONG
NO
endTime
LONG
NO
limit
INT
NO
Default 500; max 1000.
recvWindow
LONG
NO
The value cannot be greater
than
timestamp
LONG
YES
}
]
Notes:
get orders >= that orderId Otherwise most
recent orders are returned.
For some historical orders cummulativeQuoteQty will be < 0, meaning the
data is not available at this time.
If startTime and/or endTime provided, orderId is not required.
orderId is set,
If
will
it
.
Data Source: Database
New OCO (TRADE)
POST /api/v3/order/oco (HMAC SHA256)
Send
Response:
new OCO
in a
{
Weight(Uid)
Parameters
"orderListId" : 0 ,
"contingencyType" : "OCO" ,
"listStatusType" : "EXEC_STARTED" ,
"listOrderStatus" : "EXECUTING" ,
"listClientOrderId" : "JYVpp3F0f5CAG15DhtrqLp" ,
"transactionTime" : 1563417480525 ,
"symbol" : "LTCBTC" ,
"orders" : [
{
"symbol" : "LTCBTC" ,
"orderId" : 2 ,
"clientOrderId" : "Kk7sqHb9J6mJWTMDVW7Vos"
},
{
"symbol" : "LTCBTC" ,
"orderId" : 3 ,
"clientOrderId" : "xTXKaGYd4bluPVp78IVRvl"
}
],
"orderReports" : [
{
"symbol" : "LTCBTC" ,
"orderId" : 2 ,
"orderListId" : 0 ,
"clientOrderId" : "Kk7sqHb9J6mJWTMDVW7Vos" ,
"transactTime" : 1563417480525 ,
"price" : "0.000000" ,
"origQty" : "0.624363" ,
"executedQty" : "0.000000" ,
"cummulativeQuoteQty" : "0.000000" ,
"status" : "NEW" ,
"timeInForce" : "GTC" ,
"type" : "STOP_LOSS" ,
"side" : "BUY" ,
"stopPrice" : "0.960664"
},
{
"symbol" : "LTCBTC" ,
"orderId" : 3 ,
"orderListId" : 0 ,
"clientOrderId" : "xTXKaGYd4bluPVp78IVRvl" ,
"transactTime" : 1563417480525 ,
"price" : "0.036435" ,
"origQty" : "0.624363" ,
"executedQty" : "0.000000" ,
"cummulativeQuoteQty" : "0.000000" ,
"status" : "NEW" ,
"timeInForce" : "GTC" ,
"type" : "LIMIT_MAKER" ,
"side" : "BUY"
}
]
:
:
Name
Type
Mandatory
symbol
STRING
YES
listClientOrderId
STRING
NO
side
ENUM
YES
quantity
DECIMAL
YES
limitClientOrderId
STRING
NO
price
DECIMAL
YES
limitIcebergQty
DECIMAL
NO
stopClientOrderId
STRING
NO
stopPrice
DECIMAL
YES
stopLimitPrice
DECIMAL
NO
Description
A unique Id for the
entire orderList
A unique Id
limit order
the
for
A unique Id for the
stop loss/stop loss
limit leg
provided,
If
stopLimitTimeInForce
required.
is
stopIcebergQty
DECIMAL
NO
stopLimitTimeInForce
ENUM
NO
Valid values are
GTC
FOK
/
IOC
/
newOrderRespType
ENUM
NO
Set the response
JSON.
recvWindow
LONG
NO
The value cannot be
greater than
timestamp
LONG
YES
}
Other Info:
Price Restrictions:
SELL Limit Price > Last Price > Stop Price
BUY Limit Price < Last Price < Stop Price
Quantity Restrictions:
Both legs must have the same quantity
ICEBERG quantities however do not have to be the same.
Order Rate Limit
OCO counts as 2 orders against the order rate limit.
:
:
Data Source: Matching Engine
Cancel OCO (TRADE)
Cancel an entire Order
DELETE /api/v3/orderList (HMAC SHA256)
Weight(IP)
List.
Response:
:
{
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
orderListId
LONG
NO
"orderListId" : 0 ,
"contingencyType" : "OCO" ,
"listStatusType" : "ALL_DONE" ,
"listOrderStatus" : "ALL_DONE" ,
"listClientOrderId" : "C3wyj4WVEktd7u9aVBRXcN" ,
"transactionTime" : 1574040868128 ,
"symbol" : "LTCBTC" ,
"orders" : [
{
"symbol" : "LTCBTC" ,
"orderId" : 2 ,
"clientOrderId" : "pO9ufTiFGg3nw2fOdgeOXa"
},
{
"symbol" : "LTCBTC" ,
"orderId" : 3 ,
"clientOrderId" : "TXOvglzXuaubXAaENpaRCB"
}
],
"orderReports" : [
{
"symbol" : "LTCBTC" ,
"origClientOrderId" : "pO9ufTiFGg3nw2fOdgeOXa" ,
"orderId" : 2 ,
"orderListId" : 0 ,
"clientOrderId" : "unfWT8ig8i0uj6lPuYLez6" ,
"price" : "1.00000000" ,
"origQty" : "10.00000000" ,
"executedQty" : "0.00000000" ,
"cummulativeQuoteQty" : "0.00000000" ,
"status" : "CANCELED" ,
"timeInForce" : "GTC" ,
"type" : "STOP_LOSS_LIMIT" ,
"side" : "SELL" ,
"stopPrice" : "1.00000000"
},
{
"symbol" : "LTCBTC" ,
"origClientOrderId" : "TXOvglzXuaubXAaENpaRCB" ,
"orderId" : 3 ,
"orderListId" : 0 ,
"clientOrderId" : "unfWT8ig8i0uj6lPuYLez6" ,
"price" : "3.00000000" ,
"origQty" : "10.00000000" ,
"executedQty" : "0.00000000" ,
"cummulativeQuoteQty" : "0.00000000" ,
"status" : "CANCELED" ,
"timeInForce" : "GTC" ,
"type" : "LIMIT_MAKER" ,
"side" : "SELL"
}
]
Description
Either
or
must
orderListId
listClientOrderId
be provided
listClientOrderId
STRING
NO
Either
or
must
orderListId
listClientOrderId
be provided
newClientOrderId
STRING
NO
Used
uniquely identify
this cancel. Automatically
generated by default
recvWindow
LONG
NO
The value cannot be
greater than
timestamp
LONG
YES
to
Additional notes:
Canceling an individual leg
cancel the entire OCO
will
Data Source: Matching Engine
}
Query OCO (USER_DATA)
GET /api/v3/orderList (HMAC SHA256)
Retrieves
Response:
specific OCO based on provided optional parameters
a
{
Weight(IP)
"orderListId" : 27 ,
"contingencyType" : "OCO" ,
"listStatusType" : "EXEC_STARTED" ,
"listOrderStatus" : "EXECUTING" ,
"listClientOrderId" : "h2USkA5YQpaXHPIrkd96xE" ,
"transactionTime" : 1565245656253 ,
"symbol" : "LTCBTC" ,
"orders" : [
{
"symbol" : "LTCBTC" ,
"orderId" : 4 ,
"clientOrderId" : "qD1gy3kc3Gx0rihm9Y3xwS"
},
{
"symbol" : "LTCBTC" ,
"orderId" : 5 ,
"clientOrderId" : "ARzZ9I00CPM8i3NhmU9Ega"
}
]
:
Parameters
:
Name
Type
Mandatory
Description
orderListId
LONG
NO
Either
or
must
orderListId
origClientOrderId
be provided
origClientOrderId
STRING
NO
Either
or
must
orderListId
origClientOrderId
be provided
recvWindow
LONG
timestamp
NO
LONG
The value cannot be
greater than
}
YES
Data Source: Database
Query
OCO (USER_DATA)
all
GET /api/v3/allOrderList (HMAC SHA256)
Retrieves
Response:
OCO based on provided optional parameters
all
[
Weight(IP)
{
:
"orderListId" : 29 ,
"contingencyType" : "OCO" ,
"listStatusType" : "EXEC_STARTED" ,
"listOrderStatus" : "EXECUTING" ,
"listClientOrderId" : "amEEAXryFzFwYF1FeRpUoZ" ,
"transactionTime" : 1565245913483 ,
"symbol" : "LTCBTC" ,
"orders" : [
{
"symbol" : "LTCBTC" ,
"orderId" : 4 ,
"clientOrderId" : "oD7aesZqjEGlZrbtRpy5zB"
},
{
"symbol" : "LTCBTC" ,
"orderId" : 5 ,
"clientOrderId" : "Jr1h6xirOxgeJOUuYQS7V3"
}
]
Parameters
Name
Type
Mandatory
Description
fromId
LONG
NO
If
startTime
LONG
NO
endTime
LONG
NO
limit
INT
NO
Default Value: 500; Max Value:
recvWindow
LONG
NO
The value cannot be greater
than
timestamp
LONG
supplied, neither startTime or
endTime can be provided
},
{
"orderListId" : 28 ,
"contingencyType" : "OCO" ,
"listStatusType" : "EXEC_STARTED" ,
"listOrderStatus" : "EXECUTING" ,
"listClientOrderId" : "hG7hFNxJV6cZy3Ze4AUT4d" ,
"transactionTime" : 1565245913407 ,
"symbol" : "LTCBTC" ,
"orders" : [
{
"symbol" : "LTCBTC" ,
"orderId" : 2 ,
"clientOrderId" : "j6lFOfbmFMRjTYA7rRJ0LP"
},
{
"symbol" : "LTCBTC" ,
"orderId" : 3 ,
"clientOrderId" : "z0KCjOdditiLS5ekAFtK81"
}
]
YES
Data Source: Database
}
]
Query Open OCO (USER_DATA)
GET /api/v3/openOrderList
Weight(IP)
(HMAC SHA256)
Response:
:
[
Parameters
{
Name
Type
Mandatory
Description
recvWindow
LONG
NO
The value cannot be greater
than
timestamp
LONG
YES
"orderListId" : 31 ,
"contingencyType" : "OCO" ,
"listStatusType" : "EXEC_STARTED" ,
"listOrderStatus" : "EXECUTING" ,
"listClientOrderId" : "wuB13fmulKj3YjdqWEcsnp" ,
"transactionTime" : 1565246080644 ,
"symbol" : "LTCBTC" ,
"orders" : [
{
"symbol" : "LTCBTC" ,
"orderId" : 4 ,
"clientOrderId" : "r3EH2N76dHfLoSZWIUw1bT"
},
{
"symbol" : "LTCBTC" ,
"orderId" : 5 ,
"clientOrderId" : "Cv1SnyPD3qhqpbjpYEHbd2"
}
]
Data Source: Database
}
]
Account Information (USER_DATA)
GET /api/v3/account (HMAC SHA256)
Response:
Get current account information.
{
Weight(IP):
"makerCommission" : 15 ,
"takerCommission" : 15 ,
"buyerCommission" : 0 ,
"sellerCommission" : 0 ,
"canTrade" : true ,
"canWithdraw" : true ,
"canDeposit" : true ,
"updateTime" : 123456789 ,
"accountType" : "SPOT" ,
"balances" : [
{
"asset" : "BTC" ,
"free" : "4723846.89208129" ,
"locked" : "0.00000000"
},
{
"asset" : "LTC" ,
"free" : "4763368.68006011" ,
"locked" : "0.00000000"
}
],
"permissions" : [
"SPOT"
]
Parameters:
Name
Type
Mandatory
Description
recvWindow
LONG
NO
The value cannot be greater
than
timestamp
LONG
YES
Data Source: Memory => Database
}
Account Trade
(USER_DATA)
List
GET /api/v3/myTrades (HMAC SHA256)
Get trades
Response:
specific account and symbol.
for a
[
Weight(IP):
{
"symbol" : "BNBBTC" ,
"id" : 28457 ,
"orderId" : 100234 ,
"orderListId" : - 1 , //Unless OCO, the value will always be -"price" : "4.00000100" ,
"qty" : "12.00000000" ,
"quoteQty" : "48.000012" ,
"commission" : "10.10000000" ,
"commissionAsset" : "BNB" ,
"time" : 1499865549590 ,
"isBuyer" : true ,
"isMaker" : false ,
"isBestMatch" : true
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
orderId
LONG
NO
startTime
LONG
Description
This can only be used in
combination with symbol
.
NO
}
]
endTime
LONG
NO
fromId
LONG
NO
TradeId to fetch from. Default
gets most recent trades.
limit
INT
NO
Default 500; max 1000.
recvWindow
LONG
NO
The value cannot be greater
than
timestamp
LONG
YES
Notes:
fromId is set,
If
get
will
it
>= that
id
fromId
Otherwise most recent
.
trades are returned.
Data Source: Database
Margin Account/Trade
Cross Margin Account Transfer (MARGIN)
POST /sapi/v1/margin/transfer (HMAC SHA256)
Response:
Execute transfer between spot account and cross margin account.
{
Weight(IP):
//transaction id
"tranId" : }
Parameters:
Name
Type
Mandatory
Description
asset
STRING
YES
The asset being transferred,
e.g., BTC
amount
DECIMAL
YES
The amount
transferred
type
INT
YES
1:
recvWindow
LONG
NO
The value cannot be greater
than
timestamp
LONG
YES
be
to
transfer from main account
to cross margin account 2:
transfer from cross margin
account to main account
Margin Account Borrow (MARGIN)
POST /sapi/v1/margin/loan
Apply
(HMAC SHA256)
Response:
loan.
for a
{
Weight(Uid):
//transaction id
"tranId" : }
Parameters:
Name
Type
Mandatory
Description
asset
STRING
YES
isIsolated
STRING
NO
for
symbol
STRING
NO
isolated symbol
amount
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
isolated margin or not,
"TRUE", "FALSE",default
"FALSE"
The value cannot be greater
than
"isIsolated" = "TRUE", "symbol" must be sent
"isIsolated" = "FALSE" for crossed margin loan
If
Margin Account Repay (MARGIN)
POST /sapi/v1/margin/repay
Repay loan
(HMAC SHA256)
Response:
margin account.
for
{
Weight(IP):
//transaction id
"tranId" : }
Parameters:
Name
Type
Mandatory
Description
asset
STRING
YES
isIsolated
STRING
NO
for
symbol
STRING
NO
isolated symbol
amount
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
isolated margin or not,
"TRUE", "FALSE",default
"FALSE"
The value cannot be greater
than
"isIsolated" = "TRUE", "symbol" must be sent
"isIsolated" = "FALSE" for crossed margin repay
If
Query Margin Asset (MARKET_DATA)
GET /sapi/v1/margin/asset
Response:
Weight(IP): {
Parameters:
Name
Type
Mandatory
asset
STRING
YES
"assetFullName" : "Binance Coin" ,
"assetName" : "BNB" ,
"isBorrowable" : false ,
"isMortgageable" : true ,
"userMinBorrow" : "0.00000000" ,
"userMinRepay" : "0.00000000"
Description
}
Query Cross Margin Pair (MARKET_DATA)
GET /sapi/v1/margin/pair
Response:
Weight(IP): {
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
"id" : 323355778339572400 ,
"symbol" : "BTCUSDT" ,
"base" : "BTC" ,
"quote" : "USDT" ,
"isMarginTrade" : true ,
"isBuyAllowed" : true ,
"isSellAllowed" : true
Description
}
Get All Margin Assets (MARKET_DATA)
GET /sapi/v1/margin/allAssets
Weight(IP):
Response:
{
Parameters:
Name
Type
Mandatory
asset
STRING
NO
type
STRING
NO
startTime
LONG
NO
endTime
LONG
NO
current
LONG
NO
Currently querying page. Start
from 1. Default:
size
LONG
NO
Default:10 Max:
archived
STRING
NO
Default: false Set
archived data from
ago
"rows" : [
{
"amount" : "0.10000000" ,
"asset" : "BNB" ,
"status" : "CONFIRMED" ,
"timestamp" : 1566898617 ,
"txId" : 5240372201 ,
"type" : "ROLL_IN"
},
{
"amount" : "5.00000000" ,
"asset" : "USDT" ,
"status" : "CONFIRMED" ,
"timestamp" : 1566888436 ,
"txId" : 5239810406 ,
"type" : "ROLL_OUT"
},
{
"amount" : "1.00000000" ,
"asset" : "EOS" ,
"status" : "CONFIRMED" ,
"timestamp" : 1566888403 ,
"txId" : 5239808703 ,
"type" : "ROLL_IN"
}
],
"total" :
Description
Transfer Type: ROLL_IN,
ROLL_OUT
to true for
.
recvWindow
LONG
NO
timestamp
LONG
YES
months
The value cannot be greater
than
Response in descending order
Returns data for last 7 days by default
Set archived to true to query data from
}
months ago
Query Loan Record (USER_DATA)
GET /sapi/v1/margin/loan (HMAC SHA256)
Response:
Weight(IP): {
Parameters:
Name
Type
Mandatory
asset
STRING
YES
isolatedSymbol
STRING
NO
isolated symbol
txId
LONG
NO
the tranId in POST
/sapi/v1/margin/loan
"rows" : [
{
"isolatedSymbol" : "BNBUSDT" , // isolated symbol, will not be returned
"txId" : 12807067523 ,
"asset" : "BNB" ,
"principal" : "0.84624403" ,
"timestamp" : 1555056425000 ,
"status" : "CONFIRMED"
//one of PENDING (pending execution), CONFIRMED
}
],
"total" :
Description
}
startTime
LONG
NO
endTime
LONG
NO
current
LONG
NO
Currently querying page.
Start from 1. Default:
size
LONG
NO
Default:10 Max:
archived
STRING
NO
Default: false Set to
for archived data from
months ago
true
.
recvWindow
LONG
NO
timestamp
LONG
YES
The value cannot be greater
than
txId or startTime must be sent. txId takes precedence.
Response in descending order
If isolatedSymbol is not sent, crossed margin data will be returned
Set archived to true to query data from 6 months ago
Query Repay Record (USER_DATA)
GET /sapi/v1/margin/repay
(HMAC SHA256)
Response:
Weight(IP): {
Parameters:
"rows" : [
{
Name
Type
Mandatory
asset
STRING
YES
isolatedSymbol
STRING
NO
isolated symbol
txId
LONG
NO
return of
/sapi/v1/margin/repay
"isolatedSymbol" : "BNBUSDT" , // isolated symbol, will not be
"amount" : "14.00000000" ,
//Total amount repaid
"asset" : "BNB" ,
"interest" : "0.01866667" ,
//Interest repaid
"principal" : "13.98133333" ,
//Principal repaid
"status" : "CONFIRMED" ,
//one of PENDING (pending execution),
"timestamp" : 1563438204000 ,
"txId" :
Description
}
],
"total" : }
startTime
LONG
NO
endTime
LONG
NO
current
LONG
NO
Currently querying page.
Start from 1. Default:
size
LONG
NO
Default:10 Max:
archived
STRING
NO
Default: false Set to
for archived data from
months ago
true
.
recvWindow
LONG
NO
timestamp
LONG
YES
The value cannot be greater
than
txId or startTime must be sent. txId takes precedence.
Response in descending order
If isolatedSymbol is not sent, crossed margin data will be returned
Set archived to true to query data from 6 months ago
Get Interest History (USER_DATA)
GET /sapi/v1/margin/interestHistory (HMAC SHA256)
Weight(IP):
Response:
{
Parameters:
"rows" :[
{
"isolatedSymbol" : "BNBUSDT" , // isolated symbol, will not be
"asset" : "BNB" ,
"interest" : "0.02414667" ,
"interestAccuredTime" : 1566813600000 ,
"interestRate" : "0.01600000" ,
"principal" : "36.22000000" ,
"type" : "ON_BORROW"
Name
Type
Mandatory
Description
asset
STRING
NO
isolatedSymbol
STRING
NO
startTime
LONG
NO
endTime
LONG
NO
current
LONG
NO
Currently querying page.
Start from 1. Default:
size
LONG
NO
Default:10 Max:
archived
STRING
NO
Default: false Set to
for archived data from
months ago
isolated symbol
returned
}
],
"total" : }
true
.
recvWindow
LONG
NO
timestamp
LONG
YES
The value cannot be greater
than
Response in descending order
If isolatedSymbol is not sent, crossed margin data will be returned
Set archived to true to query data from 6 months ago
type in response has 4 enums:
PERIODIC interest charged per hour
ON_BORROW first interest charged on borrow
PERIODIC_CONVERTED interest charged per hour converted into BNB
ON_BORROW_CONVERTED first interest charged on borrow converted
into BNB
Get Force Liquidation Record (USER_DATA)
GET /sapi/v1/margin/forceLiquidationRec (HMAC SHA256)
Weight(IP):
Response:
{
Parameters:
"rows" : [
{
"avgPrice" : "0.00388359" ,
"executedQty" : "31.39000000" ,
"orderId" : 180015097 ,
"price" : "0.00388110" ,
"qty" : "31.39000000" ,
"side" : "SELL" ,
"symbol" : "BNBBTC" ,
"timeInForce" : "GTC" ,
"isIsolated" : true ,
"updatedTime" : }
],
"total" :
Name
Type
Mandatory
startTime
LONG
NO
endTime
LONG
NO
isolatedSymbol
STRING
NO
current
LONG
NO
Currently querying page.
Start from 1. Default:
size
LONG
NO
Default:10 Max:
recvWindow
LONG
NO
The value cannot be greater
than
timestamp
LONG
YES
Response
Description
}
descending order
in
Query Cross Margin Account Details (USER_DATA)
GET /sapi/v1/margin/account (HMAC SHA256)
Response:
Weight(IP): {
Parameters:
Name
Type
Mandatory
Description
recvWindow
LONG
NO
The value cannot be greater
than
timestamp
LONG
YES
"borrowEnabled" : true ,
"marginLevel" : "11.64405625" ,
"totalAssetOfBtc" : "6.82728457" ,
"totalLiabilityOfBtc" : "0.58633215" ,
"totalNetAssetOfBtc" : "6.24095242" ,
"tradeEnabled" : true ,
"transferEnabled" : true ,
"userAssets" : [
{
"asset" : "BTC" ,
"borrowed" : "0.00000000" ,
"free" : "0.00499500" ,
"interest" : "0.00000000" ,
"locked" : "0.00000000" ,
"netAsset" : "0.00499500"
},
{
"asset" : "BNB" ,
"borrowed" : "201.66666672" ,
"free" : "2346.50000000" ,
"interest" : "0.00000000" ,
"locked" : "0.00000000" ,
"netAsset" : "2144.83333328"
},
{
"asset" : "ETH" ,
"borrowed" : "0.00000000" ,
"free" : "0.00000000" ,
"interest" : "0.00000000" ,
"locked" : "0.00000000" ,
"netAsset" : "0.00000000"
},
{
"asset" : "USDT" ,
"borrowed" : "0.00000000" ,
"free" : "0.00000000" ,
"interest" : "0.00000000" ,
"locked" : "0.00000000" ,
"netAsset" : "0.00000000"
}
]
}
Query Margin Account's Order (USER_DATA)
GET /sapi/v1/margin/order
(HMAC SHA256)
Response:
Weight(IP): {
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
isIsolated
STRING
NO
orderId
LONG
NO
origClientOrderId
STRING
NO
recvWindow
LONG
NO
timestamp
LONG
YES
"clientOrderId" : "ZwfQzuDIGpceVhKW5DvCmO" ,
"cummulativeQuoteQty" : "0.00000000" ,
"executedQty" : "0.00000000" ,
"icebergQty" : "0.00000000" ,
"isWorking" : true ,
"orderId" : 213205622 ,
"origQty" : "0.30000000" ,
"price" : "0.00493630" ,
"side" : "SELL" ,
"status" : "NEW" ,
"stopPrice" : "0.00000000" ,
"symbol" : "BNBBTC" ,
"isIsolated" : true ,
"time" : 1562133008725 ,
"timeInForce" : "GTC" ,
"type" : "LIMIT" ,
"updateTime" :
Description
isolated margin or
not, "TRUE", "FALSE",
default "FALSE"
for
The value cannot be
greater than
Either orderId or origClientOrderId must be sent.
For some historical orders cummulativeQuoteQty
the data is not available at this time.
be <
will
}
meaning
0,
Query Margin Account's Open Orders (USER_DATA)
GET /sapi/v1/margin/openOrders
(HMAC SHA256)
Response:
Weight(IP): [
Parameters:
{
Name
Type
Mandatory
symbol
STRING
NO
isIsolated
STRING
NO
for
recvWindow
LONG
NO
The value cannot be greater
than
timestamp
LONG
YES
"clientOrderId" : "qhcZw71gAkCCTv0t0k8LUK" ,
"cummulativeQuoteQty" : "0.00000000" ,
"executedQty" : "0.00000000" ,
"icebergQty" : "0.00000000" ,
"isWorking" : true ,
"orderId" : 211842552 ,
"origQty" : "0.30000000" ,
"price" : "0.00475010" ,
"side" : "SELL" ,
"status" : "NEW" ,
"stopPrice" : "0.00000000" ,
"symbol" : "BNBBTC" ,
"isIsolated" : true ,
"time" : 1562040170089 ,
"timeInForce" : "GTC" ,
"type" : "LIMIT" ,
"updateTime" :
Description
isolated margin or not,
"TRUE", "FALSE",default
"FALSE"
}
the symbol is not sent, orders for all symbols will be returned in an
array.
When all symbols are returned, the number of requests counted against
the rate limiter is equal to the number of symbols currently trading on
the exchange.
If isIsolated ="TRUE", symbol must be sent.
If
]
Query Margin Account's All Orders (USER_DATA)
GET /sapi/v1/margin/allOrders (HMAC SHA256)
Response:
Weight(IP): [
Request Limit
60times/min per
{
"clientOrderId" : "D2KDy4DIeS56PvkM13f8cP" ,
"cummulativeQuoteQty" : "0.00000000" ,
"executedQty" : "0.00000000" ,
"icebergQty" : "0.00000000" ,
"isWorking" : false ,
"orderId" : 41295 ,
"origQty" : "5.31000000" ,
"price" : "0.22500000" ,
"side" : "SELL" ,
"status" : "CANCELED" ,
"stopPrice" : "0.18000000" ,
"symbol" : "BNBBTC" ,
"isIsolated" : false ,
"time" : 1565769338806 ,
"timeInForce" : "GTC" ,
"type" : "TAKE_PROFIT_LIMIT" ,
"updateTime" :
IP
Parameters:
Name
Type
Mandatory
Description
symbol
STRING
YES
isIsolated
STRING
NO
orderId
LONG
NO
startTime
LONG
NO
endTime
LONG
NO
limit
INT
NO
Default 500; max 500.
recvWindow
LONG
NO
The value cannot be greater
than
timestamp
LONG
YES
isolated margin or not,
"TRUE", "FALSE",default
"FALSE"
for
},
{
"clientOrderId" : "gXYtqhcEAs2Rn9SUD9nRKx" ,
"cummulativeQuoteQty" : "0.00000000" ,
"executedQty" : "0.00000000" ,
"icebergQty" : "1.00000000" ,
"isWorking" : true ,
"orderId" : 41296 ,
"origQty" : "6.65000000" ,
"price" : "0.18000000" ,
"side" : "SELL" ,
"status" : "CANCELED" ,
"stopPrice" : "0.00000000" ,
"symbol" : "BNBBTC" ,
"isIsolated" : false ,
"time" : 1565769348687 ,
"timeInForce" : "GTC" ,
"type" : "LIMIT" ,
"updateTime" :
orderId is set, it will get orders >= that orderId. Otherwise most recent
orders are returned.
For some historical orders cummulativeQuoteQty will be < 0, meaning
the data is not available at this time.
If
},
{
"clientOrderId" : "duDq1BqohhcMmdMs9FSuDy" ,
"cummulativeQuoteQty" : "0.39450000" ,
"executedQty" : "2.63000000" ,
"icebergQty" : "0.00000000" ,
"isWorking" : true ,
"orderId" : 41297 ,
"origQty" : "2.63000000" ,
"price" : "0.00000000" ,
"side" : "SELL" ,
"status" : "FILLED" ,
"stopPrice" : "0.00000000" ,
"symbol" : "BNBBTC" ,
"isIsolated" : false ,
"time" : 1565769358139 ,
"timeInForce" : "GTC" ,
"type" : "MARKET" ,
"updateTime" : }
]
Margin Account New OCO (TRADE)
POST /sapi/v1/margin/order/oco
Send
new OCO
in a
(HMAC SHA256)
Response:
margin account
for a
{
Weight(Uid)
Parameters
"orderListId" : 0 ,
"contingencyType" : "OCO" ,
"listStatusType" : "EXEC_STARTED" ,
"listOrderStatus" : "EXECUTING" ,
"listClientOrderId" : "JYVpp3F0f5CAG15DhtrqLp" ,
"transactionTime" : 1563417480525 ,
"symbol" : "LTCBTC" ,
"marginBuyBorrowAmount" : "5" ,
// will not return if no margin trade
"marginBuyBorrowAsset" : "BTC" ,
// will not return if no margin trade
"isIsolated" : false ,
// if isolated margin
"orders" : [
{
"symbol" : "LTCBTC" ,
"orderId" : 2 ,
"clientOrderId" : "Kk7sqHb9J6mJWTMDVW7Vos"
},
{
"symbol" : "LTCBTC" ,
"orderId" : 3 ,
"clientOrderId" : "xTXKaGYd4bluPVp78IVRvl"
}
],
"orderReports" : [
{
"symbol" : "LTCBTC" ,
"orderId" : 2 ,
"orderListId" : 0 ,
"clientOrderId" : "Kk7sqHb9J6mJWTMDVW7Vos" ,
"transactTime" : 1563417480525 ,
"price" : "0.000000" ,
"origQty" : "0.624363" ,
"executedQty" : "0.000000" ,
"cummulativeQuoteQty" : "0.000000" ,
"status" : "NEW" ,
"timeInForce" : "GTC" ,
"type" : "STOP_LOSS" ,
"side" : "BUY" ,
"stopPrice" : "0.960664"
},
{
"symbol" : "LTCBTC" ,
"orderId" : 3 ,
"orderListId" : 0 ,
"clientOrderId" : "xTXKaGYd4bluPVp78IVRvl" ,
"transactTime" : 1563417480525 ,
"price" : "0.036435" ,
"origQty" : "0.624363" ,
"executedQty" : "0.000000" ,
"cummulativeQuoteQty" : "0.000000" ,
"status" : "NEW" ,
"timeInForce" : "GTC" ,
"type" : "LIMIT_MAKER" ,
"side" : "BUY"
}
]
:
:
Name
Type
Mandatory
symbol
STRING
YES
Description
happens
isIsolated
STRING
NO
for
isolated margin or
not, "TRUE",
"FALSE",default
"FALSE"
listClientOrderId
STRING
NO
A unique Id for the
entire orderList
side
ENUM
YES
quantity
DECIMAL
YES
limitClientOrderId
STRING
NO
price
DECIMAL
YES
limitIcebergQty
DECIMAL
NO
stopClientOrderId
STRING
NO
stopPrice
DECIMAL
YES
stopLimitPrice
DECIMAL
NO
A unique Id
limit order
the
for
A unique Id for the
stop loss/stop loss
limit leg
provided,
If
stopLimitTimeInForce
required.
is
stopIcebergQty
DECIMAL
NO
stopLimitTimeInForce
ENUM
NO
Valid values are
GTC
FOK
/
IOC
/
newOrderRespType
ENUM
NO
Set the response
JSON.
sideEffectType
ENUM
NO
NO_SIDE_EFFECT,
MARGIN_BUY,
AUTO_REPAY; default
NO_SIDE_EFFECT.
recvWindow
LONG
NO
The value cannot be
greater than
timestamp
LONG
YES
}
Other Info:
Price Restrictions:
SELL Limit Price > Last Price > Stop Price
BUY Limit Price < Last Price < Stop Price
Quantity Restrictions:
Both legs must have the same quantity
ICEBERG quantities however do not have to be the same.
Order Rate Limit
OCO counts as 2 orders against the order rate limit.
:
:
Margin Account Cancel OCO (TRADE)
DELETE /sapi/v1/margin/orderList (HMAC SHA256)
Cancel an entire Order
Response:
margin account.
List for a
{
Weight(Uid)
"orderListId" : 0 ,
"contingencyType" : "OCO" ,
"listStatusType" : "ALL_DONE" ,
"listOrderStatus" : "ALL_DONE" ,
"listClientOrderId" : "C3wyj4WVEktd7u9aVBRXcN" ,
"transactionTime" : 1574040868128 ,
"symbol" : "LTCBTC" ,
"isIsolated" : false ,
// if isolated margin
"orders" : [
{
"symbol" : "LTCBTC" ,
"orderId" : 2 ,
"clientOrderId" : "pO9ufTiFGg3nw2fOdgeOXa"
},
{
"symbol" : "LTCBTC" ,
"orderId" : 3 ,
"clientOrderId" : "TXOvglzXuaubXAaENpaRCB"
}
],
"orderReports" : [
{
"symbol" : "LTCBTC" ,
"origClientOrderId" : "pO9ufTiFGg3nw2fOdgeOXa" ,
"orderId" : 2 ,
"orderListId" : 0 ,
"clientOrderId" : "unfWT8ig8i0uj6lPuYLez6" ,
"price" : "1.00000000" ,
"origQty" : "10.00000000" ,
"executedQty" : "0.00000000" ,
"cummulativeQuoteQty" : "0.00000000" ,
"status" : "CANCELED" ,
"timeInForce" : "GTC" ,
"type" : "STOP_LOSS_LIMIT" ,
"side" : "SELL" ,
"stopPrice" : "1.00000000"
},
{
"symbol" : "LTCBTC" ,
"origClientOrderId" : "TXOvglzXuaubXAaENpaRCB" ,
"orderId" : 3 ,
"orderListId" : 0 ,
"clientOrderId" : "unfWT8ig8i0uj6lPuYLez6" ,
"price" : "3.00000000" ,
"origQty" : "10.00000000" ,
"executedQty" : "0.00000000" ,
"cummulativeQuoteQty" : "0.00000000" ,
"status" : "CANCELED" ,
"timeInForce" : "GTC" ,
"type" : "LIMIT_MAKER" ,
"side" : "SELL"
}
]
:
Parameters:
Name
Type
Mandatory
Description
symbol
STRING
YES
isIsolated
STRING
NO
for
orderListId
LONG
NO
Either
isolated margin or
not, "TRUE", "FALSE",
default "FALSE"
or
must
orderListId
listClientOrderId
be provided
listClientOrderId
STRING
NO
Either
or
must
orderListId
listClientOrderId
be provided
newClientOrderId
STRING
NO
Used
uniquely identify
this cancel. Automatically
generated by default
recvWindow
LONG
NO
The value cannot be
greater than
timestamp
LONG
YES
to
Additional notes:
Canceling an individual leg
cancel the entire OCO
will
}
Query Margin Account's OCO (USER_DATA)
GET /sapi/v1/margin/orderList (HMAC SHA256)
Retrieves
Response:
specific OCO based on provided optional parameters
a
{
Weight(IP)
"orderListId" : 27 ,
"contingencyType" : "OCO" ,
"listStatusType" : "EXEC_STARTED" ,
"listOrderStatus" : "EXECUTING" ,
"listClientOrderId" : "h2USkA5YQpaXHPIrkd96xE" ,
"transactionTime" : 1565245656253 ,
"symbol" : "LTCBTC" ,
"isIsolated" : false ,
// if isolated margin
"orders" : [
{
"symbol" : "LTCBTC" ,
"orderId" : 4 ,
"clientOrderId" : "qD1gy3kc3Gx0rihm9Y3xwS"
},
{
"symbol" : "LTCBTC" ,
"orderId" : 5 ,
"clientOrderId" : "ARzZ9I00CPM8i3NhmU9Ega"
}
]
:
Parameters
:
Name
Type
Mandatory
Description
isIsolated
STRING
NO
for
symbol
STRING
NO
mandatory for isolated
margin, not supported
cross margin
orderListId
LONG
isolated margin or
not, "TRUE", "FALSE",
default "FALSE"
NO
Either
for
or
must
orderListId
origClientOrderId
be provided
origClientOrderId
STRING
NO
Either
}
or
must
orderListId
origClientOrderId
be provided
recvWindow
LONG
NO
The value cannot be
greater than
timestamp
LONG
YES
Query Margin Account's
all
GET /sapi/v1/margin/allOrderList
(HMAC SHA256)
Retrieves all OCO
parameters
OCO (USER_DATA)
Response:
specific margin account based on provided optional
for a
[
{
"orderListId" : 29 ,
"contingencyType" : "OCO" ,
"listStatusType" : "EXEC_STARTED" ,
"listOrderStatus" : "EXECUTING" ,
"listClientOrderId" : "amEEAXryFzFwYF1FeRpUoZ" ,
"transactionTime" : 1565245913483 ,
"symbol" : "LTCBTC" ,
"isIsolated" : true ,
// if isolated margin
"orders" : [
{
"symbol" : "LTCBTC" ,
"orderId" : 4 ,
"clientOrderId" : "oD7aesZqjEGlZrbtRpy5zB"
},
{
"symbol" : "LTCBTC" ,
"orderId" : 5 ,
"clientOrderId" : "Jr1h6xirOxgeJOUuYQS7V3"
}
]
Weight(IP) :
Parameters
Name
Type
Mandatory
Description
isIsolated
STRING
NO
for
symbol
STRING
NO
mandatory for isolated margin,
not supported for cross margin
fromId
LONG
NO
startTime
LONG
NO
endTime
LONG
NO
limit
INT
NO
Default Value: 500; Max Value:
recvWindow
LONG
NO
The value cannot be greater
than
timestamp
LONG
YES
isolated margin or not,
"TRUE", "FALSE",default
"FALSE"
supplied, neither startTime
or endTime can be provided
If
},
{
"orderListId" : 28 ,
"contingencyType" : "OCO" ,
"listStatusType" : "EXEC_STARTED" ,
"listOrderStatus" : "EXECUTING" ,
"listClientOrderId" : "hG7hFNxJV6cZy3Ze4AUT4d" ,
"transactionTime" : 1565245913407 ,
"symbol" : "LTCBTC" ,
"orders" : [
{
"symbol" : "LTCBTC" ,
"orderId" : 2 ,
"clientOrderId" : "j6lFOfbmFMRjTYA7rRJ0LP"
},
{
"symbol" : "LTCBTC" ,
"orderId" : 3 ,
"clientOrderId" : "z0KCjOdditiLS5ekAFtK81"
}
]
}
]
Query Margin Account's Open OCO (USER_DATA)
GET /sapi/v1/margin/openOrderList (HMAC SHA256)
Response:
Weight(IP) :
[
Parameters
{
Name
Type
Mandatory
Description
isIsolated
STRING
NO
for
symbol
STRING
NO
mandatory for isolated margin,
not supported for cross margin
recvWindow
LONG
NO
The value cannot be greater
than
timestamp
LONG
YES
"orderListId" : 31 ,
"contingencyType" : "OCO" ,
"listStatusType" : "EXEC_STARTED" ,
"listOrderStatus" : "EXECUTING" ,
"listClientOrderId" : "wuB13fmulKj3YjdqWEcsnp" ,
"transactionTime" : 1565246080644 ,
"symbol" : "LTCBTC" ,
"isIsolated" : false ,
// if isolated margin
"orders" : [
{
"symbol" : "LTCBTC" ,
"orderId" : 4 ,
"clientOrderId" : "r3EH2N76dHfLoSZWIUw1bT"
},
{
"symbol" : "LTCBTC" ,
"orderId" : 5 ,
"clientOrderId" : "Cv1SnyPD3qhqpbjpYEHbd2"
}
]
isolated margin or not,
"TRUE", "FALSE",default
"FALSE"
}
]
Query Margin Account's Trade
(USER_DATA)
List
GET /sapi/v1/margin/myTrades (HMAC SHA256)
Response:
Weight(IP): [
Parameters:
{
Name
Type
Mandatory
symbol
STRING
YES
isIsolated
STRING
NO
startTime
LONG
NO
"commission" : "0.00006000" ,
"commissionAsset" : "BTC" ,
"id" : 34 ,
"isBestMatch" : true ,
"isBuyer" : false ,
"isMaker" : false ,
"orderId" : 39324 ,
"price" : "0.02000000" ,
"qty" : "3.00000000" ,
"symbol" : "BNBBTC" ,
"isIsolated" : false ,
"time" :
Description
isolated margin or not,
"TRUE", "FALSE",default
"FALSE"
for
}
]
endTime
LONG
NO
fromId
LONG
NO
TradeId to fetch from. Default
gets most recent trades.
limit
INT
NO
Default 500; max 1000.
recvWindow
LONG
NO
The value cannot be greater
than
timestamp
LONG
YES
fromId is set, it will get trades >= that fromId. Otherwise most recent
trades are returned.
If
Query Max Borrow (USER_DATA)
GET /sapi/v1/margin/maxBorrowable (HMAC SHA256)
Response:
Weight(IP): {
Parameters:
"amount" : "1.69248805" , // account's currently max borrowable amount with
"borrowLimit" : "60" // max borrowable amount limited by the account level
}
Name
Type
Mandatory
Description
asset
STRING
YES
isolatedSymbol
STRING
NO
isolated symbol
recvWindow
LONG
NO
The value cannot be greater
than
timestamp
LONG
YES
isolatedSymbol is not sent, crossed margin data will be sent.
borrowLimit is also available from https://www.binance.com/en/marginfee
If
Query Max Transfer-Out Amount (USER_DATA)
GET /sapi/v1/margin/maxTransferable (HMAC SHA256)
Response:
Weight(IP): {
Parameters:
"amount" : "3.59498107"
}
Name
Type
Mandatory
asset
STRING
YES
isolatedSymbol
STRING
NO
isolated symbol
recvWindow
LONG
NO
The value cannot be greater
than
timestamp
LONG
YES
isolatedSymbol
If
Description
not sent, crossed margin data
is
be sent.
will
Isolated Margin Account Transfer (MARGIN)
POST /sapi/v1/margin/isolated/transfer
(HMAC SHA256)
Response:
Weight(Uid): {
Parameters:
//transaction id
"tranId" : }
Name
Type
Mandatory
Description
asset
STRING
YES
asset,such as BTC
symbol
STRING
YES
transFrom
STRING
YES
"SPOT", "ISOLATED_MARGIN"
transTo
STRING
YES
"SPOT", "ISOLATED_MARGIN"
amount
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
No more than
Get Isolated Margin Transfer History (USER_DATA)
GET /sapi/v1/margin/isolated/transfer (HMAC SHA256)
Weight(IP):
Response:
{
Parameters:
Name
Type
Mandatory
asset
STRING
NO
symbol
STRING
YES
transFrom
STRING
NO
"SPOT", "ISOLATED_MARGIN"
transTo
STRING
NO
"SPOT", "ISOLATED_MARGIN"
startTime
LONG
NO
endTime
LONG
NO
current
LONG
NO
Current page, default
size
LONG
NO
Default 10, max
recvWindow
LONG
NO
No more than
timestamp
LONG
YES
"rows" : [
{
"amount" : "0.10000000" ,
"asset" : "BNB" ,
"status" : "CONFIRMED" ,
"timestamp" : 1566898617000 ,
"txId" : 5240372201 ,
"transFrom" : "SPOT" ,
"transTo" : "ISOLATED_MARGIN"
},
{
"amount" : "5.00000000" ,
"asset" : "USDT" ,
"status" : "CONFIRMED" ,
"timestamp" : 1566888436123 ,
"txId" : 5239810406 ,
"transFrom" : "ISOLATED_MARGIN" ,
"transTo" : "SPOT"
}
],
"total" :
Description
}
Query Isolated Margin Account Info (USER_DATA)
GET /sapi/v1/margin/isolated/account (HMAC SHA256)
Response:
Weight(IP):
"symbols"
If
is
not sent
Parameters:
{
Name
Type
Mandatory
Description
symbols
STRING
NO
Max 5 symbols can be sent;
separated by ",". e.g.
"BTCUSDT,BNBUSDT,ADAUSDT"
recvWindow
LONG
NO
No more than
timestamp
LONG
YES
"symbols"
If "symbols"
returned.
not sent, all isolated assets will be returned.
sent, only the isolated assets of the sent symbols
is
If
is
"assets" :[
{
"baseAsset" :
{
"asset" : "BTC" ,
"borrowEnabled" : true ,
"borrowed" : "0.00000000" ,
"free" : "0.00000000" ,
"interest" : "0.00000000" ,
"locked" : "0.00000000" ,
"netAsset" : "0.00000000" ,
"netAssetOfBtc" : "0.00000000" ,
"repayEnabled" : true ,
"totalAsset" : "0.00000000"
},
"quoteAsset" :
{
"asset" : "USDT" ,
"borrowEnabled" : true ,
"borrowed" : "0.00000000" ,
"free" : "0.00000000" ,
"interest" : "0.00000000" ,
"locked" : "0.00000000" ,
"netAsset" : "0.00000000" ,
"netAssetOfBtc" : "0.00000000" ,
"repayEnabled" : true ,
"totalAsset" : "0.00000000"
},
"symbol" : "BTCUSDT" ,
"isolatedCreated" : true ,
"enabled" : true , // true-enabled, false-disabled
"marginLevel" : "0.00000000" ,
"marginLevelStatus" : "EXCESSIVE" , // "EXCESSIVE", "NORMAL", "MARGIN_CALL",
"marginRatio" : "0.00000000" ,
"indexPrice" : "10000.00000000" ,
"liquidatePrice" : "1000.00000000" ,
"liquidateRate" : "1.00000000" ,
"tradeEnabled" : true
}
],
"totalAssetOfBtc" : "0.00000000" ,
"totalLiabilityOfBtc" : "0.00000000" ,
"totalNetAssetOfBtc" : "0.00000000"
be
will
}
"symbols"
If
is
sent
{
"assets" :[
{
"baseAsset" :
{
"asset" : "BTC" ,
"borrowEnabled" : true ,
"borrowed" : "0.00000000" ,
"free" : "0.00000000" ,
"interest" : "0.00000000" ,
"locked" : "0.00000000" ,
"netAsset" : "0.00000000" ,
"netAssetOfBtc" : "0.00000000" ,
"repayEnabled" : true ,
"totalAsset" : "0.00000000"
},
"quoteAsset" :
{
"asset" : "USDT" ,
"borrowEnabled" : true ,
"borrowed" : "0.00000000" ,
"free" : "0.00000000" ,
"interest" : "0.00000000" ,
"locked" : "0.00000000" ,
"netAsset" : "0.00000000" ,
"netAssetOfBtc" : "0.00000000" ,
"repayEnabled" : true ,
"totalAsset" : "0.00000000"
},
"symbol" : "BTCUSDT" ,
"isolatedCreated" : true ,
"enabled" : true , // true-enabled, false-disabled
"marginLevel" : "0.00000000" ,
"marginLevelStatus" : "EXCESSIVE" , // "EXCESSIVE", "NORMAL", "MARGIN_CALL",
"marginRatio" : "0.00000000" ,
"indexPrice" : "10000.00000000" ,
"liquidatePrice" : "1000.00000000" ,
"liquidateRate" : "1.00000000" ,
"tradeEnabled" : true
}
]
}
Disable Isolated Margin Account (TRADE)
DELETE /sapi/v1/margin/isolated/account (HMAC SHA256)
Response:
Disable isolated margin account for a specific symbol. Each trading pair can
only be deactivated once every 24 hours.
{
"success" : true ,
"symbol" : "BTCUSDT"
Weight(Uid):
}
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Description
No more than
Enable Isolated Margin Account (TRADE)
POST /sapi/v1/margin/isolated/account (HMAC SHA256)
Enable isolated margin account
Response:
specific symbol.
for a
{
Weight(Uid):
"success" : true ,
"symbol" : "BTCUSDT"
}
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Description
No more than
Query Enabled Isolated Margin Account Limit
(USER_DATA)
GET /sapi/v1/margin/isolated/accountLimit
Query enabled isolated margin account
(HMAC SHA256)
Response:
limit.
{
Weight(IP):
"enabledAccount" : 5 ,
"maxAccount" :
}
Parameters:
Name
Type
Mandatory
Description
recvWindow
LONG
NO
No more than
timestamp
LONG
YES
Query Isolated Margin Symbol (USER_DATA)
GET /sapi/v1/margin/isolated/pair (HMAC SHA256)
Response:
Weight(IP): {
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
"symbol" : "BTCUSDT" ,
"base" : "BTC" ,
"quote" : "USDT" ,
"isMarginTrade" : true ,
"isBuyAllowed" : true ,
"isSellAllowed" : true
Description
}
recvWindow
LONG
NO
No more than
timestamp
LONG
YES
Get All Isolated Margin Symbol(USER_DATA)
GET /sapi/v1/margin/isolated/allPairs (HMAC SHA256)
Response:
Weight(IP): [
Parameters:
{
Name
Type
Mandatory
Description
recvWindow
LONG
NO
No more than
timestamp
LONG
YES
"base" : "BNB" ,
"isBuyAllowed" : true ,
"isMarginTrade" : true ,
"isSellAllowed" : true ,
"quote" : "BTC" ,
"symbol" : "BNBBTC"
},
{
"base" : "TRX" ,
"isBuyAllowed" : true ,
"isMarginTrade" : true ,
"isSellAllowed" : true ,
"quote" : "BTC" ,
"symbol" : "TRXBTC"
}
]
Toggle BNB Burn On Spot Trade And Margin
Interest (USER_DATA)
POST /sapi/v1/bnbBurn
Weight(IP):
(HMAC SHA256)
Response:
{
Parameters:
"spotBNBBurn" : true ,
"interestBNBBurn" : false
}
Name
Type
Mandatory
Description
spotBNBBurn
STRING
NO
"true" or "false";
Determines whether to use
BNB to pay for trading
fees on SPOT
interestBNBBurn
STRING
NO
"true" or "false";
Determines whether to use
BNB to pay for margin
loan's interest
recvWindow
LONG
NO
No more than
timestamp
LONG
YES
"spotBNBBurn" and "interestBNBBurn" should be sent
least one.
at
Get BNB Burn Status (USER_DATA)
GET /sapi/v1/bnbBurn (HMAC SHA256)
Weight(IP):
Response:
{
Parameters:
"spotBNBBurn" : true ,
"interestBNBBurn" : false
}
Name
Type
Mandatory
Description
recvWindow
LONG
NO
No more than
timestamp
LONG
YES
Query Margin Interest Rate History (USER_DATA)
GET /sapi/v1/margin/interestRateHistory (HMAC SHA256)
Weight(IP):
Response:
[
Parameters:
{
"asset" : "BTC" ,
"dailyInterestRate" : "0.00025000" ,
"timestamp" : 1611544731000 ,
"vipLevel" :
Name
Type
Mandatory
Description
asset
STRING
YES
vipLevel
INT
NO
Default: user's vip level
startTime
LONG
NO
Default:
},
{
"asset" : "BTC" ,
"dailyInterestRate" : "0.00035000" ,
"timestamp" : 1610248118000 ,
"vipLevel" :
days ago
}
endTime
LONG
NO
Default: present. Maximum
range: 3 months.
limit
INT
NO
Default: 20. Maximum:
recvWindow
LONG
NO
No more than
timestamp
LONG
YES
]
User Data Streams
The base API endpoint is: https://api.binance.com
A User Data Stream listenKey is valid for 60 minutes after creation.
Doing a PUT on a listenKey will extend its validity for 60 minutes.
Doing a DELETE on a listenKey will close the stream and invalidate the
listenKey
.
Doing a POST on an account with an active listenKey will return the
currently active listenKey and extend its validity for 60 minutes.
The base websocket endpoint is: wss://stream.binance.com:User Data Streams are accessed at /ws/ or /stream?
streams=
A single connection to stream.binance.com is only valid for 24 hours;
expect to be disconnected at the 24 hour mark
LISTEN KEY (SPOT)
Create
ListenKey (USER_STREAM)
a
POST /api/v3/userDataStream
Response:
Start a new user data stream. The stream will close after 60 minutes unless
keepalive is sent. If the account has an active listenKey that listenKey
will be returned and its validity will be extended for 60 minutes.
a
{
,
"listenKey" : "pqia91ma19a5s61cv6a81va65sdf19v8a65a1a5s61cv6a81va65sdf19v8a65a1"
}
Weight:
Parameters:
NONE
Data Source: Memory
Ping/Keep-alive
ListenKey (USER_STREAM)
a
PUT /api/v3/userDataStream
Response:
Keepalive a user data stream to prevent a time out. User data streams will
close after 60 minutes. It's recommended to send a ping about every minutes.
Weight:
{}
Parameters:
Name
Type
Mandatory
listenKey
STRING
YES
Description
Data Source: Memory
Close
ListenKey (USER_STREAM)
a
DELETE /api/v3/userDataStream
Close out
Response:
user data stream.
a
{}
Weight:
Parameters:
Name
Type
Mandatory
listenKey
STRING
YES
Description
Data Source: Memory
LISTEN KEY (MARGIN)
Create
ListenKey (USER_STREAM)
a
POST /sapi/v1/userDataStream
Weight:
Response:
{ "listenKey" :
"T3ee22BIYuWqmvne0HNq2A2WsFlEtLhvWCtItw6ffhhdmjifQ2tRbuKkTHhr"
Parameters:
NONE
Ping/Keep-alive
ListenKey (USER_STREAM)
a
PUT /sapi/v1/userDataStream
Weight:
Response:
{}
Parameters:
Name
Type
Mandatory
listenKey
STRING
YES
Close
Description
ListenKey (USER_STREAM)
a
DELETE /sapi/v1/userDataStream
Weight:
Response:
{}
Parameters:
Name
Type
Mandatory
listenKey
STRING
YES
Description
LISTEN KEY (ISOLATED MARGIN)
Generate
Listen Key (USER_STREAM)
a
POST /sapi/v1/userDataStream/isolated
Weight:
Response:
{
Parameters:
"listenKey":
"T3ee22BIYuWqmvne0HNq2A2WsFlEtLhvWCtItw6ffhhdmjifQ2tRbuKkTHhr"
}
Name
Type
Mandatory
symbol
STRING
YES
Ping/Keep-alive
Description
Listen Key (USER_STREAM)
a
PUT /sapi/v1/userDataStream/isolated
Weight:
Response:
{}
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
listenKey
STRING
YES
Close
Description
ListenKey (USER_STREAM)
a
DELETE /sapi/v1/userDataStream/isolated
Weight:
Response:
{}
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
listenKey
STRING
YES
Description
Payload: Account Update
sent any time an account balance has changed
and contains the assets that were possibly changed by the event that
generated the balance change.
outboundAccountPosition is
Payload:
{
"e" :
"E" :
"u" :
"B" :
{
"outboundAccountPosition" , //Event type
1564034571105 ,
//Event Time
1564034571073 ,
//Time of last account update
[
//Balances Array
"a" : "ETH" ,
"f" : "10000.000000" ,
"l" : "0.000000"
//Asset
//Free
//Locked
}
]
}
Payload: Balance Update
Balance Update occurs during the following:
Deposits or withdrawals from the account
Transfer of funds between accounts (e.g. Spot
Margin)
to
Payload
{
"e"
"E"
"a"
"d"
"T"
:
:
:
:
:
"balanceUpdate" ,
1573200697110 ,
"BTC" ,
"100.00000000" ,
//Event Type
//Event Time
//Asset
//Balance Delta
//Clear Time
}
Payload: Order Update
Orders are updated with the
event.
executionReport
Check the Public API Definitions and below
Average price can be found by doing
relevant enum definitions.
for
divided by
Z
z
.
Execution types:
Payload:
NEW - The order has been accepted into the engine.
CANCELED - The order has been canceled by the user.
REPLACED (currently unused)
REJECTED - The order has been rejected and was not processed. (This is
never pushed into the User Data Stream)
TRADE - Part of the order or all of the order's quantity has filled.
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)
the order is an OCO, an event will be displayed named
addition to the executionReport event.
{
"e"
"E"
"s"
"c"
"S"
"o"
"f"
"q"
"p"
"P"
"F"
"g"
"C"
"x"
"X"
"r"
"i"
"l"
"z"
"L"
"n"
"N"
"T"
"t"
"I"
"w"
"m"
"M"
"O"
"Z"
"Y"
"Q"
ListStatus in
If
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
"executionReport" ,
// Event type
1499405658658 ,
// Event time
"ETHBTC" ,
// Symbol
"mUvoqJxFIILMdfAW5iGSOW" , // Client order ID
"BUY" ,
// Side
"LIMIT" ,
// Order type
"GTC" ,
// Time in force
"1.00000000" ,
// Order quantity
"0.10264410" ,
// Order price
"0.00000000" ,
// Stop price
"0.00000000" ,
// Iceberg quantity
-1 ,
// OrderListId
"" ,
// Original client order ID; This is the ID
"NEW" ,
// Current execution type
"NEW" ,
// Current order status
"NONE" ,
// Order reject reason; will be an error
4293153 ,
// Order ID
"0.00000000" ,
// Last executed quantity
"0.00000000" ,
// Cumulative filled quantity
"0.00000000" ,
// Last executed price
"0" ,
// Commission amount
null ,
// Commission asset
1499405658657 ,
// Transaction time
-1 ,
// Trade ID
8641984 ,
// Ignore
true ,
// Is the order on the book?
false ,
// Is this trade the maker side?
false ,
// Ignore
1499405658657 ,
// Order creation time
"0.00000000" ,
// Cumulative quote asset transacted quantity
"0.00000000" ,
// Last quote asset transacted quantity (i.e.
"0.00000000"
// Quote Order Qty
code.
}
Payload
{
"e" :
"E" :
"s" :
"g" :
"c" :
"l" :
"L" :
"r" :
"C" :
"T" :
"O" :
{
"listStatus" ,
1564035303637 ,
"ETHBTC" ,
2,
"OCO" ,
"EXEC_STARTED" ,
"EXECUTING" ,
"NONE" ,
"F4QN4G8DlFATFlIUQ0cjdD" ,
1564035303625 ,
[
//Event Type
//Event Time
//Symbol
//OrderListId
//Contingency Type
//List Status Type
//List Order Status
//List Reject Reason
//List Client Order ID
//Transaction Time
//An array of objects
"s" : "ETHBTC" ,
//Symbol
"i" : 17 ,
// orderId
"c" : "AJYsMjErWJesZvqlJCTUgL" //ClientOrderId
},
{
"s" : "ETHBTC" ,
"i" : 18 ,
"c" : "bfYPSQdLoqAJeNrOr9adzq"
}
]
}
Savings Endpoints
The endpoints below allow you to interact with Binance Savings,
previously known as Binance Lending.
For more information on this, please refer to the Binance Savings page
Get Flexible Product
(USER_DATA)
List
GET /sapi/v1/lending/daily/product/list (HMAC SHA256)
Weight(IP):
Response:
[
Parameters:
{
Name
Type
Mandatory
Description
status
ENUM
NO
"ALL", "SUBSCRIBABLE",
"UNSUBSCRIBABLE"; Default:
"ALL"
featured
STRING
NO
"ALL", "TRUE"; Default: "ALL"
current
LONG
NO
Current query page. Default:
Min:
size
LONG
NO
Default: 50, Max:
recvWindow
LONG
NO
The value cannot be greater
than
timestamp
LONG
YES
"asset" : "BTC" ,
"avgAnnualInterestRate" : "0.00250025" ,
"canPurchase" : true ,
"canRedeem" : true ,
"dailyInterestPerThousand" : "0.00685000" ,
"featured" : true ,
"minPurchaseAmount" : "0.01000000" ,
"productId" : "BTC001" ,
"purchasedAmount" : "16.32467016" ,
"status" : "PURCHASING" ,
"upLimit" : "200.00000000" ,
"upLimitPerUser" : "5.00000000"
1,
},
{
"asset" : "BUSD" ,
"avgAnnualInterestRate" : "0.01228590" ,
"canPurchase" : true ,
"canRedeem" : true ,
"dailyInterestPerThousand" : "0.03836000" ,
"featured" : true ,
"minPurchaseAmount" : "0.10000000" ,
"productId" : "BUSD001" ,
"purchasedAmount" : "10.38932339" ,
"status" : "PURCHASING" ,
"upLimit" : "100000.00000000" ,
"upLimitPerUser" : "50000.00000000"
}
]
Get Left Daily Purchase Quota of Flexible Product
(USER_DATA)
GET /sapi/v1/lending/daily/userLeftQuota
Weight(IP):
(HMAC SHA256)
Response:
{
Parameters:
"asset" : "BUSD" ,
"leftQuota" : "50000.00000000"
Name
Type
Mandatory
productId
STRING
YES
recvWindow
LONG
NO
timestamp
LONG
YES
}
Description
The value cannot be greater
than
Purchase Flexible Product (USER_DATA)
POST /sapi/v1/lending/daily/purchase
Weight(IP):
(HMAC SHA256)
Response:
{
Parameters:
"purchaseId" : }
Name
Type
Mandatory
productId
STRING
YES
amount
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Description
The value cannot be greater
than
Get Left Daily Redemption Quota of Flexible
Product (USER_DATA)
GET /sapi/v1/lending/daily/userRedemptionQuota
Weight(IP):
(HMAC SHA256)
Response:
{
Parameters:
Name
Type
Mandatory
"asset" : "USDT" ,
"dailyQuota" : "10000000.00000000" ,
"leftQuota" : "0.00000000" ,
"minRedemptionAmount" : "0.10000000"
Description
}
productId
STRING
YES
type
ENUM
YES
"FAST", "NORMAL"
recvWindow
LONG
NO
The value cannot be greater
than
timestamp
LONG
YES
Redeem Flexible Product (USER_DATA)
POST /sapi/v1/lending/daily/redeem (HMAC SHA256)
Weight(IP):
Response:
{}
Parameters:
Name
Type
Mandatory
Description
productId
STRING
YES
amount
DECIMAL
YES
type
ENUM
YES
"FAST", "NORMAL"
recvWindow
LONG
NO
The value cannot be greater
than
timestamp
LONG
YES
Get Flexible Product Position (USER_DATA)
GET /sapi/v1/lending/daily/token/position
Weight(IP):
(HMAC SHA256)
Response:
[
Parameters:
{
Name
Type
Mandatory
asset
STRING
YES
recvWindow
LONG
NO
timestamp
LONG
YES
"annualInterestRate" : "0.02600000" ,
"asset" : "USDT" ,
"avgAnnualInterestRate" : "0.02599895" ,
"canRedeem" : true ,
"dailyInterestRate" : "0.00007123" ,
"freeAmount" : "75.46000000" ,
"freezeAmount" : "0.00000000" , // abandoned
"lockedAmount" : "0.00000000" , // abandoned
"productId" : "USDT001" ,
"productName" : "USDT" ,
"redeemingAmount" : "0.00000000" ,
"todayPurchasedAmount" : "0.00000000" ,
"totalAmount" : "75.46000000" ,
"totalInterest" : "0.22759183"
Description
The value cannot be greater
than
}
]
Get Fixed and Activity Project List(USER_DATA)
GET /sapi/v1/lending/project/list (HMAC SHA256)
Weight(IP):
Response:
[
Parameters:
{
Name
Type
Mandatory
asset
STRING
NO
type
ENUM
YES
"ACTIVITY",
"CUSTOMIZED_FIXED"
status
ENUM
NO
"ALL", "SUBSCRIBABLE",
"UNSUBSCRIBABLE"; default
"ALL"
isSortAsc
BOOLEAN
NO
default "true"
"asset" : "USDT" ,
"displayPriority" : 1 ,
"duration" : 90 ,
"interestPerLot" : "1.35810000" ,
"interestRate" : "0.05510000" ,
"lotSize" : "100.00000000" ,
"lotsLowLimit" : 1 ,
"lotsPurchased" : 74155 ,
"lotsUpLimit" : 80000 ,
"maxLotsPerUser" : 2000 ,
"needKyc" : false ,
"projectId" : "CUSDT90DAYSS001" ,
"projectName" : "USDT" ,
"status" : "PURCHASING" ,
"type" : "CUSTOMIZED_FIXED" ,
"withAreaLimitation" : false
Description
}
sortBy
ENUM
NO
"START_TIME", "LOT_SIZE",
"INTEREST_RATE",
"DURATION"; default
"START_TIME"
current
LONG
NO
Currently querying page.
Start from 1. Default:
size
LONG
NO
Default:10, Max:
recvWindow
LONG
NO
The value cannot be greater
than
timestamp
LONG
YES
]
Purchase Fixed/Activity Project (USER_DATA)
POST /sapi/v1/lending/customizedFixed/purchase
Weight(IP):
(HMAC SHA256)
Response:
{
Parameters:
"purchaseId" : "18356"
}
Name
Type
Mandatory
projectId
STRING
YES
lot
LONG
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Description
The value cannot be greater
than
Get Fixed/Activity Project Position (USER_DATA)
GET /sapi/v1/lending/project/position/list
Weight(IP):
(HMAC SHA256)
Response:
[
Parameters:
{
Name
Type
Mandatory
asset
STRING
YES
projectId
STRING
NO
status
ENUM
NO
"HOLDING", "REDEEMED"
recvWindow
LONG
NO
The value cannot be greater
than
timestamp
LONG
YES
"asset" : "USDT" ,
"canTransfer" : true ,
"createTimestamp" : 1587010770000 ,
"duration" : 14 ,
"endTime" : 1588291200000 ,
"interest" : "0.19950000" ,
"interestRate" : "0.05201250" ,
"lot" : 1 ,
"positionId" : 51724 ,
"principal" : "100.00000000" ,
"projectId" : "CUSDT14DAYSS001" ,
"projectName" : "USDT" ,
"purchaseTime" : 1587010771000 ,
"redeemDate" : "2020-05-01" ,
"startTime" : 1587081600000 ,
"status" : "HOLDING" ,
"type" : "CUSTOMIZED_FIXED"
Description
}
]
Lending Account (USER_DATA)
GET /sapi/v1/lending/union/account
Weight(IP):
(HMAC SHA256)
Response:
{
Parameters:
Name
Type
Mandatory
Description
recvWindow
LONG
NO
The value cannot be greater
than
timestamp
LONG
YES
"positionAmountVos" : [
{
"amount" : "75.46000000" ,
"amountInBTC" : "0.01044819" ,
"amountInUSDT" : "75.46000000" ,
"asset" : "USDT"
},
{
"amount" : "1.67072036" ,
"amountInBTC" : "0.00023163" ,
"amountInUSDT" : "1.67289230" ,
"asset" : "BUSD"
}
],
"totalAmountInBTC" : "0.01067982" ,
"totalAmountInUSDT" : "77.13289230" ,
"totalFixedAmountInBTC" : "0.00000000" ,
"totalFixedAmountInUSDT" : "0.00000000" ,
"totalFlexibleInBTC" : "0.01067982" ,
"totalFlexibleInUSDT" : "77.13289230"
}
Get Purchase Record (USER_DATA)
GET /sapi/v1/lending/union/purchaseRecord
Weight(IP):
(HMAC SHA256)
Response:
Flexible Products
Parameters:
[
Name
Type
Mandatory
lendingType
ENUM
YES
asset
STRING
NO
Description
{
"amount" : "100.00000000" ,
"asset" : "USDT" ,
"createTime" : 1575018510000 ,
"lendingType" : "DAILY" ,
"productName" : "USDT" ,
"purchaseId" : 26055 ,
"status" : "SUCCESS"
"DAILY" for flexible, "ACTIVITY"
for activity,
"CUSTOMIZED_FIXED" for fixed
}
startTime
LONG
NO
endTime
LONG
NO
current
LONG
NO
]
Fixed/Activity Products
Currently querying page. Start
from 1. Default:
[
{
size
LONG
NO
Default:10, Max:
recvWindow
LONG
NO
The value cannot be greater
than
timestamp
LONG
YES
"amount" : "100.00000000" ,
"asset" : "USDT" ,
"createTime" : 1575018453000 ,
"lendingType" : "ACTIVITY" ,
"lot" : 1 ,
"productName" : "【Special】USDT 7D (8%)" ,
"purchaseId" : 36857 ,
"status" : "SUCCESS"
}
The time between
days.
If startTime and
will be returned.
and
startTime
cannot be longer than
endTime
are both not sent, then the
endTime
]
30 days' data
last
Get Redemption Record (USER_DATA)
GET /sapi/v1/lending/union/redemptionRecord
Weight(IP):
(HMAC SHA256)
Response:
Flexible Products
Parameters:
[
Name
Type
Mandatory
lendingType
ENUM
YES
asset
STRING
NO
startTime
LONG
NO
endTime
LONG
NO
current
LONG
NO
Description
{
"amount" : "10.54000000" ,
"asset" : "USDT" ,
"createTime" : 1577257222000 ,
"principal" : "10.54000000" ,
"projectId" : "USDT001" ,
"projectName" : "USDT" ,
"status" : "PAID" ,
"type" : "FAST"
"DAILY" for flexible, "ACTIVITY"
for activity,
"CUSTOMIZED_FIXED" for fixed
}
]
Fixed/Activity Products
Currently querying page. Start
from 1. Default:[
{
size
LONG
NO
Default:10, Max:
recvWindow
LONG
NO
The value cannot be greater
than
timestamp
LONG
YES
The time between
days.
If startTime and
will be returned.
and
startTime
"amount" : "0.07070000" ,
"asset" : "USDT" ,
"createTime" : 1566200161000 ,
"interest" : "0.00070000" ,
"principal" : "0.07000000" ,
"projectId" : "test06" ,
"projectName" : "USDT 1 day (10% anniualized)" ,
"startTime" : 1566198000000 ,
"status" : "PAID"
cannot be longer than
endTime
}
]
are both not sent, then the
endTime
30 days' data
last
Get Interest History (USER_DATA)
GET /sapi/v1/lending/union/interestHistory
Weight(IP):
(HMAC SHA256)
Response:
[
Parameters:
{
Name
Type
Mandatory
Description
lendingType
ENUM
YES
"DAILY" for flexible, "ACTIVITY"
for activity,
"CUSTOMIZED_FIXED" for fixed
asset
STRING
NO
startTime
LONG
NO
"asset" : "BUSD" ,
"interest" : "0.00006408" ,
"lendingType" : "DAILY" ,
"productName" : "BUSD" ,
"time" : },
{
"asset" : "USDT" ,
"interest" : "0.00687654" ,
"lendingType" : "DAILY" ,
"productName" : "USDT" ,
"time" : }
]
endTime
LONG
NO
current
LONG
NO
Currently querying page. Start
from 1. Default:
size
LONG
NO
Default:10, Max:
recvWindow
LONG
NO
The value cannot be greater
than
timestamp
LONG
YES
The time between
days.
If startTime and
will be returned.
and
startTime
cannot be longer than
endTime
are both not sent, then the
endTime
30 days' data
last
Change Fixed/Activity Position to Daily
Position(USER_DATA)
POST /sapi/v1/lending/positionChanged (HMAC SHA256)
Weight(IP):
Response:
Parameters:
{
"dailyPurchaseId" : 862290 ,
"success" : true ,
"time" :
Name
Type
Mandatory
projectId
STRING
YES
lot
LONG
YES
positionId
LONG
NO
for
recvWindow
LONG
NO
no more than
timestamp
LONG
YES
PositionId
}
mandatory parameter
is
Description
fixed position
fixed position.
for
Mining Endpoints
The endpoints below allow to interact with Binance Pool.
For more information on this, please refer to the Binance Pool page
Acquiring Algorithm (USER_DATA)
GET /sapi/v1/mining/pub/algoList
Weight(IP):
(HMAC SHA256)
Response:
{
Parameter:
Name
Type
Mandatory
recvWindow
LONG
NO
timestamp
LONG
YES
"code" : 0 ,
"msg" : "" ,
"data" : [
{
"algoName" : "sha256" ,
"algoId" : 1 ,
"poolIndex" : 0 ,
"unit" : "h/s"
}
]
Description
// Algorithm name
// Algorithm ID
// Sequence
//
Unit
}
Acquiring CoinName (USER_DATA)
GET /sapi/v1/mining/pub/coinList
Weight(IP):
(HMAC SHA256)
Parameter:
Name
Type
Mandatory
recvWindow
LONG
NO
timestamp
LONG
YES
Description
Response:
{
"code" : 0 ,
"msg" : "" ,
"data" : [
{
"coinName" : "BTC" ,
"coinId" : 1 ,
"poolIndex" : 0 ,
"algoId" : 1 ,
"algoName" : "sha256"
}
]
// Currencyname
// id
// Sort
// Algorithm
//Name of algorithm
}
Request for Detail Miner
(USER_DATA)
List
GET /sapi/v1/mining/worker/detail (HMAC SHA256)
Weight(IP):
Response:
{
Parameter:
Name
Type
Mandatory
Description
For Example
algo
STRING
YES
Algorithm(sha256)
sha
userName
STRING
YES
Mining account
test
workerName
STRING
YES
Miner’s
name(required)
bhdc1.16A10404B
recvWindow
LONG
NO
timestamp
LONG
YES
"code" : 0 ,
"msg" : "" ,
"data" : [
{
"workerName" : "bhdc1.16A10404B" ,
"type" : "H_hashrate" ,
"hashrateDatas" : [
{
"time" : 1587902400000 ,
"hashrate" : "0" ,
"reject" : },
{
"time" : 1587906000000 ,
"hashrate" : "0" ,
"reject" : }
]
},
{
"workerName" : "bhdc1.16A10404B" ,
"type" : "D_hashrate" ,
"hashrateDatas" : [
{
"time" : 1587902400000 ,
"hashrate" : "0" ,
"reject" : },
{
"time" : 1587906000000 ,
"hashrate" : "0" ,
"reject" : }
]
}
]
//Mining Account name
// Type of hourly hashrate
// Time
// Hashrate
//Rejection Rate
//Mining Account name
//Type of daily hashrate
// Time
// Hashrate
//Rejection Rate
}
Request for Miner
(USER_DATA)
List
GET /sapi/v1/mining/worker/list
Weight(IP):
(HMAC SHA256)
Response:
{
Parameter:
Name
Type
Mandatory
Description
For Example
algo
STRING
YES
Algorithm(sha256)
sha
userName
STRING
YES
Mining account
test
pageIndex
INTEGER
NO
Page number,
default is first page,
start form
sort
INTEGER
NO
sort
sequence(default=0)positive sequence,negative sequence
sortColumn
INTEGER
NO
Sort by( default 1):
1: miner name,
2: real-time
computing power,
3: daily average
computing power,
4: real-time rejection
rate,
5: last submission
time
workerStatus
INTEGER
NO
recvWindow
LONG
NO
timestamp
LONG
YES
"code" : 0 ,
"msg" : "" ,
"data" : {
"workerDatas" : [
{
"workerId" : "1420554439452400131" , //Miner ID
"workerName" : "2X73" ,
//Miner's name
"status" : 3 ,
// Status:1 valid, 2 invalid,
"hashRate" : 0 ,
// Real-time rate
"dayHashRate" : 0 ,
//24H Hashrate
"rejectRate" : 0 ,
//Real-time Rejection Rate
"lastShareTime" : // Last submission time
},
{
"workerId" : "7893926126382807951" ,
"workerName" : "AZDC1.1A10101" ,
"status" : 2 ,
"hashRate" : 29711247541680 ,
"dayHashRate" : 12697781298013.66 ,
"rejectRate" : 0 ,
"lastShareTime" : }
],
"totalNum" : 18530 ,
// Total amount
"pageSize" : // Rows per page
}
{
Parameter:
Name
Type
Mandatory
Description
Example
algo
STRING
YES
Transfer
algorithm(sha256)
sha
userName
STRING
YES
Mining account
test
coin
STRING
NO
Coin name
startDate
Long
NO
Search date,
millisecond
timestamp, while
empty query all
endDate
Long
NO
Search date,
millisecond
timestamp, while
empty query all
pageIndex
INTEGER
NO
Page number,
empty default
first page, starting
from
pageSize
INTEGER
NO
Number of pages,
minimum 10,
maximum
recvWindow
LONG
NO
timestamp
LONG
YES
Extra Bonus
"code" : 0 ,
"msg" : "" ,
"data" : {
"accountProfits" : [
{
"time" : 1586188800000 ,
// Mining date
"type" : 31 , // 0:Mining Wallet,5:Mining Address,7:Pool Savings,8:Transferred,31:Income
"hashTransfer" : null ,
// Transferred Hashrate
"transferAmount" : null ,
// Transferred Income
"dayHashRate" : 129129903378244 , // Daily Hashrate
"profitAmount" : 8.6083060304 ,
//Earnings Amount
"coinName" : "BTC" ,
// Coin Type
"status" : //Status:0:Unpaid, 1:Paying 2:Paid
},
{
"time" : 1607529600000 ,
"coinName" : "BTC" ,
"type" : 0 ,
"dayHashRate" : 9942053925926 ,
"profitAmount" : 0.85426469 ,
"hashTransfer" : 200000000000 ,
"transferAmount" : 0.02180958 ,
"status" : },
{
"time" : 1607443200000 ,
"coinName" : "BTC" ,
"type" : 31 ,
"dayHashRate" : 200000000000 ,
"profitAmount" : 0.02905916 ,
"hashTransfer" : null ,
"transferAmount" : null ,
"status" : }
],
"totalNum" : 3 ,
// Total Rows
"pageSize" : // Rows per page
}
}
(USER_DATA)
List
GET /sapi/v1/mining/payment/other (HMAC SHA256)
Weight(IP):
Response:
{
Parameter:
Name
Type
Mandatory
Description
Example
algo
STRING
YES
Transfer
algorithm(sha256)
sha
userName
STRING
YES
Mining Account
test
coin
STRING
NO
Coin Name
startDate
Long
NO
Search date,
millisecond
timestamp, while
empty query all
}
endDate
Long
NO
Search date,
millisecond
timestamp, while
empty query all
pageIndex
INTEGER
NO
Page number,
empty default
first page, starting
from
pageSize
INTEGER
NO
Number of pages,
minimum 10,
maximum
recvWindow
LONG
NO
timestamp
LONG
YES
Hashrate Resale
"code" : 0 ,
"msg" : "" ,
"data" : {
"otherProfits" : [
{
"time" : 1607443200000 ,
// Mining date
"coinName" : "BTC" ,
// Coin Name
"type" : 4 ,
// 1: Merged Mining, 2: Activity Bonus, 3:Rebate
"profitAmount" : 0.0011859 , //Amount
"status" : //Status:0:Unpaid, 1:Paying 2:Paid
}
],
"totalNum" : 3 ,
// Total Rows
"pageSize" : // Rows per page
}
(USER_DATA)
List
GET /sapi/v1/mining/hash-transfer/config/details/list (HMAC SHA256)
Weight(IP):
Response:
{
Parameter:
Name
Type
Mandatory
Description
pageIndex
INTEGER
NO
Page number,
empty default
first page,
starting from
pageSize
INTEGER
NO
Number of
pages, minimum
10, maximum
recvWindow
LONG
NO
timestamp
LONG
YES
"code" : 0 ,
"msg" : "" ,
"data" : {
"configDetails" : [
{
"configId" : 168 ,
// Mining ID
"poolUsername" : "123" , //Transfer out of subaccount
"toPoolUsername" : "user1" , // Transfer into subaccount
"algoName" : "Ethash" ,
// Transfer algorithm
"hashRate" : 5000000 ,
// Transferred Hashrate quantity
"startDay" : 20201210 ,
// Start date
"endDay" : 20210405 ,
//End date
"status" : //Status:0 Processing,1:Cancelled,2:Terminated
},
{
"configId" : 166 ,
"poolUsername" : "pop" ,
"toPoolUsername" : "111111" ,
"algoName" : "Ethash" ,
"hashRate" : 3320000 ,
"startDay" : 20201226 ,
"endDay" : 20201227 ,
"status" : }
],
"totalNum" : 21 ,
"pageSize" : }
Example
}
Hashrate Resale Detail (USER_DATA)
GET /sapi/v1/mining/hash-transfer/profit/details (HMAC SHA256)
Weight(IP):
Response:
{
Parameter:
Name
Type
Mandatory
Description
Example
configId
INTEGER
YES
Mining ID
userName
STRING
YES
Mining Account
pageIndex
INTEGER
NO
Page number,
empty default
first page,
starting from
pageSize
INTEGER
NO
recvWindow
LONG
NO
timestamp
LONG
YES
"code" : 0 ,
"msg" : "" ,
"data" : {
"profitTransferDetails" : [{
"poolUsername" : "test4001" ,
// Transfer out of sub-account
"toPoolUsername" : "pop" ,
// Transfer into subaccount
"algoName" : "sha256" ,
// Transfer algorithm
"hashRate" : 200000000000 , // Transferred Hashrate quantity
"day" : 20201213 ,
// Transfer date
"amount" : 0.2256872 ,
// Transferred income
"coinName" : "BTC"
// Coin Name
test
},
{
"poolUsername" : "test4001" ,
"toPoolUsername" : "pop" ,
"algoName" : "sha256" ,
"hashRate" : 200000000000 ,
"day" : 20201213 ,
"amount" : 0.2256872 ,
"coinName" : "BTC"
Number of
pages, minimum
10, maximum }
],
"totalNum" : 8 ,
"pageSize" : }
}
Hashrate Resale Request (USER_DATA)
POST /sapi/v1/mining/hash-transfer/config
Weight(IP):
(HMAC SHA256)
Response:
{
Parameter:
"code" : 0 ,
"msg" : "" ,
"data" :
Name
Type
Mandatory
Description
Example
userName
STRING
YES
Mining Account
test
algo
STRING
YES
Transfer
algorithm(sha256)
sha
endDate
Long
YES
Resale End Time
(Millisecond
timestamp)
startDate
Long
YES
Resale Start
Time(Millisecond
timestamp)
toPoolUser
STRING
YES
Mining Account
S19pro
hashRate
Long
YES
Resale hashrate
h/s must be
transferred (BTC
greater than
ETH is greater
than 500000)
recvWindow
LONG
NO
timestamp
LONG
YES
// Mining Account
}
is
Cancel hashrate resale configuration(USER_DATA)
POST /sapi/v1/mining/hash-transfer/config/cancel
Weight(IP):
(HMAC SHA256)
Response:
{
Parameter:
Name
Type
Mandatory
Description
Example
configId
INTEGER
YES
Mining ID
userName
STRING
YES
Mining Account
test
recvWindow
LONG
NO
timestamp
LONG
YES
Statistic
}
(USER_DATA)
List
GET /sapi/v1/mining/statistics/user/status
Weight(IP):
"code" : 0 ,
"msg" : "" ,
"data" : true
(HMAC SHA256)
Response:
{
Parameter:
Name
Type
Mandatory
Description
"code" : 0 ,
"msg" : "" ,
"data" : [
{
"type" : "H_hashrate" ,
"userName" : "test" ,
"list" : [
{
"time" : 1585267200000 ,
"hashrate" : "0.00000000"
"reject" : "0.00000000"
},
{
"time" : 1585353600000 ,
"hashrate" : "0.00000000"
"reject" : "0.00000000"
}
]
},
{
"type" : "D_hashrate" ,
"userName" : "test" ,
"list" : [
{
"time" : 1587906000000 ,
"hashrate" : "0.00000000"
"reject" : "0.00000000"
},
{
"time" : 1587909600000 ,
"hashrate" : "0.00000000"
"reject" : "0.00000000"
}
]
}
]
For Example
algo
STRING
YES
Algorithm(sha256)
sha
userName
STRING
YES
Mining account
test
recvWindow
LONG
NO
timestamp
LONG
YES
//Type of hourly hashrate
// Mining account
// Time
, // Hashrate
//Rejection Rate
,
//Type of daily hashrate
// Mining account
// Time
, // Hashrate
//Rejection Rate
,
}
Futures
New Future Account Transfer (USER_DATA)
POST /sapi/v1/futures/transfer
(HMAC SHA256)
Response:
Execute transfer between spot account and futures account.
{
Weight(IP):
"tranId" :
//transaction id
}
Parameters:
Name
Type
Mandatory
Description
asset
STRING
YES
The asset being transferred,
e.g., USDT
amount
DECIMAL
YES
The amount
transferred
type
INT
YES
1:
recvWindow
LONG
NO
timestamp
LONG
YES
be
to
transfer from spot account
to USDT-Ⓜ futures account.
2: transfer from USDT-Ⓜ
futures account to spot
account.
3: transfer from spot account
to COIN-Ⓜ futures account.
4: transfer from COIN-Ⓜ
futures account to spot
account.
Get Future Account Transaction History
(USER_DATA)
List
GET /sapi/v1/futures/transfer (HMAC SHA256)
Response:
Weight(IP): {
Parameters:
Name
Type
Mandatory
asset
STRING
YES
startTime
LONG
YES
endTime
LONG
NO
"rows" : [
{
"asset" : "USDT" ,
"tranId" : 100000001 ,
"amount" : "40.84624400" ,
"type" : "1" , // one of 1( from spot to USDT-Ⓜ), 2( from USDT-Ⓜ to
"timestamp" : 1555056425000 ,
"status" : "CONFIRMED" //one of PENDING (pending to execution), CONFIRMED
}
],
"total" :
Description
spot),
}
current
LONG
NO
Currently querying page. Start
from 1. Default:
size
LONG
NO
Default:10 Max:
recvWindow
LONG
NO
timestamp
LONG
YES
Borrow For Cross-Collateral (TRADE)
POST /sapi/v1/futures/loan/borrow
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
coin
STRING
YES
amount
DECIMAL
YES when
collateralAmount
empty
"coin" : "USDT" ,
"amount" : "4.50000000" ,
"collateralCoin" : "BUSD" ,
"collateralAmount" : "5.00000000" ,
"time" : 1582540328433 ,
"borrowId" : "438648398970089472"
Description
}
is
collateralCoin
STRING
YES
collateralAmount
DECIMAL
YES when amount
empty
recvWindow
LONG
NO
timestamp
LONG
YES
is
Weight(Uid): Rate Limit:
1/1s per account
Cross-Collateral Borrow History (USER_DATA)
GET /sapi/v1/futures/loan/borrow/history
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
coin
STRING
NO
startTime
LONG
NO
endTime
LONG
NO
limit
LONG
NO
recvWindow
LONG
NO
timestamp
LONG
YES
"rows" :[
{
Description
"confirmedTime" : 1582540328433 ,
"coin" : "USDT" ,
"collateralRate" : "0.89991001" , // collateralLevel
"leftTotal" : "4.5" ,
"leftPrincipal" : "4.5" ,
"deadline" : 4736102399000 ,
"collateralCoin" : "BUSD" ,
"collateralAmount" : "5.0" ,
"orderStatus" : "PENDING" ,
"borrowId" : "438648398970089472"
default 500, max
}
],
"total" : }
Weight(IP):
Repay For Cross-Collateral (TRADE)
POST /sapi/v1/futures/loan/repay
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
coin
STRING
YES
collateralCoin
STRING
YES
amount
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
"coin" : "USDT" ,
"amount" : "1.68" ,
"collateralCoin" : "BUSD" ,
"repayId" : "439659223998894080"
Description
}
Weight(Uid): Rate Limit:
1/1s per account
Cross-Collateral Repayment History (USER_DATA)
GET /sapi/v1/futures/loan/repay/history HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
coin
STRING
NO
startTime
LONG
NO
endTime
LONG
NO
limit
LONG
NO
recvWindow
LONG
NO
timestamp
LONG
"rows" :[
{
Description
"coin" : "USDT" ,
"amount" : "1.68" ,
"collateralCoin" : "BUSD" ,
"repayType" : "NORMAL" , // "COLLATERAL" for collateral repayment
"releasedCollateral" : "1.80288889" ,
"price" : "1.001" , // Loan/collateral exchange rate
"repayCollateral" : "10010" , // Only for collateral repayment
"confirmedTime" : 1582781327575 ,
"updateTime" : 1582794387516 , // time
"status" : "PENDING" ,
"repayId" : "439659223998894080"
default 500, max
}
],
"total" :
YES
}
Weight(IP):
Cross-Collateral Wallet (USER_DATA)
GET /sapi/v1/futures/loan/wallet
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
recvWindow
LONG
NO
timestamp
LONG
YES
"totalCrossCollateral" : "5.8238577133" ,
"totalBorrowed" : "5.07000000" ,
"totalInterest" : "0.0" , // New for interest collection
"interestFreeLimit" : "100000" , // New for interest free limit
"asset" : "USDT" ,
"crossCollaterals" :[
{
"collateralCoin" : "BUSD" ,
"locked" : "5.82211108" ,
"loanAmount" : "5.07" ,
"currentCollateralRate" : "0.87168984" ,
// collateralLevel
"interestFreeLimitUsed" : "5.07" , // New for interest free limit
"principalForInterest" : "0.0" , // New for interest collection
"interest" : "0.0" // New for interest collection
},
{
"collateralCoin" : "BTC" ,
"locked" : "0" ,
"loanAmount" : "0" ,
"currentCollateralRate" : "0" ,
// collateralLevel
"interestFreeLimitUsed" : "0" , // New for interest free limit
"principalForInterest" : "0.0" , // New for interest collection
"interest" : "0.0" // New for interest collection
}
]
Description
Weight(IP):
}
Cross-Collateral Wallet V2 (USER_DATA)
GET /sapi/v2/futures/loan/wallet
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
recvWindow
LONG
NO
timestamp
LONG
YES
Weight(IP):
"totalCrossCollateral" : "5.8238577133" ,
"totalBorrowed" : "5.07000000" ,
"totalInterest" : "0.0" , // New for interest collection
"interestFreeLimit" : "100000" , // New for interest free limit
"asset" : "USD" , // New for USD value
"crossCollaterals" :[
{
"loanCoin" : "USDT" ,
"collateralCoin" : "BUSD" ,
"locked" : "5.82211108" ,
"loanAmount" : "5.07" ,
"currentCollateralRate" : "0.87168984" ,
// collateralLevel
"interestFreeLimitUsed" : "5.07" , // New for interest free limit
"principalForInterest" : "0.0" , // New for interest collection
"interest" : "0.0" // New for interest collection
},
{
"loanCoin" : "BUSD" ,
"collateralCoin" : "BTC" ,
"locked" : "0" ,
"loanAmount" : "0" ,
"currentCollateralRate" : "0" ,
// collateralLevel
"interestFreeLimitUsed" : "0" , // New for interest free limit
"principalForInterest" : "0.0" , // New for interest collection
"interest" : "0.0" // New for interest collection
}
]
Description
}
Cross-Collateral Information (USER_DATA)
GET /sapi/v1/futures/loan/configs (HMAC SHA256)
Response:
Parameters:
[
Name
Type
Mandatory
collateralCoin
STRING
NO
recvWindow
LONG
NO
timestamp
LONG
YES
{
Description
"collateralCoin" : "BUSD" ,
"rate" : "0.9" ,
"marginCallCollateralRate" : "0.95" ,
"liquidationCollateralRate" : "0.98" ,
"currentCollateralRate" : "0.87168984" ,
"interestRate" : "0.0" , // New for interest collection
"interestGracePeriod" : "0" //Days, new for interest collection
}
]
all
collateral data
be returned
will
collateralCoin
if
not sent
is
Weight(IP):
Cross-Collateral Information V2 (USER_DATA)
GET /sapi/v2/futures/loan/configs (HMAC SHA256)
Response:
Parameters:
[
Name
Type
Mandatory
loanCoin
STRING
NO
collateralCoin
STRING
NO
recvWindow
LONG
NO
timestamp
LONG
YES
loan and collateral data
not sent
Weight(IP):
"loanCoin" : "BUSD" ,
"collateralCoin" : "BTC" ,
"rate" : "0.9" ,
"marginCallCollateralRate" : "0.95" ,
"liquidationCollateralRate" : "0.98" ,
"currentCollateralRate" : "0.87168984" ,
"interestRate" : "0.0" , // New for interest collection
"interestGracePeriod" : "0" //Days, new for interest collection
}
]
be returned
will
all
{
Description
loanCoin or collateralCoin
if
is
Calculate Rate After Adjust Cross-Collateral LTV
(USER_DATA)
GET /sapi/v1/futures/loan/calcAdjustLevel
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
collateralCoin
STRING
YES
amount
DECIMAL
YES
direction
ENUM
YES
recvWindow
LONG
NO
timestamp
LONG
YES
"afterCollateralRate" : "0.89736451"
Description
}
"ADDITIONAL", "REDUCED"
Weight(IP):
Calculate Rate After Adjust Cross-Collateral LTV V(USER_DATA)
GET /sapi/v2/futures/loan/calcAdjustLevel
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
loanCoin
STRING
YES
collateralCoin
STRING
YES
amount
DECIMAL
YES
direction
ENUM
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Weight(IP):
"afterCollateralRate" : "0.89736451"
Description
}
"ADDITIONAL", "REDUCED"
Get Max Amount for Adjust Cross-Collateral LTV
(USER_DATA)
GET /sapi/v1/futures/loan/calcMaxAdjustAmount
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
collateralCoin
STRING
YES
recvWindow
LONG
NO
timestamp
LONG
YES
"maxInAmount" : "9.97109038" ,
"maxOutAmount" : "0.50952693"
Description
}
Weight(IP):
Get Max Amount for Adjust Cross-Collateral LTV V(USER_DATA)
GET /sapi/v2/futures/loan/calcMaxAdjustAmount
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
loanCoin
STRING
YES
collateralCoin
STRING
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Weight(IP):
"maxInAmount" : "9.97109038" ,
"maxOutAmount" : "0.50952693"
Description
}
Adjust Cross-Collateral LTV (TRADE)
POST /sapi/v1/futures/loan/adjustCollateral
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
collateralCoin
STRING
YES
amount
DECIMAL
YES
direction
ENUM
YES
recvWindow
LONG
NO
timestamp
LONG
YES
"collateralCoin" : "BUSD" ,
"direction" : "ADDITIONAL" ,
"amount" : "5.00000000" ,
"time" :
Description
}
"ADDITIONAL", "REDUCED"
Weight(Uid): RateLimit: 1/1s per account
Adjust Cross-Collateral LTV V2 (TRADE)
POST /sapi/v2/futures/loan/adjustCollateral
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
loanCoin
STRING
YES
collateralCoin
STRING
YES
amount
DECIMAL
YES
direction
ENUM
YES
recvWindow
LONG
NO
timestamp
LONG
YES
"loanCoin" : "BUSD" ,
"collateralCoin" : "BTC" ,
"direction" : "ADDITIONAL" ,
"amount" : "5.00000000" ,
"time" :
Description
}
"ADDITIONAL", "REDUCED"
RateLimit: 1/1s per account
Adjust Cross-Collateral LTV History (USER_DATA)
GET /sapi/v1/futures/loan/adjustCollateral/history (HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
loanCoin
STRING
NO
collateralCoin
STRING
NO
startTime
LONG
NO
endTime
LONG
NO
limit
LONG
NO
"rows" :[
{
Description
"amount" : ".17398184" ,
"collateralCoin" : "BUSD" ,
"coin" : "USDT" ,
"preCollateralRate" : "0.87054861" ,
"afterCollateralRate" : "0.89736451" ,
"direction" : "REDUCED" ,
"status" : "COMPLETED" ,
"adjustTime" : }
],
"total" :
default 500, max }
recvWindow
LONG
NO
timestamp
LONG
YES
data
All
be returned
will
loanCoin or collateralCoin
if
not sent
is
Weight(IP):
Cross-Collateral Liquidation History (USER_DATA)
GET /sapi/v1/futures/loan/liquidationHistory
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
loanCoin
STRING
NO
collateralCoin
STRING
NO
startTime
LONG
NO
endTime
LONG
NO
limit
LONG
NO
recvWindow
LONG
NO
timestamp
LONG
YES
data
All
be returned
will
"collateralAmountForLiquidation" : "10.12345678" ,
"collateralCoin" : "BUSD" ,
"forceLiquidationStartTime" : 1583978243588 ,
"coin" : "USDT" ,
"restCollateralAmountAfterLiquidation" : "15.12345678" ,
"restLoanAmount" : "11.12345678" ,
"status" : "PENDING"
}
],
"total" :
default 500, max
loanCoin or collateralCoin
if
"rows" :[
{
Description
}
not sent
is
Weight(IP):
Check Collateral Repay Limit (USER_DATA)
Check the maximum and minimum
when repay with collateral.
limit
GET /sapi/v1/futures/loan/collateralRepayLimit
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
coin
STRING
YES
collateralCoin
STRING
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Weight(IP):
"coin" : "USDT" ,
"collateralCoin" : "BTC" ,
"max" : "15000" ,
"min" : "15"
Description
}
Get Collateral Repay Quote (USER_DATA)
Get quote before repay with collateral
within 25 seconds.
mandatory, the quote
is
GET /sapi/v1/futures/loan/collateralRepay
will
be valid
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
coin
STRING
YES
collateralCoin
STRING
YES
amount
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Weight(IP):
"coin" : "USDT" ,
"collateralCoin" : "BTC" ,
"amount" : "0.00222" ,
"quoteId" : "8a03da95f0ad4fdc8067e3b6cde72423"
Description
}
repay amount
Repay with Collateral (USER_DATA)
Repay with collateral. Get quote before repay with collateral
the quote will be valid within 25 seconds.
POST /sapi/v1/futures/loan/collateralRepay
mandatory,
is
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
quoteId
STRING
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Weight(IP):
"coin" : "USDT" ,
"collateralCoin" : "BTC" ,
"amount" : "30" ,
"quoteId" : "3eece81ca2734042b2f538ea0d9cbdd3"
Description
}
Collateral Repayment Result (USER_DATA)
Check collateral repayment result.
GET /sapi/v1/futures/loan/collateralRepayResult
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
quoteId
STRING
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Weight(IP):
"quoteId" : "3eece81ca2734042b2f538ea0d9cbdd3" ,
"status" : "SUCCESS"
Description
}
Cross-Collateral Interest History (USER_DATA)
GET /sapi/v1/futures/loan/interestHistory
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
collateralCoin
STRING
NO
startTime
LONG
NO
endTime
LONG
NO
current
LONG
NO
"rows" :[
{
Description
"collateralCoin" : "BUSD" ,
"interestCoin" : "USDT" ,
"interest" : "2.354" ,
"interestFreeLimitUsed" : "0" , // New for interest free limit
"principalForInterest" : "10000" ,
"interestRate" : "0.002" ,
"time" : }
],
"total" :
Currently querying page.
Start from 1. Default:}
limit
LONG
NO
recvWindow
LONG
NO
timestamp
LONG
YES
Weight(IP):
Default:500 Max:
BLVT Endpoints
Get BLVT Info (MARKET_DATA)
GET /sapi/v1/blvt/tokenInfo
Weight(IP):
Response:
[
Parameters:
{
Name
Type
Mandatory
Description
tokenName
STRING
NO
BTCDOWN, BTCUP
"tokenName" : "BTCDOWN" ,
"description" : "3X Short Bitcoin Token" ,
"underlying" : "BTC" ,
"tokenIssued" : "717953.95" ,
"basket" : "-821.474 BTCUSDT Futures" ,
"currentBaskets" :[
{
"symbol" : "BTCUSDT" ,
"amount" : "-1183.984" ,
"notionalValue" : "-22871089.96704"
}
],
"nav" : "4.79" ,
"realLeverage" : "-2.316" ,
"fundingRate" : "0.001020" ,
"dailyManagementFee" : "0.0001" ,
"purchaseFeePct" : "0.0010" ,
"dailyPurchaseLimit" : "100000.00" ,
"redeemFeePct" : "0.0010" ,
"dailyRedeemLimit" : "1000000.00" ,
"timstamp" : },
{
"tokenName" : "LINKUP" ,
"description" : "3X LONG ChainLink Token" ,
"underlying" : "LINK" ,
"tokenIssued" : "163846.99" ,
"basket" : "417288.870 LINKUSDT Futures" ,
"currentBaskets" :[
{
"symbol" : "LINKUSDT" ,
"amount" : "1640883.83" ,
"notionalValue" : "22596611.22293"
}
],
"nav" : "9.60" ,
"realLeverage" : "2.597" ,
"fundingRate" : "-0.000917" ,
"dailyManagementFee" : "0.0001" ,
"purchaseFeePct" : "0.0010" ,
"dailyPurchaseLimit" : "100000.00" ,
"redeemFeePct" : "0.0010" ,
"dailyRedeemLimit" : "1000000.00" ,
"timstamp" : }
]
Historical BLVT NAV Kline/Candlestick
The BLVT NAV system
on fapi
based on Binance Futures, so the endpoint
is
Please go to here to check the endpoint and operate
fapi usage specifications.
based
is
accordance with the
in
Subscribe BLVT (USER_DATA)
POST /sapi/v1/blvt/subscribe
Weight(IP):
(HMAC SHA256)
Response:
{
Parameters:
Name
Type
Mandatory
Description
tokenName
STRING
YES
BTCDOWN, BTCUP
"id" : 123 ,
"status" : "S" , // S, P, and F for "success", "pending", and "failure"
"tokenName" : "LINKUP" ,
"amount" : "0.95590905" , // subscribed token amount
"cost" : "9.99999995" , // subscription cost in usdt
"timstamp" : }
cost
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
spot balance
Query Subscription Record (USER_DATA)
GET /sapi/v1/blvt/subscribe/record
Weight(IP):
(HMAC SHA256)
Response:
[
Parameters:
{
Name
Type
Mandatory
Description
tokenName
STRING
NO
BTCDOWN, BTCUP
id
LONG
NO
startTime
LONG
NO
endTime
LONG
NO
limit
INT
NO
recvWindow
LONG
NO
timestamp
LONG
YES
Only the data
}
]
default 1000, max
the latest 90 days
of
"id" : 1 ,
"tokenName" : "LINKUP" ,
"amount" : "0.54216292" , // Subscription amount
"nav" : "18.42621386" , // NAV price of subscription
"fee" : "0.00999000" , // Subscription fee in usdt
"totalCharge" : "9.99999991" , // Subscription cost in usdt
"timstamp" :
available
is
Redeem BLVT (USER_DATA)
POST /sapi/v1/blvt/redeem
Weight(IP):
(HMAC SHA256)
Response:
{
Parameters:
Name
Type
Mandatory
Description
tokenName
STRING
YES
BTCDOWN, BTCUP
"id" : 123 ,
"status" : "S" , // S, P, and F for "success", "pending", and "failure"
"tokenName" : "LINKUP" ,
"redeemAmount" : "0.95590905" ,
// Redemption token amount
"amount" : "10.05022099" ,
// Redemption value in usdt
"timstamp" : }
amount
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Query Redemption Record (USER_DATA)
GET /sapi/v1/blvt/redeem/record
Weight(IP):
(HMAC SHA256)
Response:
[
Parameters:
{
Name
Type
Mandatory
Description
tokenName
STRING
NO
BTCDOWN, BTCUP
id
LONG
NO
}
]
startTime
LONG
NO
endTime
LONG
NO
limit
INT
NO
recvWindow
LONG
NO
timestamp
LONG
YES
Only the data
default 1000, max
the latest 90 days
of
"id" : 1 ,
"tokenName" : "LINKUP" ,
"amount" : "0.54216292" , // Redemption amount
"nav" : "18.36345064" , // NAV of redemption
"fee" : "0.00995598" , // Reemption fee
"netProceed" : "9.94602604" , // Net redemption value in usdt
"timstamp" :
available
is
Get BLVT User Limit Info (USER_DATA)
GET /sapi/v1/blvt/userLimit (HMAC SHA256)
Weight(IP):
Response:
[
Parameters:
{
"tokenName" : "LINKUP" ,
"userDailyTotalPurchaseLimit" : "1000" , // USDT
"userDailyTotalRedeemLimit" : "1000"
// USDT
Name
Type
Mandatory
Description
tokenName
STRING
NO
BTCDOWN, BTCUP
},
{
"tokenName" : "LINKDOWN" ,
"userDailyTotalPurchaseLimit" : "1000" , // USDT
"userDailyTotalRedeemLimit" : "50000"
// USDT
recvWindow
LONG
NO
timestamp
LONG
YES
}
]
Websocket BLVT Info Streams
The BLVT NAV system is based on Binance Futures, so the endpoint
on futures websocket service.
Please go to here to check the stream event and operate
the fstream or fstream3 usage specifications.
based
is
accordance with
in
BLVT NAV Kline/Candlestick Streams
The BLVT NAV system is based on Binance Futures, so the endpoint
on futures websocket service.
Please go to here to check the stream event and operate
the fstream or fstream3 usage specifications.
based
is
accordance with
in
BSwap Endpoints
The endpoints below allow you to interact with BSwap.
For more information on this, please refer to the BSwap page
Swap Pools (MARKET_DATA)
List All
GET /sapi/v1/bswap/pools
Get metadata about
Response:
swap pools.
all
[
Weight(IP):
{
Parameters:
None
"poolId" :
"poolName"
"assets" :
"BUSD"
"USDT"
]
2,
: "BUSD/USDT" ,
[
,
"poolId" :
"poolName"
"assets" :
"BUSD"
"DAI"
]
3,
: "BUSD/DAI" ,
[
,
"poolId" :
"poolName"
"assets" :
"USDT"
"DAI"
]
4,
: "USDT/DAI" ,
[
,
},
{
},
{
}
]
Get liquidity information of
pool (USER_DATA)
a
GET /sapi/v1/bswap/liquidity (HMAC SHA256)
Get liquidity information and user share
Response:
pool.
of a
[
Weight(IP):
1 for
{
"poolId" : 2 ,
"poolNmae" : "BUSD/USDT" ,
"updateTime" : 1565769342148 ,
"liquidity" : {
"BUSD" : 100000315.79 ,
"USDT" : 99999245.},
"share" : {
"shareAmount" : 12415 ,
"sharePercentage" : 0.00006207 ,
"asset" : {
"BUSD" : 6207.02 ,
"USDT" : 6206.}
}
one pool
10 when the poolId parameter
omitted
is
Parameter:
Name
Type
Mandatory
poolId
LONG
NO
recvWindow
LONG
NO
timestamp
LONG
YES
Description
}
]
Add Liquidity (TRADE)
POST /sapi/v1/bswap/liquidityAdd
Add liquidity
(HMAC SHA256)
Response:
pool.
to a
{
Weight(Uid): 1000 (Additional:
times one second)
"operationId" : }
Parameter:
Name
Type
Mandatory
poolId
LONG
YES
type
STRING
NO
asset
STRING
YES
quantity
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Description
"Single" to add a single
token; "Combination" to add
dual tokens. Default "Single"
Remove Liquidity (TRADE)
POST /sapi/v1/bswap/liquidityRemove
(HMAC SHA256)
Remove liquidity from a pool, type include
is mandatory for single asset removal
Response:
and
SINGLE
COMBINATION
asset
,
{
"operationId" :
Weight(Uid): 1000 (Additional:
}
times one second)
Parameters:
Name
Type
Mandatory
poolId
LONG
YES
type
STRING
YES
Description
single asset
SINGLE for
removal, COMBINATION for
combination of all coins
removal
asset
LIST
NO
Mandatory
removal
shareAmount
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
for
single asset
Get Liquidity Operation Record (USER_DATA)
GET /sapi/v1/bswap/liquidityOps
(HMAC SHA256)
Response:
Get liquidity operation (add/remove) records.
[
Weight(Uid):
{
"operationId" : 12341 ,
"poolId" : 2 ,
"poolName" : "BUSD/USDT" ,
"operation" : "ADD" , // "ADD" or "REMOVE"
"status" : 1 , // 0: pending, 1: success, 2: failed
"updateTime" : 1565769342148 ,
"shareAmount" : "10.1"
Parameters:
Name
Type
Mandatory
operationId
LONG
NO
Description
}
]
poolId
LONG
NO
operation
ENUM
NO
startTime
LONG
NO
endTime
LONG
NO
limit
LONG
NO
recvWindow
LONG
NO
timestamp
LONG
YES
or
ADD
REMOVE
default
max
3,
Request Quote (USER_DATA)
GET /sapi/v1/bswap/quote (HMAC SHA256)
Response:
Request a quote for swap quote asset (selling asset)
asset), essentially price/exchange rates.
quantity
quoteQty is
quote asset
of
base asset (buying
for
{
"quoteAsset" : "USDT" ,
"baseAsset" : "BUSD" ,
"quoteQty" : 300000 ,
"baseQty" : 299975 ,
"price" : 1.00008334 ,
"slippage" : 0.00007245 ,
"fee" :
(to sell).
Please be noted the quote is for reference only, the actual price will change
as the liquidity changes, it's recommended to swap immediate after request
a quote for slippage prevention.
}
Weight(Uid): Parameters:
Name
Type
Mandatory
quoteAsset
STRING
YES
baseAsset
STRING
YES
quoteQty
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Description
Swap (TRADE)
POST /sapi/v1/bswap/swap (HMAC SHA256)
Swap
quoteAsset for baseAsset
Response:
.
{
Weight(Uid): 1000 (Additional:
times one second)
"swapId" : }
Parameters:
Name
Type
Mandatory
quoteAsset
STRING
YES
baseAsset
STRING
YES
quoteQty
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Description
Get Swap History (USER_DATA)
GET /sapi/v1/bswap/swap (HMAC SHA256)
Response:
Get swap history.
[
Weight(Uid):
{
"swapId" : 2314 ,
"swapTime" : 1565770342148 ,
"status" : 0 , // 0: pending, 1: success, 2: failed
"quoteAsset" : "USDT" ,
"baseAsset" : "BUSD" ,
"quoteQty" : 300000 ,
"baseQty" : 299975 ,
"price" : 1.00008334 ,
"fee" :
Parameters:
Name
Type
Mandatory
swapId
LONG
NO
startTime
LONG
NO
Description
}
]
endTime
LONG
NO
status
INT
NO
quoteAsset
STRING
NO
baseAsset
STRING
NO
limit
LONG
NO
recvWindow
LONG
NO
timestamp
LONG
YES
pending for swap,
success, 2: failed
0:
default
1:
max
3,
Get Pool Configure (USER_DATA)
GET /sapi/v1/bswap/poolConfigure
(HMAC SHA256)
Response:
Weight(IP): [
Parameters:
{
Name
Type
Mandatory
poolId
LONG
NO
recvWindow
LONG
NO
timestamp
LONG
YES
"poolId" : 2 ,
"poolNmae" : "BUSD/USDT" ,
"updateTime" : 1565769342148 ,
"liquidity" : {
"constantA" : 2000 , //"NA" if pool is an innovation pool
"minRedeemShare" : 0.1 ,
"slippageTolerance" : 0.2 //The swap proceeds only when the slippage
},
"assetConfigure" :{
"BUSD" : {
"minAdd" : 10 ,
"maxAdd" : 20 ,
"minSwap" : 10 ,
"maxSwap" : }
"USDT" : {
"minAdd" : 10 ,
"maxAdd" : 20 ,
"minSwap" : 10 ,
"maxSwap" : }
}
Description
}
]
Add Liquidity Preview (USER_DATA)
GET /sapi/v1/bswap/addLiquidityPreview
Calculate expected share amount
token.
(HMAC SHA256)
adding liquidity
for
Response:
single or dual
in
{
"quoteAsset" : "USDT" ,
"baseAsset" : "BUSD" , //Display
"quoteAmt" : 300000 ,
"baseAmt" : 299975 , // Display
"price" : 1.00008334 ,
"share" : 1.23 ,
"slippage" : 0.00007245 , //Not
"fee" : 120 , // Not display if
Weight(IP): Parameters:
Name
Type
Mandatory
poolId
LONG
YES
type
STRING
YES
quoteAsset
STRING
YES
quoteQty
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Description
for type is "COMBINATION"
for type is "COMBINATION"
display if type is "COMBINATION"
type is "COMBINATION"
}
"SINGLE" for adding a single
token;"COMBINATION" for
adding dual tokens
Remove Liquidity Preview (USER_DATA)
GET /sapi/v1/bswap/removeLiquidityPreview
Calculate the expected asset amount
token redemption.
(HMAC SHA256)
Response:
single token redemption or dual
of
{
"quoteAsset" : "USDT" ,
"baseAsset" : "BUSD" , //Display for type is "COMBINATION"
"quoteAmt" : 300000 ,
"baseAmt" : 299975 , //Display for type is "COMBINATION"
"price" : 1.00008334 ,
"slippage" : 0.00007245 , //Display for type is "SINGLE"
"fee" : 120 //Display for type is "SINGLE"
Weight(IP): Parameters:
Name
Type
Mandatory
poolId
LONG
YES
type
STRING
YES
quoteAsset
STRING
YES
shareAmount
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Description
}
Type is "SINGLE", remove
and obtain a single
token;Type is
"COMBINATION", remove
and obtain dual token.
Fiat Endpoints
Get Fiat Deposit/Withdraw History (USER_DATA)
GET /sapi/v1/fiat/orders (HMAC SHA256)
Weight(IP):
Response:
{
Parameters:
Name
Type
Mandatory
Description
transactionType
STRING
YES
0-deposit,1-withdraw
beginTime
LONG
NO
endTime
LONG
NO
page
INT
NO
default
rows
INT
NO
default 100, max
recvWindow
LONG
NO
timestamp
LONG
YES
"code" : "000000" ,
"message" : "success" ,
"data" : [
{
"orderNo" : "7d76d611-0568-4f43-afb6-24cac7767365" ,
"fiatCurrency" : "BRL" ,
"indicatedAmount" : "10.00" ,
"amount" : "10.00" ,
"totalFee" : "0.00" ,
// Trade fee
"method" : "BankAccount" , // Trade method
"status" : "Expired" , // Processing, Failed, Successful, Finished,
"createTime" : 1626144956000 ,
"updateTime" : }
],
"total" : 1 ,
"success" : true
Refunding,
}
beginTime and endTime are not sent, the recent 30-day data
returned.
will
If
be
Get Fiat Payments History (USER_DATA)
GET /sapi/v1/fiat/payments (HMAC SHA256)
Weight(IP):
Response:
{
Parameters:
Name
Type
Mandatory
Description
transactionType
STRING
YES
0-buy,1-sell
beginTime
LONG
NO
endTime
LONG
NO
page
INT
NO
default
rows
INT
NO
default 100, max
recvWindow
LONG
NO
"code" : "000000" ,
"message" : "success" ,
"data" : [
{
"orderNo" : "353fca443f06466db0c4dc89f94f027a" ,
"sourceAmount" : "20.0" , // Fiat trade amount
"fiatCurrency" : "EUR" ,
// Fiat token
"obtainAmount" : "4.462" , // Crypto trade amount
"cryptoCurrency" : "LUNA" , // Crypto token
"totalFee" : "0.2" ,
// Trade fee
"price" : "4.437472" ,
"status" : "Failed" , // Processing, Completed, Failed, Refunded
"createTime" : 1624529919000 ,
"updateTime" : }
],
"total" : 1 ,
"success" : true
}
timestamp
LONG
YES
beginTime and endTime are not sent, the recent 30-day data
returned.
will
If
be
C2C Endpoints
Get C2C Trade History (USER_DATA)
GET /sapi/v1/c2c/orderMatch/listUserOrderHistory (HMAC SHA256)
Weight(IP):
Response:
{
Parameters:
Name
Type
Mandatory
Description
tradeType
STRING
YES
BUY, SELL
startTimestamp
LONG
NO
endTimestamp
LONG
NO
page
INT
NO
default
rows
INT
NO
recvWindow
LONG
NO
timestamp
LONG
YES
"code" : "000000" ,
"message" : "success" ,
"data" : [
{
"orderNumber" : "20219644646554779648" ,
"advNo" : "11218246497340923904" ,
"tradeType" : "SELL" ,
"asset" : "BUSD" ,
"fiat" : "CNY" ,
"fiatSymbol" : "¥" ,
"amount" : "5000.00000000" , // Quantity (in Crypto)
"totalPrice" : "33400.00000000" ,
"unitPrice" : "6.68" , // Unit Price (in Fiat)
"orderStatus" : "COMPLETED" , // PENDING, TRADING, BUYER_PAYED,
"createTime" : 1619361369000 ,
"commission" : "0" ,
// Transaction Fee (in Crypto)
"counterPartNickName" : "ab***" ,
"advertisementRole" : "TAKER"
}
],
"total" : 1 ,
"success" : true
default 100, max
startTimestamp and endTimestamp are not sent, the recent 30-day
data will be returned.
The max interval between startTimestamp and endTimestamp is 30 days.
If
}
Error Codes
Errors consist of two parts: an error code and
universal, but messages can vary.
message. Codes are
a
The error JSON payload:
{
"code" : - 1121 ,
"msg" : "Invalid symbol."
}
10xx
General Server or Network issues
-
-1000 UNKNOWN
An unknown error occurred while processing the request.
An unknown error occurred while processing the request.[%s]
-1001 DISCONNECTED
Internal error; unable
process your request. Please
to
again.
try
-1002 UNAUTHORIZED
You are not authorized
execute this request.
to
-1003 TOO_MANY_REQUESTS
Too many requests queued.
Too much request weight used; please use the websocket for live updates
to avoid polling the API.
Too much request weight used; current limit is %s request weight per %s
%s. Please use the websocket for live updates to avoid polling the API.
Way too much request weight used; IP banned until %s. Please use the
websocket for live updates to avoid bans.
-1004 SERVER_BUSY
Server
busy, please wait and
is
again
try
-1006 UNEXPECTED_RESP
An unexpected response was received from the message bus. Execution
status unknown.
-1007 TIMEOUT
Timeout waiting for response from backend server. Send status unknown;
execution status unknown.
-1014 UNKNOWN_ORDER_COMPOSITION
Unsupported order combination.
-1015 TOO_MANY_ORDERS
Too many new orders.
Too many new orders; current
limit
%s orders per %s.
is
-1016 SERVICE_SHUTTING_DOWN
This service
no longer available.
is
-1020 UNSUPPORTED_OPERATION
This operation
not supported.
is
-1021 INVALID_TIMESTAMP
Timestamp
Timestamp
request is outside of the recvWindow.
request was 1000ms ahead of the server's time.
for this
for this
-1022 INVALID_SIGNATURE
Signature
request
for this
not
is
valid.
-1099 Not found, authenticated, or authorized
This replaces error code -
11xx
2xxx Request issues
-
-1100 ILLEGAL_CHARS
characters found
characters found
characters found
Illegal
Illegal
Illegal
parameter.
a parameter. %s
parameter %s legal range
in a
in
in
%s
is
;
.
-1101 TOO_MANY_PARAMETERS
Too many parameters sent for this endpoint.
Too many parameters; expected %s and received
Duplicate values for a parameter detected.
%s
.
-1102 MANDATORY_PARAM_EMPTY_OR_MALFORMED
A mandatory parameter was not sent, was empty/null, or malformed.
Mandatory parameter %s was not sent, was empty/null, or malformed.
Param %s or %s must be sent, but both were empty/null!
-1103 UNKNOWN_PARAM
An unknown parameter was sent.
-1104 UNREAD_PARAMETERS
Not
Not
s
sent parameters were read.
sent parameters were read; read
all
all
parameter(s) but was sent
%s
%
.
-1105 PARAM_EMPTY
A parameter was empty.
Parameter %s was empty.
-1106 PARAM_NOT_REQUIRED
A parameter was sent when not required.
Parameter %s sent when not required.
-1111 BAD_PRECISION
Precision
over the maximum defined
is
asset.
for this
-1112 NO_DEPTH
No orders on book
symbol.
for
-1114 TIF_NOT_REQUIRED
TimeInForce parameter sent when not required.
-1115 INVALID_TIF
Invalid timeInForce.
-1116 INVALID_ORDER_TYPE
Invalid orderType.
-1117 INVALID_SIDE
Invalid side.
-1118 EMPTY_NEW_CL_ORD_ID
New client order ID was empty.
-1119 EMPTY_ORG_CL_ORD_ID
Original client order ID was empty.
-1120 BAD_INTERVAL
Invalid interval.
-1121 BAD_SYMBOL
Invalid symbol.
-1125 INVALID_LISTEN_KEY
This listenKey does not
exist.
-1127 MORE_THAN_XX_HOURS
Lookup interval is too big.
More than %s hours between startTime and endTime.
-1128 OPTIONAL_PARAMS_BAD_COMBO
Combination
optional parameters invalid.
of
-1130 INVALID_PARAMETER
Invalid data sent for a parameter.
Data sent for parameter %s is not
valid.
-1131 BAD_RECV_WINDOW
recvWindow must be less than
-2010 NEW_ORDER_REJECTED
NEW_ORDER_REJECTED
-2011 CANCEL_REJECTED
CANCEL_REJECTED
-2013 NO_SUCH_ORDER
Order does not
exist.
-2014 BAD_API_KEY_FMT
API-key format invalid.
-2015 REJECTED_MBX_KEY
Invalid API-key,
or permissions
IP,
action.
for
-2016 NO_TRADING_WINDOW
No trading window could be found
instead.
the symbol.
for
ticker/24hrs
Try
3xxx-5xxx SAPI-specific issues
-3000 INNER_FAILURE
Internal server error.
-3001 NEED_ENABLE_2FA
Please enable 2FA
first.
-3002 ASSET_DEFICIENCY
We don't have this asset.
-3003 NO_OPENED_MARGIN_ACCOUNT
Margin account does not
exist.
-3004 TRADE_NOT_ALLOWED
Trade not allowed.
-3005 TRANSFER_OUT_NOT_ALLOWED
Transferring out not allowed.
-3006 EXCEED_MAX_BORROWABLE
Your borrow amount has exceed maximum borrow amount.
-3007 HAS_PENDING_TRANSACTION
You have pending transaction, please
again
try
later.
-3008 BORROW_NOT_ALLOWED
Borrow not allowed.
-3009 ASSET_NOT_MORTGAGEABLE
This asset are not allowed
transfer into margin account currently.
to
-3010 REPAY_NOT_ALLOWED
Repay not allowed.
-3011 BAD_DATE_RANGE
Your input date
invalid.
is
-3012 ASSET_ADMIN_BAN_BORROW
Borrow
banned
is
asset.
for this
-3013 LT_MIN_BORROWABLE
Borrow amount less than minimum borrow amount.
-3014 ACCOUNT_BAN_BORROW
Borrow
banned
is
account.
for this
-3015 REPAY_EXCEED_LIABILITY
Repay amount exceeds borrow amount.
-3016 LT_MIN_REPAY
Repay amount less than minimum repay amount.
-3017 ASSET_ADMIN_BAN_MORTGAGE
This asset are not allowed
transfer into margin account currently.
to
-3018 ACCOUNT_BAN_MORTGAGE
Transferring
has been banned
in
account.
for this
-3019 ACCOUNT_BAN_ROLLOUT
Transferring out has been banned
account.
for this
-3020 EXCEED_MAX_ROLLOUT
Transfer out amount exceeds max amount.
-3021 PAIR_ADMIN_BAN_TRADE
Margin account are not allowed
to
trade
trading
this
pair.
-3022 ACCOUNT_BAN_TRADE
You account's trading
banned.
is
-3023 WARNING_MARGIN_LEVEL
You can't transfer out/place order under current margin
level.
-3024 FEW_LIABILITY_LEFT
The unpaid debt
too small after this repayment.
is
-3025 INVALID_EFFECTIVE_TIME
Your input date
invalid.
is
-3026 VALIDATION_FAILED
Your input param
invalid.
is
-3027 NOT_VALID_MARGIN_ASSET
Not
valid margin asset.
a
-3028 NOT_VALID_MARGIN_PAIR
Not
valid margin
a
pair.
-3029 TRANSFER_FAILED
Transfer failed.
-3036 ACCOUNT_BAN_REPAY
This account
not allowed
is
repay.
to
-3037 PNL_CLEARING
PNL
clearing. Wait
is
second.
a
-3038 LISTEN_KEY_NOT_FOUND
Listen key not found.
-3041 BALANCE_NOT_CLEARED
Balance
not enough
is
-3042 PRICE_INDEX_NOT_FOUND
PriceIndex not available
margin
for this
pair.
-3043 TRANSFER_IN_NOT_ALLOWED
Transferring
not allowed.
in
-3044 SYSTEM_BUSY
System busy.
-3999 NOT_WHITELIST_USER
This function
only available
is
invited users.
for
-4001 CAPITAL_INVALID
Invalid operation.
-4002 CAPITAL_IG
Invalid get.
-4003 CAPITAL_IEV
Your input email
invalid.
is
-4004 CAPITAL_UA
You don't login or auth.
-4005 CAPAITAL_TOO_MANY_REQUEST
Too many new requests.
-4006 CAPITAL_ONLY_SUPPORT_PRIMARY_ACCOUNT
Support main account only.
-4007 CAPITAL_ADDRESS_VERIFICATION_NOT_PASS
Address validation
not passed.
is
-4008 CAPITAL_ADDRESS_TAG_VERIFICATION_NOT_PASS
Address tag validation
not passed.
is
-4010 CAPITAL_WHITELIST_EMAIL_CONFIRM
White
mail has been confirmed.
list
-4011 CAPITAL_WHITELIST_EMAIL_EXPIRED
White
mail
list
invalid.
is
-4012 CAPITAL_WHITELIST_CLOSE
White
not opened.
list is
-4013 CAPITAL_WITHDRAW_2FA_VERIFY
2FA
not opened.
is
-4014 CAPITAL_WITHDRAW_LOGIN_DELAY
Withdraw
not allowed within
is
min login.
Case 1:23-cv-01599-ABJ Document 15-1 Filed 06/06/23 Page 17 of 30
Buy Crypto
Express
EUR
Markets
Trade
Derivatives
Finance
NFT
Log In
New
Register
Downloads
P2P
English
Video tutorial
P2P Merchant Application
Become
a
Binance P2P Merchant and enjoy more benefits
Advanced Ads Management
Verified Badges
Merchants can access more trading tools via the
merchant portal to better manage advertisements
and trading activities.
A verified badge will be added beside your P2P
nickname, adding credibility to your brand.
Exclusive Customer Support
Binance provides one-on-one services, with fast
response to your requests or issues.
Requirements
Complete advanced identity verification
Complete SMS and email authentication
A certain amount of BUSD must be available
Apply now
in
your spot account
USD
Case 1:23-cv-01599-ABJ Document 15-1 Filed 06/06/23 Page 19 of 30
Buy Crypto
Express
EUR
Markets
Trade
Derivatives
Finance
NFT
Log In
New
Register
Downloads
P2P
English
Video tutorial
P2P Merchant Application
Become
a
Binance P2P Merchant and enjoy more benefits
Advanced Ads Management
Verified Badges
Merchants can access more trading tools via the
merchant portal to better manage advertisements
and trading activities.
A verified badge will be added beside your P2P
nickname, adding credibility to your brand.
Exclusive Customer Support
Binance provides one-on-one services, with fast
response to your requests or issues.
Requirements
Complete advanced identity verification
Complete SMS and email authentication
A certain amount of BUSD must be available
Apply now
in
your spot account
USD
Case 1:23-cv-01599-ABJ Document 15-1 Filed 06/06/23 Page 25 of 30
Top Questions
Identity verification failed
Ofiary oszustwa z Polski (for Polish users)
Log in
/
Identification
USA users off-boarding guidance
Google
/
Email 2FA issues
Crypto deposit
/
withdraw
Restricted Countries
Unable to cancel Spot order
API key permissions
Fiat deposit
/
withdraw
Australia verification failed
Trading
Next page
PDF Page 27
Case 1:23-cv-01599-ABJ Document 15-1 Filed 06/06/23 Page 26 of 30
Spot/Margin/Savings/Mining
USDⓈ-M Futures
COIN-M Futures
Vanilla Options
简体中文
Change Log
Change Log
2021-09-18
New endpoints
Introduction
BSwap:
for
get pool configure
GET /sapi/v1/bswap/addLiquidityPreview to get add liquidity
preview
GET /sapi/v1/bswap/removeLiquidityPreview to get remove
liquidity preview
GET /sapi/v1/bswap/poolConfigure
General Info
Wallet Endpoints
to
Sub-Account Endpoints
Market Data Endpoints
2021-09-17
Add
Websocket Market Streams
and
/api/*
introduction
/sapi/* limit
General Info
in
Spot Account/Trade
Margin Account/Trade
2021-09-08
Add endpoints
User Data Streams
enabled isolated margin account
for
limit:
disable isolated
DELETE /sapi/v1/margin/isolated/account to
margin account
Savings Endpoints
specific symbol
for a
enable isolated margin
POST /sapi/v1/margin/isolated/account to
account
Mining Endpoints
specific symbol
for a
GET /sapi/v1/margin/isolated/accountLimit
query enabled
to
isolated margin account limit
New field "enabled" in response of GET /sapi/v1/margin/isolated/accoun
t to check if the isolated margin account is enabled
Futures
BLVT Endpoints
BSwap Endpoints
2021-09-03
Update endpoint for Wallet:
New fields sameAddress depositDust and specialWithdrawTips
added in GET /sapi/v1/capital/config/getall sameAddress
means if the coin needs to provide memo to withdraw depositDus
t means minimum creditable amount specialWithdrawTips means
special tips for withdraw
New field confirmNo added in GET /sapi/v1/capital/withdraw/hist
ory to support query confirm times for withdraw history
,
2021-08-27
Update endpoint for Wallet:
New parameter withdrawOrderId added in GET /sapi/v1/capital/w
ithdraw/history to support user query withdraw history by
withdrawOrderId
New field unlockConfirm added in GET /sapi/v1/capital/deposit/h
isrec to support query network confirm times for unlocking
2021-08-23
New endpoints
Margin Account OCO:
for
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
and new transfer types ISOL
ATEDMARGIN_MARGIN MARGIN_ISOLATEDMARGIN and ISOLATEDMARGIN_IS
OLATEDMARGIN added in POST /sapi/v1/asset/transfer and GET /s
api/v1/asset/transfer to support user transfer assets between
Margin(cross) account and Margin(isolated) account
toSymbol
,
,
2021-08-12
GET
has
api/v3/myTrades
new optional
a
field orderId
2021-08-05
New endpoint
C2C:
for
query user
GET /sapi/v1/c2c/orderMatch/listUserOrderHistory to
C2C trade history
2021-08-05
Update endpoints
Savings:
for
GET /sapi/v1/lending/union/purchaseRecord
GET /sapi/v1/lending/union/redemptionRecord
GET /sapi/v1/lending/union/interestHistory
The time between
If startTime and
be returned
and endTime cannot be longer than 30 days.
are both not sent, then the last 30 days' data will
startTime
endTime
2021-07-29
Update endpoint
Sub-Account:
for
GET /sapi/v1/sub-account/transfer/subUserHistory
and endTime are not sent, the recent 30-day data
by default
startTime
if
be returned
will
2021-07-27
New endpoint
for Fiat:
GET /sapi/v1/fiat/orders
query user
to
deposit and withdraw
fiat
history
query user
GET /sapi/v1/fiat/payments to
payments history
fiat
2021-07-16
New endpoint
Wallet:
for
query user API Key
GET /sapi/v1/account/apiRestrictions to
permission
2021-07-09
New endpoint
Wallet:
for
query funding wallet,
includes Binance Pay, Binance Card, Binance Gift Card, Stock Token
POST /sapi/v1/asset/get-funding-asset to
2021-06-24
Update endpoints
Wallet:
for
added default value 1000,
GET /sapi/v1/capital/withdraw/history
max value 1000
the parameter
for
limit
added default value 1000,
GET /sapi/v1/capital/deposit/hisrec
max value 1000
the parameter
for
limit
2021-06-17
Update endpoint
Savings:
for
GET /sapi/v1/lending/daily/product/list
parameters
and
current
include new
to
size
2021-06-15
New endpoints
Sub-Account:
for
deposit assets into
the managed sub-account (only for investor master account)
GET /sapi/v1/managed-subaccount/asset to query managed subaccount 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)
POST /sapi/v1/managed-subaccount/deposit
to
2021-06-04
On August 01, 2021 02:00 AM UTC the WAPI endpoints
discontinued:
be
will
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 endpoint POST /sapi/v1/asset/transfer and GET /sapi/v
1/asset/transfer to support trasnfer assets between spot account
and pay account
,
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
be discontinued:
will
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/isola
ted/transfer
2021-04-26
On April 28, 2021 00:00 UTC the weights
be adjusted:
the following endpoints
to
will
weight increased to 2
weight increased to 3
/api/v3/allOrders weight increased to 10
/api/v3/orderList weight increased to 2
/api/v3/openOrderList weight increased to 3
/api/v3/account weight increased to 10
/api/v3/myTrades weight increased to 10
/api/v3/exchangeInfo weight increased to 10
GET /api/v3/order
GET /api/v3/openOrders
GET
GET
GET
GET
GET
GET
2021-04-08
Update endpoint
Sub-Account:
for
and
GET /sapi/v1/sub-account/futures/accountSummary
GET /sap
the unit of field
sub-account assets
i/v2/sub-account/futures/accountSummary
changed
USD valued summary
to
of
asset
2021-04-02
New endpoints
Wallet:
for
query system status
GET /sapi/v1/account/status to query account status
GET /sapi/v1/account/apiTradingStatus to query account API
trading status
GET /sapi/v1/asset/dribblet to query dust log
GET /sapi/v1/asset/assetDetail to query asset detail
GET /sapi/v1/asset/tradeFee to query trade fee
New endpoint for Sub-Account:
GET /sapi/v3/sub-account/assets to query sub-account assets
GET /sapi/v1/system/status to
2021-04-01
Update endpoint
Sub-Account:
for
new fields
GET /sapi/v1/sub-account/transfer/subUserHistory
and
omAccountType
added
toAccountType
fr
response
in
2021-03-31
Update endpoint
Sub-Account:
for
added new
the original parameter email
GET /wapi/v3/sub-account/transfer/history.html
parameters fromEmail and toEmail
is equal to fromEmail by default
,
2021-03-08
New endpoint
Sub-Account:
for
POST /sapi/v1/sub-account/virtualSubAccount
support create
to
a
virtual sub-account
support query sub-account list
POST /sapi/v1/sub-account/blvt/enable to support enable blvt for
sub-account
GET /sapi/v1/sub-account/list
to
2021-03-05
New endpoints
Margin:
for
GET /sapi/v1/margin/interestRateHistory
support margin
to
interest rate history query
2021-02-08
New endpoints
Futures:
for
support BUSD loan query
/sapi/v2/futures/loan/configs to support BUSD loan query
/sapi/v2/futures/loan/calcAdjustLevel to support BUSD
GET /sapi/v2/futures/loan/wallet
GET
GET
to
loan
GET /sapi/v2/futures/loan/calcMaxAdjustAmount
adjustment
BUSD loan
of
POST /sapi/v2/futures/loan/adjustCollateral
adjustment
Update endpoints
support
to
support
to
BUSD loan
for Futures
of
new
parameter and fields in response loanCoin for BUSD loan
GET /sapi/v1/futures/loan/liquidationHistory new parameter
and fields in response loanCoin for BUSD loan
GET /sapi/v1/futures/loan/adjustCollateral/history
2021-02-04
New transfer types
IN
endpoint
MINING_MARGIN
,
added
/sapi/v1/asset/transfer and
MARGIN_CMFUTURE
,
er
MARGIN_MINING
POST
CMFUTURE_MARGIN
,
MARGIN_C2C
,
C2C_MARG
,
Universal Transfer
in
GET /sapi/v1/asset/transf
.
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
Mining endpoint
pageSize for
GET /sapi/v1/mining/paym
ent/list
New fields
t/list
response
in
Mining endpoint
to
GET /sapi/v1/mining/paymen
:
"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
has been removed.
outboundAccountInfo
2020-12-30
New endpoint
Wallet:
for
support user universal transfer
among Spot, Margin, Futures, C2C, MINING accounts.
GET /sapi/v1/asset/transfer to get user universal transfer history.
POST /sapi/v1/asset/transfer
to
2020-12-22
New endpoint
Sub-Account:
for
GET /sapi/v1/sub-account/sub/transfer/history
get spot asset
to
transfer history.
2020-12-11
Update endpoints
Futures Cross-Collateral:
GET /sapi/v1/futures/loan/wallet new fields in response interes
tFreeLimit for total interest free limit, interestFreeLimitUsed for
interest free limit used.
GET /sapi/v1/futures/loan/interestHistory new fields in
response interestFreeLimitUsed for interest free limit used.
for
2020-12-04
Update endpoint
BLVT:
for
new fields
GET /sapi/v1/blvt/tokenInfo
(include
ts
symbol
yPurchaseLimit
New endpoint
amount
,
notionalValue
,
redeemFeePct
,
response
in
purchaseFeePct
),
dailyRedeemLimit
,
currentBaske
dail
,
.
BLVT:
for
get BLVT user
GET /sapi/v1/blvt/userLimit to
limit info.
2020-12-02
New endpoints
Sub-Account:
for
get detail on subaccount'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.
GET /sapi/v2/sub-account/futures/account
to
2020-12-01
Update Margin Trade Endpoint:
new parameter quoteOrderQty allow
a user to specify the total quoteOrderQty spent or received in the
MARKET order.
POST /sapi/v1/margin/order
2020-11-27
New API clusters have been added
Users can access any
order
in
improve performance.
to
the following API clusters,
of
addition
in
to api.binanc
e.com
there are any performance issues with accessing
try any of the following instead:
please
api.binance.com
If
https://api1.binance.com/api/v3/*
https://api2.binance.com/api/v3/*
https://api3.binance.com/api/v3/*
2020-11-16
Updated endpoints
from 6 months ago:
Margin, new parameter
for
query data
archived to
GET /sapi/v1/margin/loan
GET /sapi/v1/margin/repay
GET /sapi/v1/margin/interestHistory
2020-11-13
New endpoints
Sub-Account:
for
transfer spot
and futures asset between master account and sub accounts.
GET /sapi/v1/sub-account/universalTransfer to search transfer
records.
POST /sapi/v1/sub-account/universalTransfer
to
2020-11-10
New endpoint
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.
to
2020-11-09
New
field tranId
available from endpoints:
is
GET /sapi/v1/sub-account/futures/internalTransfer
GET /sapi/v1/sub-account/transfer/subUserHistory
2020-11-03
Update endpoints
Futures Cross-Collateral:
for
new fields
GET /sapi/v1/futures/loan/repay/history
response
in
normal repayment, COLLATERAL for
collateral repayment), price (collateral repayment rate), repayColl
ateral (collateral amount for collateral repayment).
GET /sapi/v1/futures/loan/wallet new fields in response totalIn
terest (total interest for cross-collateral), principalForInterest
(cross-collateral principal for interest), interest (cross-collateral
interest).
GET /sapi/v1/futures/loan/configs new fields in response intere
stRate (interest rate for cross-collateral), interestGracePeriod
(interest grace period for cross-collateral).
New endpoints for Futures Cross-Collateral:
repayType
NORMAL for
(
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 crosscollateral interest history.
GET /sapi/v1/futures/loan/collateralRepayLimit
to
2020-10-14
Update endpoints
Futures Cross-Collateral:
POST /sapi/v1/futures/loan/borrow and GET /sapi/v1/futures/lo
an/borrow/history new field borrowId in response for ID of CrossCollateral borrow operation.
POST /sapi/v1/futures/loan/repay and GET /sapi/v1/futures/loa
n/repay/history new field repayId in response for ID of CrossCollateral repay operation.
for
2020-10-10
New
added in the endpoint POST /sapi/v1/sub-account/futures/tr
ansfer 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.
type
2020-09-30
Update endpoints
Margin Account:
for
new
GET /sapi/v1/margin/maxBorrowable
response
for
account borrow
for
Binance Savings:
field borrowLimit in
limit.
2020-09-28
New endpoints
change fixed/activity
POST /sapi/v1/lending/positionChanged to
position to daily position.
New parameter ACTIVITY replace
Savings endpoints:
the following Binance
REGULAR in
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
BSwap:
for
GET /sapi/v1/bswap/pools
swap pools.
get liquidity information
to list all
GET /sapi/v1/bswap/liquidity to
of a
pool.
POST /sapi/v1/bswap/liquidityAdd
add liquidity.
to remove liquidity.
get liquidity operation
to
POST /sapi/v1/bswap/liquidityRemove
GET /sapi/v1/bswap/liquidityOps
to
record.
request quotes.
to swap.
to get swap history.
GET /sapi/v1/bswap/quote
to
POST /sapi/v1/bswap/swap
GET /sapi/v1/bswap/swap
2020-09-16
New SAPI endpoints
BLVT:
for
get BLVT
GET /sapi/v1/blvt/tokenInfo to
POST /sapi/v1/blvt/subscribe
info.
subscribe BLVT.
SHA256) to get
(HMAC SHA256) to
GET /sapi/v1/blvt/subscribe/record
(HMAC
subscription record。
POST /sapi/v1/blvt/redeem
redeem BLVT.
SHA256 to get redemption
(HMAC SHA256) to
GET /sapi/v1/blvt/redeem/record
(HMAC
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:
2020-09-09
USER DATA STREAM
has been deprecated.
outboundAccountInfo will be removed in the future. (Exact date unknown)
Please use outboundAccountPosition instead.
outboundAccountInfo will now only show the balance of non-zero assets
and assets that have been reduced to 0.
outboundAccountInfo
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
added in the endpoint
get BTC valued asset summary
masterAccountTotalAsset
pi/v1/sub-account/spotSummary to
GET /sa
of
master account.
2020-08-27
New endpoint
asset summary
get BTC valued
GET /sapi/v1/sub-account/spotSummary to
subaccout.
of
2020-08-26
New parameter
lated/account
added
symbols
the endpoint
in
GET /sapi/v1/margin/iso
.
2020-07-28
ISOLATED MARGIN
New parameters "isIsolated" and "symbol" added
the following endpoints:
isolated margin
for
in
POST /sapi/v1/margin/loan
POST /sapi/v1/margin/repay
New parameter "isIsolated" and new response
isolated margin in the following endpoints:
"isIsolated" added
field
for
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
added for isolated margin in the following endpoint
"isIsolated"
field
GET /sapi/v1/margi
n/forceLiquidationRec
New parameter "isolatedSymbol" added
following endpoints:
isolated margin
for
the
in
GET /sapi/v1/margin/maxBorrowable
GET /sapi/v1/margin/maxTransferable
New endpoints
isolated margin:
for
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
listenKey management
for
isolated margin account:
of
POST /sapi/v1/userDataStream/isolated
PUT /sapi/v1/userDataStream/isolated
DELETE /sapi/v1/userDataStream/isolated
2020-07-20
The max value of parameter "limit"
has been changed as 500.
in GET /sapi/v1/margin/allOrders
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
futures Cross-Collateral:
for
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
futures:
for
POST /sapi/v1/futures/transfer
GET /sapi/v1/futures/transfer
2020-05-06
New endpoints
Mining:
for
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-03
New request limit for some margin endpoints
Changes on these endpoints:
POST /sapi/v1/margin/transfer
POST /sapi/v1/margin/loan
POST /sapi/v1/margin/repay
Limit to 1 every 2 seconds。
Request beyond the limit will receive HTTP status code
。
429
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 the STOP_LOSS (or STOP_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
replace
permissions will
on
ngAllowed
and isMarginTradi
future API versions
isSpotTradingAllowed
GET api/v3/exchangeInfo in
(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 the quotePre
cision field. quotePrecision will be removed in future API
versions (v4+).
Updates to GET api/v3/account
New field permissions added.
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 or HALT
status.
USER DATA STREAM
has new
the account.
permissions
of
which shows the trading
field P
OutboundAccountInfo
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.
2020-04-16
New fields
sition :
response
in
endpoint
to
GET /sapi/v1/lending/daily/token/po
user's purchased amount today
customized fixed projects:
todayPurchasedAmount for
New lending endpoints
for
GET /sapi/v1/lending/project/list
POST /sapi/v1/lending/customizedFixed/purchase
GET /sapi/v1/lending/project/position/list
2020-04-02
New fields
l :
response
in
endpoint
to
GET /sapi/v1/capital/config/getal
min number for balance confirmation
for confirmation number for balance unlock
minConfirm for
unLockConfirm
2020-03-24
added.
MAX_POSITION filter
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
available in endpoint:
/sapi/v1/capital/withdraw/apply and
POST
transactionFeeFlag
is
POST /wapi/v3/withdraw.html
2020-02-05
New sub account endpoints:
POST /sapi/v1/sub-account/futures/transfer
futures and spot accout
sub-account.
of
POST /sapi/v1/sub-account/margin/transfer
margin and spot accout
transfer between
to
transfer between
to
sub-account.
of
POST /sapi/v1/sub-account/transfer/subToSub
transfer
to
to
another account by sub-account.
POST /sapi/v1/sub-account/transfer/subToMaster
transfer
to
to
same master by sub-account.
get
GET /sapi/v1/sub-account/transfer/subUserHistory to
transfer history
sub-account.
of
2020-01-15
New parameter
endpoint POST
New
client customized withdraw
for
withdrawOrderId
/wapi/v3/withdraw.html
.
response
field withdrawOrderId in
id for
to GET /wapi/v3/withdrawHistor
y.html
2019-12-25
New endpoints
Binance Savings:
for
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
,
,
and
GET /sapi/v1/capital/deposit/hisrec
GET /wapi/v3/depositHistory.html
:
The default startTime is 90 days from current time, and the
default endTime is current time.
Please notice the default startTime and endTime to make sure
that time interval is within 0-90 days.
If both startTime and endTime are sent, time between startTime
and endTime must be less than 90 days.
2019-12-18
New endpoint
get daily snapshot
to
account:
of
GET /sapi/v1/accountSnapshot
2019-11-30
Added parameter sideEffectType
SHA256) with enums:
in POST /sapi/v1/margin/order
normal trade order;
MARGIN_BUY for margin trade order;
AUTO_REPAY for making auto repayment after order filled.
New field marginBuyBorrowAmount and marginBuyBorrowAsset in
response to POST /sapi/v1/margin/order (HMAC SHA256)
(HMAC
NO_SIDE_EFFECT for
FULL
2019-11-28
New SAPI endpont
disable fast withdraw switch:
to
POST /sapi/v1/account/disableFastWithdrawSwitch
New SAPI endpont
(HMAC SHA256)
enable fast withdraw switch:
to
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 total qu
oteOrderQty spent or received in the MARKET order.
Quote Order Qty MARKET orders will not break LOT_SIZE filter
rules; the order will execute a quantity that will have the notional
value as close as possible to quoteOrderQty
Using BNBBTC as an example:
On the BUY side, the order will buy as many BNB as quoteOr
derQty BTC can.
On the SELL side, the order will sell as much BNB as needed
to receive quoteOrderQty BTC.
.
2019-11-19
has new
GET /sapi/v1/sub-account/margin/account
field: marginTradeCoe
which contains
ffVo
liquidation margin ratio
for margin call margin ratio
initial margin ratio
forceLiquidationBar for
marginCallBar
normalBar for
2019-11-13
Rest API
api/v3/exchangeInfo has new
fields:
quoteOrderQtyMarketAllowed
baseCommissionPrecision
quoteCommissionPrecision
orders have a new optional field: quoteOrderQty used to specify
the quote quantity to BUY or SELL. This cannot be used in combination
with quantity
The exact timing that quoteOrderQty MARKET orders will be
enabled is TBD. There will be a separate announcement and
further details at that time.
All order query endpoints will return a new field origQuoteOrderQty in
the JSON payload. (e.g. GET api/v3/allOrders)
MARKET
.
Updated error messages
Sending an
-1128
for
{
with a stopLimitPrice but without a stopLimitTi
meInForce will return the error:
Updated error messages for -1003 to specify the limit is referring to the
request weight, not to the number of requests.
OCO
Deprecation of v1 endpoints
"code" : -1128 ,
"msg" : "Combination of optional parameters invalid. Recommendation:
'stopLimitTimeInForce'
}
:
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
USER DATA STREAM
Changes
event
to executionReport
the
If
C field
"null"
New
empty,
is
now properly return
will
it
null
instead
,
of
.
Q which represents the
event type added
field
balanceUpdate
quoteOrderQty
.
This event occurs when funds are deposited or withdrawn from
your account.
WEB SOCKET STREAM
WSS now supports
subscribing/unsubscribing
live
streams.
to
2019-11-08
New sapi
subaccount management on margin and futures:
for
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
subaccount wallet.
for
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
wallet.
for
POST /sapi/v1/capital/withdraw/apply
(HMAC SHA256)
withdraw.
fetch
:
Get /sapi/v1/capital/withdraw/history (HMAC SHA256)
:
withdraw history with network.
2019-10-14
New sapi endpoints
wallet.
for
GET /sapi/v1/capital/config/getall
information
(HMAC SHA256)
get
:
coins'
all
user.
for
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 in POST /wapi/v3/withdraw.html so that asset
can be withdrawed with specific network.
2019-09-09
New WebSocket streams
and !bookTicker
bookTickers added:
for
@bookTicker
.
2019-09-03
Faster order book data with 100ms updates:
and
@depth@100ms
<
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
10000 has been temporarily removed
limit of
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:
In
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
orders: (also known as legs in financial terms)
STOP_LOSS or STOP_LOSS_LIMIT leg
LIMIT_MAKER leg
Price Restrictions:
SELL Orders
Limit Price > Last Price > Stop Price
BUY 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 or STOP_L
OSS_LIMIT will trigger, the Limit Maker leg will be cancelled
BEFORE executing the STOP_LOSS Leg.
Cancelling an OCO
Cancelling either order leg will cancel the entire OCO.
The entire OCO can be canceled via the orderListId or the
2
:
:
.
listClientOrderId
New Enums
.
OCO:
for
ListStatusType
used when ListStatus is responding to
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.
RESPONSE
a
-
ListOrderStatus
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)
EXECUTING
-
ContingencyType
OCO
specifies the type
-
order
of
list.
New Endpoints:
POST api/v3/order/oco
DELETE api/v3/orderList
GET api/v3/orderList
recvWindow cannot exceed 60000.
New
values
intervalLetter
headers:
for
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 a X-MBX-USED-WEIGHT-1M header in the
response. The legacy header X-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
have X-MBX-ORDER-COUNT-** headers in the response.
Eg.
to
"orders per 1 second" and X-MBX-ORD
ER-COUNT-1D for orders per "one day"
GET api/v1/depth now supports limit 5000 and 10000; weights are 50
and 100 respectively.
X-MBX-ORDER-COUNT-1S for
GET api/v1/exchangeInfo has
new parameter
a
ocoAllowed
.
USER DATA STREAM
event now contains "g" which has the orderListId 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).
executionReport
;
;
;
NEW ERRORS
-1131 BAD_RECV_WINDOW
recvWindow must be less than 60000
-1099 Not found, authenticated, or authorized
This replaces error code -1999
NEW -2011 ERRORS
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
status isn't TRADING
if the symbol's
api/v1/depth no longer has the ignored and empty []
api/v3/myTrades now returns quoteQty the price * qty of for the trade.
.
.
;
Websocket streams
and @depthX streams no longer have the
ignored and empty []
@depth
.
System improvements
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) and avgPriceMins (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, with i
nterval minute, means "every 5 minutes".
,
Explanation
.
the average price calculation:
for
(qty * price)
minutes.
,
trades
of all
numTrades
/
the trades over previous
of
5
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 the MIN_NOTIONAL filter, market orders cannot be placed until there is
at least 1 trade.
If
The current average price can be checked here: https://api.binance.co
m/api/v3/avgPrice?symbol= For example:
https://api.binance.com/api/v3/avgPrice?symbol=BNBUSDT
User data stream
variable
Last quote asset transacted quantity (as
execution reports. Represents the
lastPrice
Y
added
)
lastQty
*
L
(
to
l
*
).
2018-07-18
Rest API
New
filter: ICEBERG_PARTS
new defaults for newOrderRespType
and LIMIT order types default to FULL
POST api/v3/order
FULL
MARKET
;
default to ACK
POST api/v3/order
ACK
.
or
,
other orders
all
,
RESULT
,
.
and
RESULT
responses now have
FULL
cummulativeQu
oteQty
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 If cummulat
iveQuoteQty is < 0, it means the data isn't available for this order at this
time.
REQUESTS rate limit type changed to REQUEST_WEIGHT This limit was
always logically request weight and the previous name for it caused
confusion.
.
.
User data stream
added to order responses and execution
reports (as variable ). Represents the cummulative amount of the quot
e that has been spent (with a BUY order) or received (with a SELL order).
Historical orders will have a value < 0 in this field indicating the data is
not available at this time. cummulativeQuoteQty divided by cummulativeQt
y will give the average price for an order.
O (order creation time) added to execution reports
cummulativeQuoteQty field
Z
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
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
of
2018-01-20
GET /api/v1/ticker/24hr single symbol weight decreased to 1
GET /api/v3/openOrders all symbols weight decreased to number
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
of
2018-01-14
GET
GET
GET
GET
GET
GET
GET
/api/v1/aggTrades weight changed to 2
/api/v1/klines weight changed to 2
/api/v3/order weight changed to 2
/api/v3/allOrders weight changed to 20
/api/v3/account weight changed to 20
/api/v3/myTrades weight changed to 20
/api/v3/historicalTrades weight changed
20
to
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.
the API keys were accidentally shared, please delete them
immediately and create a new key.
If
API Key Restrictions
After creating the API key, the default restrictions set will be to enable
trade, allowing to make orders on the API.
To enable withdrawals via the API the API key restriction needs to be
modified through the Binance UI.
,
Enabling Accounts
Spot Account
A
account
SPOT
provided by default upon creation
is
Binance Account.
of a
Margin Account
To enable a MARGIN account
Trading Guide
Margin Trading, please refer
for
the Margin
to
Spot Testnet
Users can use the SPOT Testnet
Currently, this
practice
via
the API.
only available
to
is
Please refer to the SPOT Testnet page
up the Testnet API key.
trading.
SPOT
more information and how
for
set
to
API Library
Python connector
This is a lightweight library that works as
written in Python.
connector
a
Binance public API,
to
https://github.com/binance/binance-connector-python
Node.js connector
This is a lightweight library that works as
written for Node.js users.
connector
a
Binance public API,
to
https://github.com/binance/binance-connector-node
Postman Collections
There is now a Postman collection containing the API endpoints
and easy use.
This is recommended
the API.
new users who want
for
For more information please refer
get
to
quick
for
quick-start into using
a
page: Binance API Postman
to this
Swagger
A YAML file with OpenAPI specification on the RESTful API
used, as well as a Swagger UI page for the consulting.
available
is
be
to
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 base endpoint is: https://api.binance.com
If there are performance issues with the endpoint above, these API
clusters are also available:
https://api1.binance.com
https://api2.binance.com
https://api3.binance.com
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
.
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 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 receiving 429 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
there
reason.
an error, the API
is
If
return an error with
will
Specific error codes and messages defined
message
a
Error Codes
in
the
of
.
The error payload on API and SAPI
as follows:
is
General Information on Endpoints
{
For
For
endpoints, parameters must be sent as a query string
POST PUT and DELETE endpoints, the parameters may be sent as a
query string or in the request body with content type application/x-w
ww-form-urlencoded You may mix parameters between both the query st
ring and request body if you wish to do so.
Parameters may be sent in any order.
If a parameter sent in both the query string and request body
the quer
y string parameter will be used.
GET
"code" : - 1121 ,
"msg" : "Invalid symbol."
.
,
,
}
.
,
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, interval
Num 5 with intervalLetter M means "Every 5 minutes".
The /api/v3/exchangeInfo rateLimits array contains objects related to
the exchange's RAW_REQUESTS REQUEST_WEIGHT and ORDERS rate limits.
These are further defined in the ENUM definitions section under Rate li
,
miters (rateLimitType)
A 429
,
.
be returned when either rate
will
limit
violated.
is
Limits
IP
Every request will contain X-MBX-USED-WEIGHT-(intervalNum)(intervalLett
er) 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 heavier weight
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.
.
.
We recommend using the websocket for getting data as much as
possible, as this will not count to the request rate limit.
Order Rate Limits
Every successful order response will contain a X-MBX-ORDER-COUNT-(interv
alNum)(intervalLetter) header which has the current order count for the
account for all order rate limiters defined.
Rejected/unsuccessful orders are not guaranteed to have X-MBX-ORDER-CO
UNT-** headers in the response.
The order rate limit is counted against each account
.
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.
/api/ and /sapi/ Limit Introduction
The /api/* and /sapi/* endpoints adopt either
rules, IP limits or UID (account) limits.
Endpoints related
to /api/*
two access limiting
of
:
According to the two modes of IP and UID (account) limit, each are
independent.
Endpoints share the 1200 per minute limit based on IP, excluding
the new order endpoint POST /api/v3/order which has specific
limits of 50 per 10 seconds and 160000 per day based on UID.
Responses contain the header X-MBX-USED-WEIGHT-(intervalNum)(i
ntervalLetter) 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 12,000 per minute
limit.
Each endpoint with UID limits has an independent 180,000 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-SA
PI-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
Some endpoints can have more than 1 data source. (e.g. Memory
=> Database)
This means that the endpoint will check the first Data Source, and if it
cannot find the value it's looking for it will check the next one.
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
signature.
a
valid API-Key and
MARGIN
Endpoint requires sending
signature.
a
valid API-Key and
USER_DATA
Endpoint requires sending
signature.
a
valid API-Key and
USER_STREAM
Endpoint requires sending
a
valid API-Key.
MARKET_DATA
Endpoint requires sending
a
valid API-Key.
TRADE
and
MARGIN
,
endpoints are
USER_DATA
endpoints.
SIGNED
SIGNED (TRADE, USER_DATA, AND MARGIN)
Endpoint security
endpoints require an additional parameter, signature to be sent
in the query string or request body
Endpoints use HMAC SHA256 signatures. The HMAC SHA256 signature is a
keyed HMAC SHA256 operation. Use your secretKey as the key and totalP
arams as the value for the HMAC operation.
The signature is not case sensitive
totalParams is defined as the query string concatenated with the reque
SIGNED
,
.
.
st 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 after timestamp the request is valid for. If recvWindow is
not sent, it defaults to 5000
,
,
.
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.
The logic
as follows:
is
,
recommended to use a small recvWindow
max cannot go beyond 60,000!
5000 or
of
It is
if ( timestamp < ( serverTime + 1000 ) && ( serverTime - timestamp ) <= recvWindow
{
// process request
}
else
{
// reject request
}
The
less!
SIGNED Endpoint Examples for POST /api/v3/order
Here is a step-by-step example
the Linux command line using
how
of
echo
send
to
openssl
,
vaild signed payload from
and curl
a
,
.
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
As
1:
request body
a
requestBody:
Example
symbol=LTCBTC
&side=BUY
&type=LIMIT
&timeInForce=GTC
&quantity=1
&price=0.1
&recvWindow=5000
×tamp=1499827319559
Example
As
2:
HMAC SHA256 signature:
$ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559"
( stdin )= c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71
curl command:
query string
a
( HMAC SHA256 )
$ curl -H "X-MBX-APIKEY: vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A"
queryString:
symbol=LTCBTC
&side=BUY
&type=LIMIT
&timeInForce=GTC
&quantity=1
&price=0.1
&recvWindow=5000
×tamp=1499827319559
Example
1
Example
2
HMAC SHA256 signature:
$ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559"
( stdin )= c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71
Mixed query string and request body
3:
queryString:
curl command:
symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC
( HMAC SHA256 )
$ curl -H "X-MBX-APIKEY: vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A"
requestBody:
quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559
Note that the signature is different
"GTC" and "quantity=1".
example
in
There
3.
Example
no & between
is
3
HMAC SHA256 signature:
$ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTCquantity=1&price=0.1&recvWindow=5000×tamp=1499827319559"
( stdin )= 0fd168b8ddb4876a0358a8d14d0c9f3da0e9b20c5d52b2a00fcf7d1c602f9a77
curl command:
( HMAC SHA256 )
$ curl -H "X-MBX-APIKEY: vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A"
Public API Definitions
Terminology
These terms will be used throughout the documentation, so it is
recommended especially for new users to read to help their understanding
of the API.
refers to the asset that is the quantity of a symbol. For the
symbol BTCUSDT, BTC would be the base asset.
quote asset refers to the asset that is the price of a symbol. For the
symbol BTCUSDT, USDT would be the quote asset
base asset
.
ENUM definitions
Symbol status (status):
PRE_TRADING
TRADING
POST_TRADING
END_OF_DAY
HALT
AUCTION_MATCH
BREAK
Symbol type:
SPOT
Order status (status):
Status
Description
NEW
The order has been accepted by the engine.
PARTIALLY_FILLED
A part
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)
the order has been
of
filled.
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
the order
list
has been placed or there
status.
list
has finished executing and thus no longer
list
The order
active.
ALL_DONE
an update
is
to
OCO Order Status (listOrderStatus):
Status
Description
EXECUTING
Either an order list has been placed or there
to the status of the list.
ALL_DONE
An order
active.
REJECT
The List Status is responding to a failed action either
during order placement or order canceled.)
an update
is
has completed execution and thus no longer
list
ContingencyType
OCO
Order types (orderTypes, type):
More information on how the order types definitions can be found here:
Types of Orders
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
force (timeInForce):
in
This sets how long an order
be active before expiration.
will
Status
Description
GTC
Good Til Canceled
An order will be on the book unless the order
Immediate Or Cancel
An order will try to fill the order as much as
order expires.
IOC
or Kill
An order will expire
execution.
FOK
canceled.
is
can before the
it
Fill
the
if
order cannot be
full
upon
filled
Kline/Candlestick chart intervals:
m -> minutes;
-> hours;
h
-> days; w -> weeks; M -> months
d
1m
3m
5m
15m
30m
1h
2h
4h
6h
8h
12h
1d
3d
1w
1M
Rate limiters (rateLimitType)
REQUEST_WEIGHT
REQUEST_WEIGHT
ORDERS
RAW_REQUESTS
{
"rateLimitType" : "REQUEST_WEIGHT" ,
"interval" : "MINUTE" ,
"intervalNum" : 1 ,
"limit" : 1200
Rate limit intervals (interval)
}
SECOND
MINUTE
DAY
ORDERS
{
"rateLimitType" : "ORDERS" ,
"interval" : "SECOND" ,
"intervalNum" : 10 ,
"limit" : 100
},
{
"rateLimitType" : "ORDERS" ,
"interval" : "DAY" ,
"intervalNum" : 1 ,
"limit" : 200000
}
RAW_REQUESTS
{
"rateLimitType" : "RAW_REQUESTS" ,
"interval" : "MINUTE" ,
"intervalNum" : 5 ,
"limit" : 5000
}
Filters
define trading rules on a symbol or an exchange. Filters come
forms: symbol filters and exchange filters
Filters
two
in
.
Symbol Filters
PRICE_FILTER
The
defines the
PRICE_FILTER
rules
price
symbol. There are
for a
parts:
3
ExchangeInfo format:
defines the minimum price / stopPrice allowed; disabled on
inPrice == 0.
maxPrice defines the maximum price / stopPrice allowed; disabled on
axPrice == 0.
tickSize defines the intervals that a price / stopPrice can be
increased/decreased by; disabled on tickSize == 0.
minPrice
Any
m
{
"filterType"
"minPrice" :
"maxPrice" :
"tickSize" :
m
: "PRICE_FILTER" ,
"0.00000100" ,
"100000.00000000" ,
"0.00000100"
}
the above variables can be set to 0, which disables that rule in the pr
filter In order to pass the price filter the following must be true
price / stopPrice of the enabled rules:
of
ice
.
for
>=
<=
price
price
price
(
,
minPrice
maxPrice
minPrice
-
%
)
==
tickSize
0
PERCENT_PRICE
The PERCENT_PRICE filter defines valid range for a 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.
ExchangeInfo format:
{
order
In
pass the
to
<=
>=
price
price
percent price
the following must be true
,
weightedAveragePrice
*
multiplierUp
weightedAveragePrice
*
multiplierDown
for price
"filterType" : "PERCENT_PRICE" ,
"multiplierUp" : "1.3000" ,
"multiplierDown" : "0.7000" ,
"avgPriceMins" : 5
:
}
LOT_SIZE
The
defines the
symbol. There are 3 parts:
LOT_SIZE filter
for a
(aka "lots"
quantity
auction terms) rules
in
ExchangeInfo format:
defines the minimum quantity / icebergQty allowed.
maxQty defines the maximum quantity / icebergQty allowed.
stepSize defines the intervals that a quantity / icebergQty can be
increased/decreased by.
minQty
{
"filterType" : "LOT_SIZE" ,
"minQty" : "0.00100000" ,
"maxQty" : "100000.00000000" ,
"stepSize" : "0.00100000"
}
order
In
pass the
to
bergQty
the following must be true
,
for quantity
ice
/
:
>=
<=
quantity
quantity
quantity
(
lot size
minQty
maxQty
minQty
-
%
)
==
stepSize
0
MIN_NOTIONAL
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. avgPric
eMins is the number of minutes the average price is calculated over. 0
means the last price is used.
ExchangeInfo format:
.
{
"filterType" : "MIN_NOTIONAL" ,
"minNotional" : "0.00100000" ,
"applyToMarket" : true ,
"avgPriceMins" : 5
}
ICEBERG_PARTS
The ICEBERG_PARTS filter defines the maximum parts an iceberg order can
have. The number of ICEBERG_PARTS is defined as CEIL(qty / icebergQty)
ExchangeInfo format:
.
{
MARKET_LOT_SIZE
"filterType" : "ICEBERG_PARTS" ,
"limit" : 10
The MARKET_LOT_SIZE filter defines the quantity (aka "lots" in auction
terms) rules for MARKET orders on a symbol. There are 3 parts:
}
defines the minimum quantity allowed.
maxQty defines the maximum quantity allowed.
stepSize defines the intervals that a quantity can be
increased/decreased by.
minQty
In
order
ty
:
pass the
to
market lot size
ExchangeInfo format:
{
the following must be true
,
"filterType" : "MARKET_LOT_SIZE" ,
"minQty" : "0.00100000" ,
"maxQty" : "100000.00000000" ,
"stepSize" : "0.00100000"
for quanti
}
>=
<=
quantity
quantity
quantity
(
minQty
maxQty
minQty
-
%
)
==
stepSize
0
MAX_NUM_ORDERS
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.
ExchangeInfo format:
{
"filterType" : "MAX_NUM_ORDERS" ,
"maxNumOrders" : 25
MAX_NUM_ALGO_ORDERS
}
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
TOP_LOSS STOP_LOSS_LIMIT TAKE_PROFIT and TAKE_PROFIT_LIMIT orders.
,
,
S
ExchangeInfo format:
,
MAX_NUM_ICEBERG_ORDERS
{
"filterType" : "MAX_NUM_ALGO_ORDERS" ,
"maxNumAlgoOrders" : 5
The MAX_NUM_ICEBERG_ORDERS filter defines the maximum number of ICEBER
G orders an account is allowed to have open on a symbol. An ICEBERG
order is any order where the icebergQty is > 0.
}
MAX_POSITION
ExchangeInfo format:
The 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:
{
"filterType" : "MAX_NUM_ICEBERG_ORDERS" ,
"maxNumIcebergOrders" : 5
}
free balance of the base asset
locked balance of the base asset
sum of the qty of all open BUY orders
orders will be rejected if the account's position
maximum position allowed.
BUY
greater than the
is
Exchange Filters
ExchangeInfo format:
EXCHANGE_MAX_NUM_ORDERS
{
The 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.
"filterType" : "MAX_POSITION" ,
"maxPosition" : "10.00000000"
}
EXCHANGE_MAX_NUM_ALGO_ORDERS
The MAX_ALGO_ORDERS
an account is allowed
P_LOSS
defines the maximum number of "algo" orders
have open on the exchange. "Algo" orders are STO
TAKE_PROFIT and TAKE_PROFIT_LIMIT orders.
filter
to
STOP_LOSS_LIMIT
,
ExchangeInfo format:
,
{
"filterType" : "EXCHANGE_MAX_NUM_ORDERS" ,
"maxNumOrders" : 1000
,
}
ExchangeInfo format:
{
"filterType" : "EXCHANGE_MAX_ALGO_ORDERS" ,
"maxNumAlgoOrders" : 200
}
Wallet Endpoints
System Status (System)
GET /sapi/v1/system/status
Response
Fetch system status.
{
Weight(IP):
"status" : 0 ,
"msg" : "normal"
1
// 0: normal,1:system maintenance
// normal|system maintenance
}
Coins' Information (USER_DATA)
All
Get information
coins (available
of
deposit and withdraw)
for
GET /sapi/v1/capital/config/getall
user.
for
(HMAC SHA256)
Response:
Weight(IP): 10
[
Parameters:
{
Name
Type
Mandatory
recvWindow
LONG
NO
timestamp
LONG
YES
"coin" : "BTC" ,
"depositAllEnable" : true ,
"free" : "0.08074558" ,
"freeze" : "0.00000000" ,
"ipoable" : "0.00000000" ,
"ipoing" : "0.00000000" ,
"isLegalMoney" : false ,
"locked" : "0.00000000" ,
"name" : "Bitcoin" ,
"networkList" : [
{
"addressRegex" : "^(bnb1)[0-9a-z]{38}$" ,
"coin" : "BTC" ,
"depositDesc" : "Wallet Maintenance, Deposit Suspended" , //
"depositEnable" : false ,
"isDefault" : false ,
"memoRegex" : "^[0-9A-Za-z\\-_]{1,120}$" ,
"minConfirm" : 1 , // min number for balance confirmation
"name" : "BEP2" ,
"network" : "BNB" ,
"resetAddressStatus" : false ,
"specialTips" : "Both a MEMO and an Address are required to
"unLockConfirm" : 0 , // confirmation number for balance unlock
"withdrawDesc" : "Wallet Maintenance, Withdrawal Suspended" ,
"withdrawEnable" : false ,
"withdrawFee" : "0.00000220" ,
"withdrawIntegerMultiple" : "0.00000001" ,
"withdrawMax" : "9999999999.99999999" ,
"withdrawMin" : "0.00000440" ,
"sameAddress" : true // If the coin needs to provide memo to
},
{
"addressRegex" : "^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$|^(bc1)[0-9A-Za-z]{39,59}$"
"coin" : "BTC" ,
"depositEnable" : true ,
"isDefault" : true ,
"memoRegex" : "" ,
"minConfirm" : 1 ,
"name" : "BTC" ,
"network" : "BTC" ,
"resetAddressStatus" : false ,
"specialTips" : "" ,
"unLockConfirm" : 2 ,
"withdrawEnable" : true ,
"withdrawFee" : "0.00050000" ,
"withdrawIntegerMultiple" : "0.00000001" ,
"withdrawMax" : "750" ,
"withdrawMin" : "0.00100000" ,
"sameAddress" : false
}
],
"storage" : "0.00000000" ,
"trading" : true ,
"withdrawAllEnable" : true ,
"withdrawing" : "0.00000000"
Description
shown
successfully
}
]
Daily Account Snapshot (USER_DATA)
GET /sapi/v1/accountSnapshot (HMAC SHA256)
Response:
Weight(IP): 2400
{
Parameters:
Name
Type
Mandatory
Description
type
STRING
YES
"SPOT", "MARGIN", "FUTURES"
startTime
LONG
NO
endTime
LONG
NO
limit
INT
NO
recvWindow
LONG
NO
timestamp
LONG
YES
min
max 30, default
5,
"code" : 200 , // 200 for success; others are error codes
"msg" : "" , // error message
"snapshotVos" :[
{
"data" :{
"balances" :[
{
"asset" : "BTC" ,
"free" : "0.09905021" ,
"locked" : "0.00000000"
},
{
"asset" : "USDT" ,
"free" : "1.89109409" ,
"locked" : "0.00000000"
}
],
"totalAssetOfBtc" : "0.09942700"
},
"type" : "spot" ,
"updateTime" : 1576281599000
}
]
5
The query time period must be less then 30 days
}
OR
{
"code" : 200 , // 200 for success; others are error codes
"msg" : "" , // error message
"snapshotVos" :[
{
"data" :{
"marginLevel" : "2748.02909813" ,
"totalAssetOfBtc" : "0.00274803" ,
"totalLiabilityOfBtc" : "0.00000100" ,
"totalNetAssetOfBtc" : "0.00274750" ,
"userAssets" :[
{
"asset" : "XRP" ,
"borrowed" : "0.00000000" ,
"free" : "1.00000000" ,
"interest" : "0.00000000" ,
"locked" : "0.00000000" ,
"netAsset" : "1.00000000"
}
]
},
"type" : "margin" ,
"updateTime" : 1576281599000
}
]
}
OR
{
"code" : 200 , // 200 for success; others are error codes
"msg" : "" , // error message
"snapshotVos" :[
{
"data" :{
"assets" :[
{
"asset" : "USDT" ,
"marginBalance" : "118.99782335" ,
"walletBalance" : "120.23811389"
}
],
"position" :[
{
"entryPrice" : "7130.41000000" ,
"markPrice" : "7257.66239673" ,
"positionAmt" : "0.01000000" ,
"symbol" : "BTCUSDT" ,
"unRealizedProfit" : "1.24029054" // Only show the value
}
]
},
"type" : "futures" ,
"updateTime" : 1576281599000
}
]
at
}
Disable Fast Withdraw Switch (USER_DATA)
POST /sapi/v1/account/disableFastWithdrawSwitch
Weight(IP):
(HMAC SHA256)
Response:
1
Parameters:
{}
Name
Type
Mandatory
recvWindow
LONG
NO
timestamp
LONG
YES
Description
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)
POST /sapi/v1/account/enableFastWithdrawSwitch
Weight(IP):
(HMAC SHA256)
Response:
1
{}
Parameters:
Name
Type
Mandatory
recvWindow
LONG
NO
timestamp
LONG
YES
Description
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)
POST /sapi/v1/capital/withdraw/apply
Submit
(HMAC SHA256)
Response:
withdraw request.
a
{
Weight(IP):
"id" : "7213fea8e94b4a5593d507237e5a555b"
1
}
Parameters:
Name
Type
Mandatory
coin
STRING
YES
withdrawOrderId
STRING
NO
network
STRING
NO
address
STRING
YES
addressTag
STRING
NO
amount
DECIMAL
YES
transactionFeeFlag
BOOLEAN
NO
Description
client
Secondary address
identifier for coins like
XRP,XMR etc.
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
withdraw
id for
NO
.
Description of the
address. Space in
name should be
encoded into %20
recvWindow
LONG
NO
timestamp
LONG
YES
.
not send, return with default network of the coin.
You can get network and isDefault in networkList of a coin in the
response of Get /sapi/v1/capital/config/getall (HMAC SHA256)
network
If
.
Deposit History(supporting network) (USER_DATA)
GET /sapi/v1/capital/deposit/hisrec (HMAC SHA256)
Response:
Fetch deposit history.
[
Weight(IP):
{
1
"amount" : "0.00999800" ,
"coin" : "PAXG" ,
"network" : "ETH" ,
"status" : 1 ,
"address" : "0x788cabe9236ce061e5a892e1a59395a81fc8d62c" ,
"addressTag" : "" ,
"txId" : "0xaad4654a3234aa6118af9b4b335f5ae81c360b2394721c019b5d1e75328b09f3"
"insertTime" : 1599621997000 ,
"transferType" : 0 ,
"unlockConfirm" : "12/12" , // confirm times for unlocking
"confirmTimes" : "12/12"
Parameters:
Name
Type
Mandatory
coin
STRING
NO
status
INT
NO
Description
0(0:pending,6: credited but
cannot withdraw, 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
},
{
"amount" : "0.50000000" ,
"coin" : "IOTA" ,
"network" : "IOTA" ,
"status" : 1 ,
"address" : "SIZ9VLMHWATXKV99LH99CIGFJFUMLEHGWVZVNNZXRJJVWBPHYWPPBOSDORZ9EQSHCZAMPVAPGFYQAUUV9DROOXJLNW"
"addressTag" : "" ,
"txId" : "ESBFVQUTPIWQNJSPXFNHNYHSQNTGKRVKPRABQWTAXCDWOAKDKYWPTVG9BGXNVNKTLEJGESAVXIKIZ9999"
"insertTime" : 1599620082000 ,
"transferType" : 0 ,
"unlockConfirm" : "1/12" ,
"confirmTimes" : "1/1"
}
timestamp
LONG
]
YES
Please notice the default startTime and endTime to make sure that time
interval is within 0-90 days.
If both startTime and endTime are sent, time between startTime and en
dTime must be less than 90 days.
Withdraw History (supporting network)
(USER_DATA)
GET /sapi/v1/capital/withdraw/history (HMAC SHA256)
Response:
Fetch withdraw history.
[
Weight(IP):
{
1
"address" : "0x94df8b352de7f46f64b01d3666bf6e936e44ce60" ,
"amount" : "8.91000000" ,
"applyTime" : "2019-10-12 11:12:02" ,
"coin" : "USDT" ,
"id" : "b6ae22b3aa844210a7041aee7589627c" ,
"withdrawOrderId" : "WITHDRAWtest123" , // will not be returned if there's
"network" : "ETH" ,
"transferType" : 0 ,
// 1 for internal transfer, 0 for external transfer
"status" : 6 ,
"transactionFee" : "0.004" ,
"confirmNo" : 3 , // confirm times for withdraw
"txId" : "0xb5ef8c13b968a406cc62a93a8bd80f9e9a906ef1b3fcf20a2e48573c17659268"
Parameters:
Name
Type
Mandatory
coin
STRING
NO
withdrawOrderId
STRING
NO
status
INT
NO
Description
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
},
{
"address" : "1FZdVHtiBqMrWdjPyRPULCUceZPJ2WLCsB" ,
"amount" : "0.00150000" ,
"applyTime" : "2019-09-24 12:43:45" ,
"coin" : "BTC" ,
"id" : "156ec387f49b41df8724fa744fa82719" ,
"network" : "BTC" ,
"status" : 6 ,
"transactionFee" : "0.004" ,
"transferType" : 0 ,
// 1 for internal transfer, 0 for external transfer
"confirmNo" : 2 ,
"txId" : "60fd9007ebfddc753455f95fafa808c4302c836e4d1eebc5a132c36c1d8ac354"
}
]
may not be in the response for old withdraw.
Please notice the default startTime and endTime to make sure that time
interval is within 0-90 days.
If both startTime and endTime are sent, time between startTime and en
dTime must be less than 90 days.
network
Deposit Address (supporting network) (USER_DATA)
GET /sapi/v1/capital/deposit/address (HMAC SHA256)
Response:
Fetch deposit address with network.
{
Weight(IP): 10
"address" : "1HPn8Rx2y6nNSfagQBKy27GB99Vbzg89wv" ,
"coin" : "BTC" ,
"tag" : "" ,
"url" : "https://btc.com/1HPn8Rx2y6nNSfagQBKy27GB99Vbzg89wv"
Parameters:
}
Name
Type
Mandatory
coin
STRING
YES
network
STRING
NO
recvWindow
LONG
NO
timestamp
LONG
YES
Description
not send, return with default network of the coin.
You can get network and isDefault in networkList in the response
network is
If
et /sapi/v1/capital/config/getall
(HMAC SHA256)
of G
.
Account Status (USER_DATA)
GET /sapi/v1/account/status
Response:
Fetch account status detail.
{
Weight(IP):
"data" : "Normal"
1
}
Parameters:
Name
Type
Mandatory
recvWindow
LONG
NO
timestamp
LONG
YES
Description
Account API Trading Status (USER_DATA)
GET /sapi/v1/account/apiTradingStatus (HMAC SHA256)
Response:
Fetch account api trading status detail.
{
Weight(IP):
"data" : {
// API trading status detail
"isLocked" : false ,
// API trading function is locked or not
"plannedRecoverTime" : 0 , // If API trading function is locked,
"triggerCondition" : {
"GCR" : 150 , // Number of GTC orders
"IFER" : 150 , // Number of FOK/IOC orders
"UFR" : 300
// Number of orders
},
"indicators" : { // The indicators updated every 30 seconds
"BTCUSDT" : [ // The symbol
{
"i" : "UFR" , // Unfilled Ratio (UFR)
"c" : 20 ,
// Count of all orders
"v" : 0.05 ,
// Current UFR value
"t" : 0.995
// Trigger UFR value
},
{
"i" : "IFER" , // IOC/FOK Expiration Ratio (IFER)
"c" : 20 ,
// Count of FOK/IOC orders
"v" : 0.99 ,
// Current IFER value
"t" : 0.99
// Trigger IFER value
},
{
"i" : "GCR" , // GTC Cancellation Ratio (GCR)
"c" : 20 ,
// Count of GTC orders
"v" : 0.99 ,
// Current GCR value
"t" : 0.99
// Trigger GCR value
}
],
"ETHUSDT" : [
{
"i" : "UFR" ,
"c" : 20 ,
"v" : 0.05 ,
"t" : 0.995
},
{
"i" : "IFER" ,
"c" : 20 ,
"v" : 0.99 ,
"t" : 0.99
},
{
"i" : "GCR" ,
"c" : 20 ,
"v" : 0.99 ,
"t" : 0.99
}
]
},
"updateTime" : 1547630471725
}
1
Parameters:
Name
Type
Mandatory
recvWindow
LONG
NO
timestamp
LONG
YES
Description
}
DustLog(USER_DATA)
GET /sapi/v1/asset/dribblet (HMAC SHA256)
Weight(IP):
Response
1
{
Parameters:
Name
Type
Mandatory
startTime
LONG
NO
endTime
LONG
NO
recvWindow
LONG
NO
timestamp
LONG
YES
"total" : 8 ,
//Total counts of exchange
"userAssetDribblets" : [
{
"operateTime" : 1615985535000 ,
"totalTransferedAmount" : "0.00132256" ,
// Total transfered
"totalServiceChargeAmount" : "0.00002699" ,
//Total service
"transId" : 45178372831 ,
"userAssetDribbletDetails" : [
//Details of this
{
"transId" : 4359321 ,
"serviceChargeAmount" : "0.000009" ,
"amount" : "0.0009" ,
"operateTime" : 1615985535000 ,
"transferedAmount" : "0.000441" ,
"fromAsset" : "USDT"
},
{
"transId" : 4359321 ,
"serviceChargeAmount" : "0.00001799" ,
"amount" : "0.0009" ,
"operateTime" : 1615985535000 ,
"transferedAmount" : "0.00088156" ,
"fromAsset" : "ETH"
}
]
},
{
"operateTime" : 1616203180000 ,
"totalTransferedAmount" : "0.00058795" ,
"totalServiceChargeAmount" : "0.000012" ,
"transId" : 4357015 ,
"userAssetDribbletDetails" : [
{
"transId" : 4357015 ,
"serviceChargeAmount" : "0.00001" ,
"amount" : "0.001" ,
"operateTime" : 1616203180000 ,
"transferedAmount" : "0.00049" ,
"fromAsset" : "USDT"
},
{
"transId" : 4357015 ,
"serviceChargeAmount" : "0.000002" ,
"amount" : "0.0001" ,
"operateTime" : 1616203180000 ,
"transferedAmount" : "0.00009795" ,
"fromAsset" : "ETH"
}
]
}
]
Description
exchange.
}
}
Dust Transfer (USER_DATA)
POST /sapi/v1/asset/dust (HMAC SHA256)
Convert dust assets
Response:
BNB.
to
{
Weight(Uid): 10
"totalServiceCharge" : "0.02102542" ,
"totalTransfered" : "1.05127099" ,
"transferResult" :[
{
"amount" : "0.03000000" ,
"fromAsset" : "ETH" ,
"operateTime" : 1563368549307 ,
"serviceChargeAmount" : "0.00500000" ,
"tranId" : 2970932918 ,
"transferedAmount" : "0.25000000"
},
{
"amount" : "0.09000000" ,
"fromAsset" : "LTC" ,
"operateTime" : 1563368549404 ,
"serviceChargeAmount" : "0.01548000" ,
"tranId" : 2970932918 ,
"transferedAmount" : "0.77400000"
},
{
"amount" : "248.61878453" ,
"fromAsset" : "TRX" ,
"operateTime" : 1563368549489 ,
"serviceChargeAmount" : "0.00054542" ,
"tranId" : 2970932918 ,
"transferedAmount" : "0.02727099"
}
]
Parameters:
Name
Type
Mandatory
Description
asset
ARRAY
YES
The asset being converted. For
example:
asset=BTC&asset=USDT
recvWindow
LONG
NO
timestamp
LONG
YES
}
Asset Dividend Record (USER_DATA)
GET /sapi/v1/asset/assetDividend
(HMAC SHA256)
Response:
Query asset dividend record.
{
Weight(IP): 10
"rows" :[
{
"amount" : "10.00000000" ,
"asset" : "BHFT" ,
"divTime" : 1563189166000 ,
"enInfo" : "BHFT distribution" ,
"tranId" : 2968885920
Parameters:
Name
Type
Mandatory
asset
STRING
NO
startTime
LONG
NO
endTime
LONG
NO
limit
INT
NO
recvWindow
LONG
NO
timestamp
LONG
YES
Description
},
{
"amount" : "10.00000000" ,
"asset" : "BHFT" ,
"divTime" : 1563189165000 ,
"enInfo" : "BHFT distribution" ,
"tranId" : 2968885920
}
],
"total" : 2
Default 20, max 500
}
Asset Detail (USER_DATA)
GET /sapi/v1/asset/assetDetail
Fetch details
(HMAC SHA256)
Response:
assets supported on Binance.
of
{
Weight(IP):
"CTR" : {
"minWithdrawAmount" : "70.00000000" , //min withdraw amount
"depositStatus" : false , //deposit status (false if ALL of networks'
"withdrawFee" : 35 , // withdraw fee
"withdrawStatus" : true , //withdraw status (false if ALL of networks'
"depositTip" : "Delisted, Deposit Suspended" //reason
},
"SKY" : {
"minWithdrawAmount" : "0.02000000" ,
"depositStatus" : true ,
"withdrawFee" : 0.01 ,
"withdrawStatus" : true
}
1
Parameters:
Name
Type
Mandatory
asset
STRING
NO
recvWindow
LONG
NO
timestamp
LONG
YES
Description
}
Please get network and other deposit or withdraw details from
i/v1/capital/config/getall
GET /sap
.
Trade Fee (USER_DATA)
GET /sapi/v1/asset/tradeFee (HMAC SHA256)
Response:
Fetch trade fee
[
Weight(IP):
{
1
"symbol" : "ADABNB" ,
"makerCommission" : "0.001" ,
"takerCommission" : "0.001"
Parameters:
Name
Type
Mandatory
symbol
STRING
NO
recvWindow
LONG
NO
timestamp
LONG
YES
},
{
Description
"symbol" : "BNBBTC" ,
"makerCommission" : "0.001" ,
"takerCommission" : "0.001"
}
]
User Universal Transfer (USER_DATA)
POST /sapi/v1/asset/transfer
(HMAC SHA256)
You need to enable Permits Universal
which requests this endpoint.
Response:
option
Transfer
the api key
for
{
"tranId" : 13526853623
Weight(IP):
}
1
Parameters:
Name
Type
Mandatory
type
ENUM
YES
asset
STRING
YES
amount
DECIMAL
YES
fromSymbol
STRING
NO
toSymbol
STRING
NO
recvWindow
LONG
NO
timestamp
LONG
YES
Description
must be sent when type are ISOLATEDMARGIN_MARGIN and
ISOLATEDMARGIN_ISOLATEDMARGIN
toSymbol must be sent when type are MARGIN_ISOLATEDMARGIN and
ISOLATEDMARGIN_ISOLATEDMARGIN
fromSymbol
ENUM
transfer types:
of
MAIN_C2C Spot account transfer to C2C account
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
MAIN_MINING Spot account transfer to Mining account
C2C_MAIN C2C account transfer to Spot account
C2C_UMFUTURE C2C account transfer to USDⓈ-M Futures account
C2C_MINING C2C account transfer to Mining account
C2C_MARGIN C2C account transfer to Margin(cross) account
UMFUTURE_MAIN USDⓈ-M Futures account transfer to Spot
account
UMFUTURE_C2C USDⓈ-M Futures account transfer to C2C 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
MARGIN_MINING Margin(cross)account transfer to Mining
account
MARGIN_C2C Margin(cross)account transfer to C2C account
MINING_MAIN Mining account transfer to Spot account
MINING_UMFUTURE Mining account transfer to USDⓈ-M Futures
account
MINING_C2C Mining account transfer to C2C account
MINING_MARGIN Mining account transfer to Margin(cross)
account
MAIN_PAY Spot account transfer to Pay account
PAY_MAIN Pay account transfer to Spot account
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
Query User Universal Transfer History (USER_DATA)
GET /sapi/v1/asset/transfer (HMAC SHA256)
Weight(IP):
Response:
1
{
Parameters:
Name
Type
Mandatory
type
ENUM
YES
startTime
LONG
NO
endTime
LONG
NO
current
INT
NO
Default
size
INT
NO
Default 10, Max 100
fromSymbol
STRING
NO
toSymbol
STRING
NO
recvWindow
LONG
NO
timestamp
LONG
YES
"total" : 2 ,
"rows" :[
{
"asset" : "USDT" ,
"amount" : "1" ,
"type" : "MAIN_UMFUTURE" ,
"status" : "CONFIRMED" ,
"tranId" : 11415955596 ,
"timestamp" : 1544433328000
},
{
"asset" : "USDT" ,
"amount" : "2" ,
"type" : "MAIN_UMFUTURE" ,
"status" : "CONFIRMED" ,
"tranId" : 11366865406 ,
"timestamp" : 1544433328000
}
]
Description
1
}
must be sent when type are ISOLATEDMARGIN_MARGIN and
ISOLATEDMARGIN_ISOLATEDMARGIN
toSymbol must be sent when type are MARGIN_ISOLATEDMARGIN and
ISOLATEDMARGIN_ISOLATEDMARGIN
fromSymbol
Funding Wallet (USER_DATA)
POST /sapi/v1/asset/get-funding-asset (HMAC SHA256)
Weight(IP):
Response
1
[
Parameters:
{
Name
Type
Mandatory
asset
STRING
NO
needBtcValuation
STRING
NO
recvWindow
LONG
NO
timestamp
LONG
YES
"asset" : "USDT" ,
"free" : "1" ,
// avalible balance
"locked" : "0" , // locked asset
"freeze" : "0" , // freeze asset
"withdrawing" : "0" ,
"btcValuation" : "0.00000091"
Description
}
true or false
]
Currently supports querying the following business assets:Binance Pay,
Binance Card, Binance Gift Card, Stock Token
Get API Key Permission (USER_DATA)
GET /sapi/v1/account/apiRestrictions (HMAC SHA256)
Weight(IP):
Response
1
{
Parameters:
Name
Type
Mandatory
recvWindow
LONG
NO
timestamp
LONG
YES
"ipRestrict" : false ,
"createTime" : 1623840271000 ,
"enableWithdrawals" : false ,
// This option allows you to withdraw via
"enableInternalTransfer" : true , // This option authorizes this key to
"permitsUniversalTransfer" : true , // Authorizes this key to be used for
"enableVanillaOptions" : false , // Authorizes this key to Vanilla options
"enableReading" : true ,
"enableFutures" : false , // API Key created before your futures account
"enableMargin" : false ,
// This option can be adjusted after the Cross
"enableSpotAndMarginTrading" : false , // Spot and margin trading
"tradingAuthorityExpirationTime" : 1628985600000 // Expiration time for
Description
API.
transfer
spot
}
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
Virtual Sub-account(For Master Account)
a
POST /sapi/v1/sub-account/virtualSubAccount
Weight(IP):
(HMAC SHA256)
Response:
1
{
Parameters:
"email" : "addsdd_virtual@aasaixwqnoemail.com"
}
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
(For Master Account)
List
GET /sapi/v1/sub-account/list (HMAC SHA256)
Weight(IP):
Response:
1
{
Parameters:
Name
Type
Mandatory
Description
email
STRING
NO
Sub-account email
isFreeze
STRING
NO
true or false
page
INT
NO
Default value:
1
limit
INT
NO
Default value:
200
1,
recvWindow
LONG
NO
timestamp
LONG
YES
"subAccounts" :[
{
"email" : "testsub@gmail.com" ,
"isFreeze" : false ,
"createTime" : 1544433328000
},
{
"email" : "virtual@oxebmvfonoemail.com" ,
"isFreeze" : false ,
"createTime" : 1544433328000
}
]
Max value:
}
Query Sub-account Spot Asset Transfer History (For
Master Account)
GET /sapi/v1/sub-account/sub/transfer/history
Weight(IP):
(HMAC SHA256)
Response:
1
[
Parameters:
{
Name
Type
Mandatory
Description
fromEmail
STRING
NO
Sub-account email
toEmail
STRING
NO
Sub-account email
startTime
LONG
NO
endTime
LONG
NO
page
INT
NO
Default value:
limit
INT
NO
Default value: 500
"from" : "aaa@test.com" ,
"to" : "bbb@test.com" ,
"asset" : "BTC" ,
"qty" : "10" ,
"status" : "SUCCESS" ,
"tranId" : 6489943656 ,
"time" : 1544433328000
},
{
"from" : "bbb@test.com" ,
"to" : "ccc@test.com" ,
"asset" : "ETH" ,
"qty" : "2" ,
"status" : "SUCCESS" ,
"tranId" : 6489938713 ,
"time" : 1544433328000
1
}
]
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)
GET /sapi/v1/sub-account/futures/internalTransfer
Weight(IP):
(HMAC SHA256)
Response
1
{
Parameters:
Name
Type
Mandatory
Description
email
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:
limit
INT
NO
Default value: 50, Max value:
500
recvWindow
LONG
NO
timestamp
LONG
YES
"success" : true ,
"futuresType" : 2 ,
"transfers" :[
{
"from" : "aaa@test.com" ,
"to" : "bbb@test.com" ,
"asset" : "BTC" ,
"qty" : "1" ,
"tranId" : 11897001102 ,
"time" : 1544433328000
},
{
"from" : "bbb@test.com" ,
"to" : "ccc@test.com" ,
"asset" : "ETH" ,
"qty" : "2" ,
"tranId" : 11631474902 ,
"time" : 1544433328000
}
]
1
}
Sub-account Futures Asset Transfer (For Master
Account)
POST /sapi/v1/sub-account/futures/internalTransfer
Weight(IP):
(HMAC SHA256)
Response
1
{
Parameters:
"success" : true ,
"txnId" : "2934662589"
}
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
minute
a
Query Sub-account Assets (For Master Account)
GET /sapi/v3/sub-account/assets
(HMAC SHA256)
Response:
Fetch sub-account assets
{
Weight(IP):
"balances" :[
{
"asset" : "ADA" ,
"free" : 10000 ,
"locked" : 0
},
{
"asset" : "BNB" ,
"free" : 10003 ,
"locked" : 0
},
{
"asset" : "BTC" ,
"free" : 11467.6399 ,
"locked" : 0
},
{
"asset" : "ETH" ,
"free" : 10004.995 ,
"locked" : 0
},
{
"asset" : "USDT" ,
"free" : 11652.14213 ,
"locked" : 0
}
]
1
Parameters:
Name
Type
Mandatory
Description
email
STRING
YES
Sub account email
recvWindow
LONG
NO
timestamp
LONG
YES
}
Query Sub-account Spot Assets Summary (For
Master Account)
Get BTC valued asset summary
subaccounts.
of
Response:
GET /sapi/v1/sub-account/spotSummary (HMAC SHA256)
{
Weight(IP):
"totalCount" : 2 ,
"masterAccountTotalAsset" : "0.23231201" ,
"spotSubUserAssetBtcVoList" :[
{
"email" : "sub123@test.com" ,
"totalAsset" : "9999.00000000"
},
{
"email" : "test456@test.com" ,
"totalAsset" : "0.00000000"
}
]
1
Parameters:
Name
Type
Mandatory
Description
email
STRING
NO
Sub account email
page
LONG
NO
default
size
LONG
NO
default 10, max 20
recvWindow
LONG
NO
timestamp
LONG
YES
1
}
Get Sub-account Deposit Address (For Master
Account)
GET /sapi/v1/capital/deposit/subAddress (HMAC SHA256)
Response:
Fetch sub-account deposit address
{
Weight(IP):
"address" : "TDunhSa7jkTNuKrusUTU1MUHtqXoBPKETV" ,
"coin" : "USDT" ,
"tag" : "" ,
"url" : "https://tronscan.org/#/address/TDunhSa7jkTNuKrusUTU1MUHtqXoBPKETV"
1
Parameters:
}
Name
Type
Mandatory
Description
email
STRING
YES
Sub account email
coin
STRING
YES
network
STRING
NO
recvWindow
LONG
NO
timestamp
LONG
YES
Get Sub-account Deposit History (For Master
Account)
GET /sapi/v1/capital/deposit/subHisrec
(HMAC SHA256)
Response:
Fetch sub-account deposit history
[
Weight(IP):
{
1
"amount" : "0.00999800" ,
"coin" : "PAXG" ,
"network" : "ETH" ,
"status" : 1 ,
"address" : "0x788cabe9236ce061e5a892e1a59395a81fc8d62c" ,
"addressTag" : "" ,
"txId" : "0xaad4654a3234aa6118af9b4b335f5ae81c360b2394721c019b5d1e75328b09f3"
"insertTime" : 1599621997000 ,
"transferType" : 0 ,
"confirmTimes" : "12/12"
Parameters:
Name
Type
Mandatory
Description
email
STRING
YES
Sub account email
coin
STRING
NO
status
INT
NO
startTime
LONG
NO
endTime
LONG
NO
limit
INT
NO
offset
INT
NO
},
{
0(0:pending,6: credited but
cannot withdraw, 1:success)
"amount" : "0.50000000" ,
"coin" : "IOTA" ,
"network" : "IOTA" ,
"status" : 1 ,
"address" : "SIZ9VLMHWATXKV99LH99CIGFJFUMLEHGWVZVNNZXRJJVWBPHYWPPBOSDORZ9EQSHCZAMPVAPGFYQAUUV9DROOXJLNW"
"addressTag" : "" ,
"txId" : "ESBFVQUTPIWQNJSPXFNHNYHSQNTGKRVKPRABQWTAXCDWOAKDKYWPTVG9BGXNVNKTLEJGESAVXIKIZ9999"
"insertTime" : 1599620082000 ,
"transferType" : 0 ,
"confirmTimes" : "1/1"
default:0
}
]
recvWindow
LONG
NO
timestamp
LONG
YES
Get Sub-account's Status on Margin/Futures (For
Master Account)
GET /sapi/v1/sub-account/status
(HMAC SHA256)
Response
Weight(IP): 10
[
Parameters:
{
Name
Type
Mandatory
Description
email
STRING
NO
Sub-account email
recvWindow
LONG
NO
timestamp
LONG
no email sent,
If
email
or false
or false
account create time
or false for margin
or false for futures.
mobile number
}
]
YES
sub-accounts' information
all
"email" : "123@test.com" ,
// user
"isSubUserEnabled" : true ,
// true
"isUserActive" : true ,
// true
"insertTime" : 1570791523523 , // sub
"isMarginEnabled" : true ,
// true
"isFutureEnabled" : true ,
// true
"mobile" : 1570791523523
// user
be returned.
will
Enable Margin for Sub-account (For Master
Account)
POST /sapi/v1/sub-account/margin/enable
Weight(IP):
(HMAC SHA256)
Response
1
{
Parameters:
"email" : "123@test.com" ,
"isMarginEnabled" : true
Name
Type
Mandatory
Description
email
STRING
YES
Sub-account email
recvWindow
LONG
NO
timestamp
LONG
YES
}
Get Detail on Sub-account's Margin Account (For
Master Account)
GET /sapi/v1/sub-account/margin/account (HMAC SHA256)
Response
Weight(IP): 10
{
Parameters:
Name
Type
Mandatory
Description
email
STRING
YES
Sub-account email
recvWindow
LONG
NO
timestamp
LONG
YES
"email" : "123@test.com" ,
"marginLevel" : "11.64405625" ,
"totalAssetOfBtc" : "6.82728457" ,
"totalLiabilityOfBtc" : "0.58633215" ,
"totalNetAssetOfBtc" : "6.24095242" ,
"marginTradeCoeffVo" :
{
"forceLiquidationBar" : "1.10000000" ,
"marginCallBar" : "1.50000000" ,
"normalBar" : "2.00000000"
},
"marginUserAssetVoList" : [
{
"asset" : "BTC" ,
"borrowed" : "0.00000000" ,
"free" : "0.00499500" ,
"interest" : "0.00000000" ,
"locked" : "0.00000000" ,
"netAsset" : "0.00499500"
},
{
"asset" : "BNB" ,
"borrowed" : "201.66666672" ,
"free" : "2346.50000000" ,
"interest" : "0.00000000" ,
"locked" : "0.00000000" ,
"netAsset" : "2144.83333328"
},
{
"asset" : "ETH" ,
"borrowed" : "0.00000000" ,
"free" : "0.00000000" ,
"interest" : "0.00000000" ,
"locked" : "0.00000000" ,
"netAsset" : "0.00000000"
},
{
"asset" : "USDT" ,
"borrowed" : "0.00000000" ,
"free" : "0.00000000" ,
"interest" : "0.00000000" ,
"locked" : "0.00000000" ,
"netAsset" : "0.00000000"
}
]
// Liquidation margin
// Margin call margin
// Initial margin ratio
}
Get Summary of Sub-account's Margin Account (For
Master Account)
GET /sapi/v1/sub-account/margin/accountSummary
(HMAC SHA256)
Response
Weight(IP): 10
{
Parameters:
Name
Type
Mandatory
recvWindow
LONG
NO
timestamp
LONG
YES
"totalAssetOfBtc" : "4.33333333" ,
"totalLiabilityOfBtc" : "2.11111112" ,
"totalNetAssetOfBtc" : "2.22222221" ,
"subAccountList" :[
{
"email" : "123@test.com" ,
"totalAssetOfBtc" : "2.11111111" ,
"totalLiabilityOfBtc" : "1.11111111" ,
"totalNetAssetOfBtc" : "1.00000000"
},
{
"email" : "345@test.com" ,
"totalAssetOfBtc" : "2.22222222" ,
"totalLiabilityOfBtc" : "1.00000001" ,
"totalNetAssetOfBtc" : "1.22222221"
}
]
Description
}
Enable Futures for Sub-account (For Master
Account)
POST /sapi/v1/sub-account/futures/enable
Weight(IP):
(HMAC SHA256)
Response
1
{
Parameters:
"email" : "123@test.com" ,
"isFuturesEnabled" : true
Name
Type
Mandatory
Description
email
STRING
YES
Sub-account email
recvWindow
LONG
NO
timestamp
LONG
YES
// true or false
}
Get Detail on Sub-account's Futures Account (For
Master Account)
GET /sapi/v1/sub-account/futures/account
(HMAC SHA256)
Response
Weight(IP): 10
Parameters:
{
Name
Type
Mandatory
Description
email
STRING
YES
Sub-account email
recvWindow
LONG
NO
timestamp
LONG
YES
"email" : "abc@test.com" ,
"asset" : "USDT" ,
"assets" :[
{
"asset" : "USDT" ,
"initialMargin" : "0.00000000" ,
"maintenanceMargin" : "0.00000000" ,
"marginBalance" : "0.88308000" ,
"maxWithdrawAmount" : "0.88308000" ,
"openOrderInitialMargin" : "0.00000000" ,
"positionInitialMargin" : "0.00000000" ,
"unrealizedProfit" : "0.00000000" ,
"walletBalance" : "0.88308000"
}
],
"canDeposit" : true ,
"canTrade" : true ,
"canWithdraw" : true ,
"feeTier" : 2 ,
"maxWithdrawAmount" : "0.88308000" ,
"totalInitialMargin" : "0.00000000" ,
"totalMaintenanceMargin" : "0.00000000" ,
"totalMarginBalance" : "0.88308000" ,
"totalOpenOrderInitialMargin" : "0.00000000" ,
"totalPositionInitialMargin" : "0.00000000" ,
"totalUnrealizedProfit" : "0.00000000" ,
"totalWalletBalance" : "0.88308000" ,
"updateTime" : 1576756674610
}
Get Summary of Sub-account's Futures Account (For
Master Account)
GET /sapi/v1/sub-account/futures/accountSummary
Weight(IP):
(HMAC SHA256)
Response
1
{
Parameters:
Name
Type
Mandatory
recvWindow
LONG
NO
timestamp
LONG
YES
"totalInitialMargin" : "9.83137400" ,
"totalMaintenanceMargin" : "0.41568700" ,
"totalMarginBalance" : "23.03235621" ,
"totalOpenOrderInitialMargin" : "9.00000000" ,
"totalPositionInitialMargin" : "0.83137400" ,
"totalUnrealizedProfit" : "0.03219710" ,
"totalWalletBalance" : "22.15879444" ,
"asset" : "USD" , // The sum of BUSD and USDT
"subAccountList" :[
{
"email" : "123@test.com" ,
"totalInitialMargin" : "9.00000000" ,
"totalMaintenanceMargin" : "0.00000000" ,
"totalMarginBalance" : "22.12659734" ,
"totalOpenOrderInitialMargin" : "9.00000000" ,
"totalPositionInitialMargin" : "0.00000000" ,
"totalUnrealizedProfit" : "0.00000000" ,
"totalWalletBalance" : "22.12659734" ,
"asset" : "USD" //The sum of BUSD and USDT
},
{
"email" : "345@test.com" ,
"totalInitialMargin" : "0.83137400" ,
"totalMaintenanceMargin" : "0.41568700" ,
"totalMarginBalance" : "0.90575887" ,
"totalOpenOrderInitialMargin" : "0.00000000" ,
"totalPositionInitialMargin" : "0.83137400" ,
"totalUnrealizedProfit" : "0.03219710" ,
"totalWalletBalance" : "0.87356177" ,
"asset" : "USD"
}
]
Description
}
Get Futures Position-Risk of Sub-account (For
Master Account)
GET /sapi/v1/sub-account/futures/positionRisk
(HMAC SHA256)
Response
Weight(IP): 10
[
Parameters:
{
Name
Type
Mandatory
Description
email
String
YES
Sub-account email
recvWindow
LONG
NO
timestamp
LONG
YES
"entryPrice" : "9975.12000" ,
"leverage" : "50" ,
// current initial leverage
"maxNotional" : "1000000" ,
// notional value limit of current
"liquidationPrice" : "7963.54" ,
"markPrice" : "9973.50770517" ,
"positionAmount" : "0.010" ,
"symbol" : "BTCUSDT" ,
"unrealizedProfit" : "-0.01612295"
initial
}
]
Futures Transfer for Sub-account (For Master
Account)
POST /sapi/v1/sub-account/futures/transfer
Weight(IP):
(HMAC SHA256)
Response
1
{
Parameters:
"txnId" : "2966662589"
}
Name
Type
Mandatory
Description
email
String
YES
Sub-account email
asset
STRING
YES
The asset being transferred,
e.g., USDT
amount
DECIMAL
YES
The amount
transferred
type
INT
YES
1:
recvWindow
LONG
NO
timestamp
LONG
YES
be
to
transfer from subaccount's
spot account to its USDTmargined futures account 2:
transfer from subaccount's
USDT-margined futures
account to its spot account 3:
transfer from subaccount's
spot account to its COINmargined futures account
4:transfer from subaccount's
COIN-margined futures
account to its spot account
Margin Transfer for Sub-account (For Master
Account)
POST /sapi/v1/sub-account/margin/transfer
Weight(IP):
(HMAC SHA256)
Response
1
{
Parameters:
"txnId" : "2966662589"
}
Name
Type
Mandatory
Description
email
String
YES
Sub-account email
asset
STRING
YES
The asset being transferred,
e.g., BTC
amount
DECIMAL
YES
The amount
transferred
type
INT
YES
1:
recvWindow
LONG
NO
timestamp
LONG
YES
be
to
transfer from subaccount's
spot account to margin
account 2: transfer from
subaccount's margin account
to its spot account
Transfer to Sub-account of Same Master (For Subaccount)
POST /sapi/v1/sub-account/transfer/subToSub
Weight(IP):
(HMAC SHA256)
Response
1
{
Parameters:
"txnId" : "2966662589"
}
Name
Type
Mandatory
Description
toEmail
String
YES
Sub-account email
asset
STRING
YES
amount
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Transfer to Master (For Sub-account)
POST /sapi/v1/sub-account/transfer/subToMaster
Weight(IP):
(HMAC SHA256)
Response
1
{
Parameters:
"txnId" : "2966662589"
}
Name
Type
Mandatory
asset
STRING
YES
amount
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Description
Sub-account Transfer History (For Sub-account)
GET /sapi/v1/sub-account/transfer/subUserHistory (HMAC SHA256)
Weight(IP):
Response
1
[
Parameters:
{
Name
Type
Mandatory
Description
asset
STRING
NO
If
type
INT
NO
1:
startTime
LONG
NO
endTime
LONG
NO
limit
INT
NO
recvWindow
LONG
NO
timestamp
LONG
YES
not sent, result
will be returned
transfer
"counterParty" : "master" ,
"email" : "master@test.com" ,
"type" : 1 , // 1 for transfer in, 2 for transfer out
"asset" : "BTC" ,
"qty" : "1" ,
"fromAccountType" : "SPOT" ,
"toAccountType" : "SPOT" ,
"status" : "SUCCESS" ,
"tranId" : 11798835829 ,
"time" : 1544433325000
assets
of all
transfer out
in, 2:
},
{
"counterParty" : "subAccount" ,
"email" : "sub2@test.com" ,
"type" : 1 ,
"asset" : "ETH" ,
"qty" : "2" ,
"fromAccountType" : "SPOT" ,
"toAccountType" : "SPOT" ,
"status" : "SUCCESS" ,
"tranId" : 11798829519 ,
"time" : 1544433326000
Default 500
}
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.
If
]
Universal Transfer (For Master Account)
POST /sapi/v1/sub-account/universalTransfer
Weight(IP):
(HMAC SHA256)
Response
1
{
Parameters:
"tranId" : 11945860693
}
Name
Type
Mandatory
Description
fromEmail
STRING
NO
toEmail
STRING
NO
fromAccountType
STRING
YES
"SPOT","USDT_FUTURE","COIN_FUTURE"
toAccountType
STRING
YES
"SPOT","USDT_FUTURE","COIN_FUTURE"
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.
Transfer between futures accounts is not supported.
Query Universal Transfer History (For Master
Account)
GET /sapi/v1/sub-account/universalTransfer
Weight(IP):
(HMAC SHA256)
Response
1
[
Parameters:
{
"tranId" : 11945860693 ,
"fromEmail" : "master@test.com" ,
"toEmail" : "subaccount1@test.com" ,
"asset" : "BTC" ,
"amount" : "0.1" ,
"fromAccountType" : "SPOT" ,
"toAccountType" : "COIN_FUTURE" ,
"status" : "SUCCESS" ,
"createTimeStamp" : 1544433325000
Name
Type
Mandatory
Description
fromEmail
STRING
NO
toEmail
STRING
NO
startTime
LONG
NO
endTime
LONG
NO
page
INT
NO
Default
limit
INT
NO
Default 500, Max 500
recvWindow
LONG
NO
timestamp
LONG
YES
},
{
"tranId" : 11945857955 ,
"fromEmail" : "master@test.com" ,
"toEmail" : "subaccount2@test.com" ,
"asset" : "ETH" ,
"amount" : "0.2" ,
"fromAccountType" : "SPOT" ,
"toAccountType" : "USDT_FUTURE" ,
"status" : "SUCCESS" ,
"createTimeStamp" : 1544433326000
1
}
]
fromEmail and toEmail cannot be sent at the same time.
Return fromEmail equal master account email by default.
Only get the latest history of past 30 days.
Get Detail on Sub-account's Futures Account V2 (For
Master Account)
GET /sapi/v2/sub-account/futures/account
Weight(IP):
(HMAC SHA256)
Response
1
USDT Margined Futures:
Parameters:
Name
Type
Mandatory
Description
{
email
STRING
YES
Sub-account email
futuresType
INT
YES
1:USDT Margined Futures,
2:COIN Margined Futures
recvWindow
LONG
NO
timestamp
LONG
YES
"futureAccountResp" : {
"email" : "abc@test.com" ,
"assets" :[
{
"asset" : "USDT" ,
"initialMargin" : "0.00000000" ,
"maintenanceMargin" : "0.00000000" ,
"marginBalance" : "0.88308000" ,
"maxWithdrawAmount" : "0.88308000" ,
"openOrderInitialMargin" : "0.00000000" ,
"positionInitialMargin" : "0.00000000" ,
"unrealizedProfit" : "0.00000000" ,
"walletBalance" : "0.88308000"
}
],
"canDeposit" : true ,
"canTrade" : true ,
"canWithdraw" : true ,
"feeTier" : 2 ,
"maxWithdrawAmount" : "0.88308000" ,
"totalInitialMargin" : "0.00000000" ,
"totalMaintenanceMargin" : "0.00000000" ,
"totalMarginBalance" : "0.88308000" ,
"totalOpenOrderInitialMargin" : "0.00000000" ,
"totalPositionInitialMargin" : "0.00000000" ,
"totalUnrealizedProfit" : "0.00000000" ,
"totalWalletBalance" : "0.88308000" ,
"updateTime" : 1576756674610
}
}
COIN Margined Futures:
{
"deliveryAccountResp" : {
"email" : "abc@test.com" ,
"assets" :[
{
"asset" : "BTC" ,
"initialMargin" : "0.00000000" ,
"maintenanceMargin" : "0.00000000" ,
"marginBalance" : "0.88308000" ,
"maxWithdrawAmount" : "0.88308000" ,
"openOrderInitialMargin" : "0.00000000" ,
"positionInitialMargin" : "0.00000000" ,
"unrealizedProfit" : "0.00000000" ,
"walletBalance" : "0.88308000"
}
],
"canDeposit" : true ,
"canTrade" : true ,
"canWithdraw" : true ,
"feeTier" : 2 ,
"updateTime" : 1598959682001
}
}
Get Summary of Sub-account's Futures Account V2
(For Master Account)
GET /sapi/v2/sub-account/futures/accountSummary
(HMAC SHA256)
Response
Weight(IP): 10
USDT Margined Futures:
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
"futureAccountSummaryResp" : {
"totalInitialMargin" : "9.83137400" ,
"totalMaintenanceMargin" : "0.41568700" ,
"totalMarginBalance" : "23.03235621" ,
"totalOpenOrderInitialMargin" : "9.00000000" ,
"totalPositionInitialMargin" : "0.83137400" ,
"totalUnrealizedProfit" : "0.03219710" ,
"totalWalletBalance" : "22.15879444" ,
"asset" : "USD" , //The sum of BUSD and USDT
"subAccountList" :[
{
"email" : "123@test.com" ,
"totalInitialMargin" : "9.00000000" ,
"totalMaintenanceMargin" : "0.00000000" ,
"totalMarginBalance" : "22.12659734" ,
"totalOpenOrderInitialMargin" : "9.00000000" ,
"totalPositionInitialMargin" : "0.00000000" ,
"totalUnrealizedProfit" : "0.00000000" ,
"totalWalletBalance" : "22.12659734" ,
"asset" : "USD" //The sum of BUSD and USDT
},
{
"email" : "345@test.com" ,
"totalInitialMargin" : "0.83137400" ,
"totalMaintenanceMargin" : "0.41568700" ,
"totalMarginBalance" : "0.90575887" ,
"totalOpenOrderInitialMargin" : "0.00000000" ,
"totalPositionInitialMargin" : "0.83137400" ,
"totalUnrealizedProfit" : "0.03219710" ,
"totalWalletBalance" : "0.87356177" ,
"asset" : "USD"
}
]
}
}
COIN Margined Futures:
{
"deliveryAccountSummaryResp" : {
"totalMarginBalanceOfBTC" : "25.03221121" ,
"totalUnrealizedProfitOfBTC" : "0.12233410" ,
"totalWalletBalanceOfBTC" : "22.15879444" ,
"asset" : "BTC" ,
"subAccountList" :[
{
"email" : "123@test.com" ,
"totalMarginBalance" : "22.12659734" ,
"totalUnrealizedProfit" : "0.00000000" ,
"totalWalletBalance" : "22.12659734" ,
"asset" : "BTC"
},
{
"email" : "345@test.com" ,
"totalMarginBalance" : "0.90575887" ,
"totalUnrealizedProfit" : "0.03219710" ,
"totalWalletBalance" : "0.87356177" ,
"asset" : "BTC"
}
]
}
}
Get Futures Position-Risk of Sub-account V2 (For
Master Account)
GET /sapi/v2/sub-account/futures/positionRisk
Weight(IP):
(HMAC SHA256)
Response
1
USDT Margined Futures:
Parameters:
{
Name
Type
Mandatory
Description
email
STRING
YES
Sub-account email
futuresType
INT
YES
1:USDT Margined Futures,
2:COIN Margined Futures
recvWindow
LONG
NO
timestamp
LONG
YES
"futurePositionRiskVos" : [
{
"entryPrice" : "9975.12000" ,
"leverage" : "50" ,
// current initial leverage
"maxNotional" : "1000000" ,
// notional value limit of current
"liquidationPrice" : "7963.54" ,
"markPrice" : "9973.50770517" ,
"positionAmount" : "0.010" ,
"symbol" : "BTCUSDT" ,
"unrealizedProfit" : "-0.01612295"
}
]
initial
}
COIN Margined Futures:
{
"deliveryPositionRiskVos" : [
{
"entryPrice" : "9975.12000" ,
"markPrice" : "9973.50770517" ,
"leverage" : "20" ,
"isolated" : "false" ,
"isolatedWallet" : "9973.50770517" ,
"isolatedMargin" : "0.00000000" ,
"isAutoAddMargin" : "false" ,
"positionSide" : "BOTH" ,
"positionAmount" : "1.230" ,
"symbol" : "BTCUSD_201225" ,
"unrealizedProfit" : "-0.01612295"
}
]
}
Enable Leverage Token for Sub-account (For Master
Account)
POST /sapi/v1/sub-account/blvt/enable (HMAC SHA256)
Weight(IP):
Response
1
{
Parameters:
"email" : "123@test.com" ,
"enableBlvt" : true
}
Name
Type
Mandatory
Description
email
String
YES
Sub-account email
enableBlvt
BOOLEAN
YES
Only true
recvWindow
LONG
NO
timestamp
LONG
YES
now
for
Deposit assets into the managed sub-account(For
Investor Master Account)
POST /sapi/v1/managed-subaccount/deposit
Weight(IP):
(HMAC SHA256)
Response
1
{
Parameters:
"tranId" : 66157362489
}
Name
Type
Mandatory
toEmail
STRING
YES
asset
STRING
YES
amount
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Description
Query managed sub-account asset details(For
Investor Master Account)
GET /sapi/v1/managed-subaccount/asset (HMAC SHA256)
Weight(IP):
Response
1
[
Parameters:
{
Name
Type
Mandatory
email
STRING
YES
recvWindow
LONG
NO
timestamp
LONG
YES
"coin" : "INJ" ,
"name" : "Injective Protocol" ,
"totalBalance" : "0" ,
"availableBalance" : "0" ,
"inOrder" : "0" ,
"btcValue" : "0"
Description
},
{
"coin" : "FILDOWN" ,
"name" : "FILDOWN" ,
"totalBalance" : "0" ,
"availableBalance" : "0" ,
"inOrder" : "0" ,
"btcValue" : "0"
}
]
Withdrawl assets from the managed sub-account
(For Investor Master Account)
POST /sapi/v1/managed-subaccount/withdraw
Weight(IP):
(HMAC SHA256)
Response
1
{
Parameters:
"tranId" : 66157362489
}
Name
Type
Mandatory
fromEmail
STRING
YES
asset
STRING
YES
amount
DECIMAL
YES
transferDate
LONG
NO
recvWindow
LONG
NO
timestamp
LONG
YES
Description
Withdrawals is automatically
occur on the transfer
date(UTC0). If a date is not
selected, the withdrawal
occurs right now
Market Data Endpoints
Test Connectivity
GET /api/v3/ping
Response:
Test connectivity
the Rest API.
to
{}
Weight(IP):
1
Parameters:
NONE
Data Source: Memory
Check Server Time
GET /api/v3/time
Response:
Test connectivity
the Rest API and get the current server time.
to
{
Weight(IP):
"serverTime" : 1499827319559
1
}
Parameters:
NONE
Data Source: Memory
Exchange Information
GET /api/v3/exchangeInfo
Response:
Current exchange trading rules and symbol information
{
Weight(IP): 10
"timezone" : "UTC" ,
"serverTime" : 1565246363776 ,
"rateLimits" : [
{
//These are defined in the `ENUM definitions` section under `Rate
//All limits are optional
}
],
"exchangeFilters" : [
//These are the defined filters in the `Filters` section.
//All filters are optional.
],
"symbols" : [
{
"symbol" : "ETHBTC" ,
"status" : "TRADING" ,
"baseAsset" : "ETH" ,
"baseAssetPrecision" : 8 ,
"quoteAsset" : "BTC" ,
"quotePrecision" : 8 ,
"quoteAssetPrecision" : 8 ,
"orderTypes" : [
"LIMIT" ,
"LIMIT_MAKER" ,
"MARKET" ,
"STOP_LOSS" ,
"STOP_LOSS_LIMIT" ,
"TAKE_PROFIT" ,
"TAKE_PROFIT_LIMIT"
],
"icebergAllowed" : true ,
"ocoAllowed" : true ,
"isSpotTradingAllowed" : true ,
"isMarginTradingAllowed" : true ,
"filters" : [
//These are defined in the Filters section.
//All filters are optional
],
"permissions" : [
"SPOT" ,
"MARGIN"
]
}
]
Parameters:
There are
possible options:
3
Options
Example
No
parameter
curl
symbol
curl
symbols
curl
-X GET "https://api.binance.com/api/v3/exchangeInfo"
-X GET "https://api.binance.com/api/v3/exchangeInfo?
symbol=BNBBTC"
-X GET "https://api.binance.com/api/v3/exchangeInfo?
symbols=%5B%22BNBBTC%22,%22BTCUSDT%22%5D" or
curl -g GET 'https://api.binance.com/api/v3/exchangeInfo?
symbols=["BTCUSDT","BNBBTC"]'
any symbol provided in either
endpoint will throw an error.
or
symbol
If
do not
symbols
the
exist,
Data Source: Memory
Limiters
}
Order Book
GET /api/v3/depth
Response:
Weight(IP):
{
Adjusted based on the
Limit
Weight
10, 20, 50, 100
5,
"lastUpdateId" : 1027024 ,
"bids" : [
[
"4.00000000" ,
// PRICE
"431.00000000"
// QTY
]
],
"asks" : [
[
"4.00000200" ,
"12.00000000"
]
]
limit:
1
500
5
1000
10
5000
50
}
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
limit
INT
NO
Description
Default 100; max 5000. Valid limits:
[5, 10, 20, 50, 100, 500, 1000, 5000]
Data Source: Memory
Recent Trades
List
GET /api/v3/trades
Response:
Get recent trades.
[
Weight(IP):
{
1
"id" : 28457 ,
"price" : "4.00000100" ,
"qty" : "12.00000000" ,
"quoteQty" : "48.000012" ,
"time" : 1499865549590 ,
"isBuyerMaker" : true ,
"isBestMatch" : true
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
INT
limit
Description
}
NO
]
Default 500; max 1000.
Data Source: Memory
Old Trade Lookup (MARKET_DATA)
GET /api/v3/historicalTrades
Response:
Get older market trades.
[
Weight(IP):
{
5
"id" : 28457 ,
"price" : "4.00000100" ,
"qty" : "12.00000000" ,
"quoteQty" : "48.000012" ,
"time" : 1499865549590 , // Trade executed timestamp, as same as `T` in
"isBuyerMaker" : true ,
"isBestMatch" : true
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
Description
the
}
]
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
List
GET /api/v3/aggTrades
Response:
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):
"a"
"p"
"q"
"f"
"l"
"T"
"m"
"M"
1
Parameters:
Name
Type
Mandatory
Description
symbol
STRING
YES
fromId
LONG
NO
id to
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.
:
:
:
:
:
:
:
:
26129 ,
"0.01633102" ,
"4.70443515" ,
27781 ,
27781 ,
1498793709153 ,
true ,
true
//
//
//
//
//
//
//
//
Aggregate tradeId
Price
Quantity
First tradeId
Last tradeId
Timestamp
Was the buyer the maker?
Was the trade the best price match?
1499040000000 ,
"0.01634790" ,
"0.80000000" ,
"0.01575800" ,
"0.01577100" ,
"148976.11427815" ,
1499644799999 ,
"2434.19055334" ,
308 ,
"1756.87402397" ,
"28.46694368" ,
"17928899.62484339"
//
//
//
//
//
//
//
//
//
//
//
//
Open time
Open
High
Low
Close
Volume
Close time
Quote asset volume
Number of trades
Taker buy base asset volume
Taker buy quote asset volume
Ignore.
}
]
get aggregate trades from
INCLUSIVE.
startTime and endTime are sent, time between startTime and endTime
must be less than 1 hour.
If fromId, startTime, and endTime are not sent, the most recent
aggregate trades will be returned.
If
Data Source: Database
Kline/Candlestick Data
GET /api/v3/klines
Response:
Kline/candlestick bars for a symbol.
Klines are uniquely identified by their open time.
[
[
Weight(IP):
1
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
interval
ENUM
YES
startTime
LONG
NO
endTime
LONG
NO
limit
INT
NO
Description
]
]
Default 500; max 1000.
startTime and endTime are not sent, the most recent klines are
returned.
If
Data Source: Database
Current Average Price
GET /api/v3/avgPrice
Response:
Current average price
symbol.
for a
{
Weight(IP):
"mins" : 5 ,
"price" : "9.35751834"
1
}
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
Description
Data Source: Memory
24hr Ticker Price Change Statistics
GET /api/v3/ticker/24hr
Response:
24 hour rolling window price change statistics. Careful when accessing this
with no symbol.
{
"symbol" : "BNBBTC" ,
"priceChange" : "-94.99999800" ,
"priceChangePercent" : "-95.960" ,
"weightedAvgPrice" : "0.29628482" ,
"prevClosePrice" : "0.10002000" ,
"lastPrice" : "4.00000200" ,
"lastQty" : "200.00000000" ,
"bidPrice" : "4.00000000" ,
"askPrice" : "4.00000200" ,
"openPrice" : "99.00000000" ,
"highPrice" : "100.00000000" ,
"lowPrice" : "0.10000000" ,
"volume" : "8913.30000000" ,
"quoteVolume" : "15.30000000" ,
"openTime" : 1499783499040 ,
"closeTime" : 1499869899040 ,
"firstId" : 28385 ,
// First tradeId
"lastId" : 28460 ,
// Last tradeId
"count" : 76
// Trade count
Weight(IP):
single symbol;
40 when the symbol parameter
1 for a
omitted;
is
Parameters:
Name
Type
Mandatory
symbol
STRING
NO
the symbol
array.
not sent, tickers
is
If
Description
for
symbols
all
be returned
will
an
in
Data Source: Memory
}
OR
[
{
"symbol" : "BNBBTC" ,
"priceChange" : "-94.99999800" ,
"priceChangePercent" : "-95.960" ,
"weightedAvgPrice" : "0.29628482" ,
"prevClosePrice" : "0.10002000" ,
"lastPrice" : "4.00000200" ,
"lastQty" : "200.00000000" ,
"bidPrice" : "4.00000000" ,
"askPrice" : "4.00000200" ,
"openPrice" : "99.00000000" ,
"highPrice" : "100.00000000" ,
"lowPrice" : "0.10000000" ,
"volume" : "8913.30000000" ,
"quoteVolume" : "15.30000000" ,
"openTime" : 1499783499040 ,
"closeTime" : 1499869899040 ,
"firstId" : 28385 ,
// First tradeId
"lastId" : 28460 ,
// Last tradeId
"count" : 76
// Trade count
}
]
Symbol Price Ticker
GET /api/v3/ticker/price
Latest price
Response:
symbol or symbols.
for a
{
Weight(IP):
"symbol" : "LTCBTC" ,
"price" : "4.00000200"
}
single symbol;
when the symbol parameter
1 for a
2
omitted
is
OR
Parameters:
Name
Type
Mandatory
symbol
STRING
NO
the symbol
array.
{
"symbol" : "LTCBTC" ,
"price" : "4.00000200"
not sent, prices
is
If
[
Description
for
symbols
all
be returned
will
},
{
an
in
"symbol" : "ETHBTC" ,
"price" : "0.07946600"
}
]
Data Source: Memory
Symbol Order Book Ticker
GET /api/v3/ticker/bookTicker
Response:
Best price/qty on the order book
symbol or symbols.
for a
{
Weight(IP):
single symbol;
when the symbol parameter
"symbol" :
"bidPrice"
"bidQty" :
"askPrice"
"askQty" :
1 for a
2
omitted
is
"LTCBTC" ,
: "4.00000000" ,
"431.00000000" ,
: "4.00000200" ,
"9.00000000"
}
Parameters:
Name
Type
Mandatory
symbol
STRING
NO
OR
Description
[
{
the symbol
an array.
not sent, bookTickers
is
If
for
symbols
all
be returned
will
in
Data Source: Memory
"symbol" :
"bidPrice"
"bidQty" :
"askPrice"
"askQty" :
"LTCBTC" ,
: "4.00000000" ,
"431.00000000" ,
: "4.00000200" ,
"9.00000000"
"symbol" :
"bidPrice"
"bidQty" :
"askPrice"
"askQty" :
"ETHBTC" ,
: "0.07946700" ,
"9.00000000" ,
: "100000.00000000" ,
"1000.00000000"
},
{
}
]
Websocket Market Streams
The base endpoint is: wss://stream.binance.com:9443
Streams can be accessed either in a single raw stream or in a combined
stream
Raw streams are accessed at /ws/
Combined streams are accessed at /stream?streams=
//
Combined stream events are wrapped as follows: {"stream":"
","data":}
All symbols for streams are lowercase
A single connection to stream.binance.com is only valid for 24 hours;
expect to be disconnected at the 24 hour mark
The websocket server will send a ping frame every 3 minutes. If the
websocket server does not receive a pong frame back from the
connection within a 10 minute period, the connection will be
disconnected. Unsolicited pong frames are allowed.
Live Subscribing/Unsubscribing to streams
The following data can be sent through the websocket instance in order
to subscribe/unsubscribe from streams. Examples can be seen below.
The id used in the JSON payloads is an unsigned INT used as an
identifier to uniquely identify the messages going back and forth.
In the response, if the result received is null this means the request
sent was a success.
Subscribe to
stream
a
Request
Response
{
"method": "SUBSCRIBE",
"params":
{
"result" : null ,
"id" : 1
[
}
"btcusdt@aggTrade",
"btcusdt@depth"
],
"id": 1
}
Unsubscribe to
stream
a
Request
Response
{
"method": "UNSUBSCRIBE",
"params":
{
[
}
"result" : null ,
"id" : 312
"btcusdt@depth"
],
312
"id":
}
Listing Subscriptions
Request
Response
{
"method": "LIST_SUBSCRIPTIONS",
{
"result" : [
"btcusdt@aggTrade"
],
"id" : 3
"id": 3
}
}
Setting Properties
Currently, the only property can be set is to set whether combined stream
payloads are enabled or not. The combined property is set to false when
connecting using /ws/ ("raw streams") and true when connecting using
stream/
/
.
Request
Response
{
"method": "SET_PROPERTY",
"params":
{
"result" : null ,
"id" : 5
[
}
"combined",
true
],
"id": 5
}
Retrieving Properties
Request
Response
{
"method": "GET_PROPERTY",
"params":
{
[
}
"result" : true , // Indicates that combined is set to true.
"id" : 2
"combined"
],
"id": 2
}
Error Messages
Error Message
Description
{"code": 0, "msg": "Unknown property",
"id": '%s'}
Parameter used in the
SET_PROPERTY or
GET_PROPERTY was invalid
{"code": 1, "msg": "Invalid value type:
expected Boolean", "id": '%s'}
Value should only be
true or false
{"code": 2, "msg": "Invalid request: property
name must be a string"}
Property name provided
was invalid
{"code": 2, "msg": "Invalid request: request
ID must be an unsigned integer"}
Parameter id had to be
provided or the value
provided in the id
parameter is an
unsupported type
{"code": 2, "msg": "Invalid request:
unknown variant %s, expected one
Possible typo in the
provided method or
provided method was
neither of the expected
values
SUBSCRIBE
UNSUBSCRIBE
,
LIST_SUBSCRIPTIONS
of
,
SET_PROPERTY
,
,
column 28"}
GET_PROPERTY at line 1
{"code": 2, "msg": "Invalid request: too
many parameters"}
Unnecessary parameters
provided in the data
{"code": 2, "msg": "Invalid request: property
name must be a string"}
Property name was not
provided
{"code":
method
"msg": "Invalid request: missing
method at line 1 column 73"}
field
2,
was not provided
the data
in
{"code":3,"msg":"Invalid JSON: expected
value at line %s column %s"}
JSON data sent has
incorrect syntax.
Aggregate Trade Streams
The Aggregate Trade Streams push trade information that
a single taker order.
Stream Name:
aggregated
is
for
Payload:
@aggTrade
{
"e"
"E"
"s"
"a"
"p"
"q"
"f"
"l"
"T"
"m"
"M"
Update Speed: Real-time
:
:
:
:
:
:
:
:
:
:
:
"aggTrade" ,
123456789 ,
"BNBBTC" ,
12345 ,
"0.001" ,
"100" ,
100 ,
105 ,
123456785 ,
true ,
true
//
//
//
//
//
//
//
//
//
//
//
Event type
Event time
Symbol
Aggregate trade ID
Price
Quantity
First trade ID
Last trade ID
Trade time
Is the buyer the market maker?
Ignore
//
//
//
//
//
//
//
//
//
//
//
Event type
Event time
Symbol
Trade ID
Price
Quantity
Buyer order ID
Seller order ID
Trade time
Is the buyer the market maker?
Ignore
}
Trade Streams
The Trade Streams push raw trade information; each trade has
buyer and seller.
Stream Name:
unique
a
Payload:
@trade
{
"e"
"E"
"s"
"t"
"p"
"q"
"b"
"a"
"T"
"m"
"M"
Update Speed: Real-time
:
:
:
:
:
:
:
:
:
:
:
"trade" ,
123456789 ,
"BNBBTC" ,
12345 ,
"0.001" ,
"100" ,
88 ,
50 ,
123456785 ,
true ,
true
}
Kline/Candlestick Streams
The Kline/Candlestick Stream push updates
every second.
Stream Name:
the current klines/candlestick
to
Payload:
@kline_
{
"e" :
"E" :
"s" :
"k" :
"t"
"T"
"s"
"i"
"f"
"L"
"o"
"c"
"h"
"l"
"v"
"n"
"x"
"q"
"V"
"Q"
"B"
}
Update Speed: 2000ms
Kline/Candlestick chart intervals:
m -> minutes;
-> hours;
h
-> days; w -> weeks; M -> months
d
1m
3m
5m
15m
30m
1h
2h
4h
6h
8h
12h
1d
3d
1w
1M
"kline" ,
123456789 ,
"BNBBTC" ,
{
: 123400000 ,
: 123460000 ,
: "BNBBTC" ,
: "1m" ,
: 100 ,
: 200 ,
: "0.0010" ,
: "0.0020" ,
: "0.0025" ,
: "0.0015" ,
: "1000" ,
: 100 ,
: false ,
: "1.0000" ,
: "500" ,
: "0.500" ,
: "123456"
// Event type
// Event time
// Symbol
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
Kline start time
Kline close time
Symbol
Interval
First trade ID
Last trade ID
Open price
Close price
High price
Low price
Base asset volume
Number of trades
Is this kline closed?
Quote asset volume
Taker buy base asset volume
Taker buy quote asset volume
Ignore
}
Individual Symbol Mini Ticker Stream
24hr rolling window mini-ticker statistics. These are NOT the statistics
UTC day, but a 24hr rolling window for the previous 24hrs.
Stream Name:
the
of
Payload:
@miniTicker
{
"e"
"E"
"s"
"c"
"o"
"h"
"l"
"v"
"q"
Update Speed: 1000ms
:
:
:
:
:
:
:
:
:
"24hrMiniTicker" ,
123456789 ,
"BNBBTC" ,
"0.0025" ,
"0.0010" ,
"0.0025" ,
"0.0010" ,
"10000" ,
"18"
//
//
//
//
//
//
//
//
//
Event type
Event time
Symbol
Close price
Open price
High price
Low price
Total traded base asset volume
Total traded quote asset volume
}
Market Mini Tickers Stream
All
24hr rolling window mini-ticker statistics for all symbols that changed in an
array. These are NOT the statistics of the UTC day, but a 24hr rolling window
for the previous 24hrs. Note that only tickers that have changed will be
present in the array.
Payload:
[
{
Stream Name:
// Same as @miniTicker payload
!miniTicker@arr
}
]
Update Speed: 1000ms
Individual Symbol Ticker Streams
24hr rolling window ticker statistics for a single symbol. These are NOT the
statistics of the UTC day, but a 24hr rolling window for the previous 24hrs.
Payload:
Stream Name:
{
@ticker
"e"
"E"
"s"
"p"
"P"
"w"
"x"
"c"
"Q"
"b"
"B"
"a"
"A"
"o"
"h"
"l"
"v"
"q"
"O"
"C"
"F"
"L"
"n"
Update Speed: 1000ms
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
"24hrTicker" ,
123456789 ,
"BNBBTC" ,
"0.0015" ,
"250.00" ,
"0.0018" ,
"0.0009" ,
"0.0025" ,
"10" ,
"0.0024" ,
"10" ,
"0.0026" ,
"100" ,
"0.0010" ,
"0.0025" ,
"0.0010" ,
"10000" ,
"18" ,
0,
86400000 ,
0,
18150 ,
18151
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
Event type
Event time
Symbol
Price change
Price change percent
Weighted average price
First trade(F)-1 price (first trade before the 24hr
Last price
Last quantity
Best bid price
Best bid quantity
Best ask price
Best ask quantity
Open price
High price
Low price
Total traded base asset volume
Total traded quote asset volume
Statistics open time
Statistics close time
First trade ID
Last trade Id
Total number of trades
}
Market Tickers Stream
All
24hr rolling window ticker statistics for all symbols that changed in an array.
These are NOT the statistics of the UTC day, but a 24hr rolling window for
the previous 24hrs. Note that only tickers that have changed will be present
in the array.
Payload:
[
{
Stream Name:
// Same as @ticker
!ticker@arr
payload
}
]
Update Speed: 1000ms
Individual Symbol Book Ticker Streams
Pushes any update
a specified symbol.
Stream Name:
the best bid or ask's price or quantity
to
real-time
in
for
Payload:
@bookTicker
{
"u"
"s"
"b"
"B"
"a"
"A"
Update Speed: Real-time
: 400900217 ,
// order book updateId
: "BNBUSDT" ,
// symbol
: "25.35190000" , // best bid price
: "31.21000000" , // best bid qty
: "25.36520000" , // best ask price
: "40.66000000" // best ask qty
}
Book Tickers Stream
All
Pushes any update
all symbols.
Stream Name:
the best bid or ask's price or quantity
to
real-time
in
for
Payload:
!bookTicker
{
// Same as @bookTicker payload
}
Update Speed: Real-time
Partial Book Depth Streams
Top bids and asks, Valid are
Stream Names:
s
10, or 20.
5,
Payload:
OR
@depth@depth@100m
{
.
"lastUpdateId" : 160 ,
"bids" : [
[
"0.0024" ,
"10"
]
],
"asks" : [
[
"0.0026" ,
"100"
]
]
Update Speed: 1000ms or 100ms
// Last update ID
// Bids to be updated
// Price level to be updated
// Quantity
// Asks to be updated
// Price level to be updated
// Quantity
}
Diff. Depth Stream
Stream Name:
OR
@depth
@depth@100ms
Payload:
Update Speed: 1000ms or 100ms
{
Order book price and quantity depth updates used
order book.
locally manage an
to
"e" :
"E" :
"s" :
"U" :
"u" :
"b" :
[
"depthUpdate" , // Event type
123456789 ,
// Event time
"BNBBTC" ,
// Symbol
157 ,
// First update ID in event
160 ,
// Final update ID in event
[
// Bids to be updated
"0.0024" ,
"10"
// Price level to be updated
// Quantity
]
],
"a" : [
[
"0.0026" ,
"100"
]
]
// Asks to be updated
// Price level to be updated
// Quantity
}
How to manage
local order book correctly
a
Open a stream to wss://stream.binance.com:9443/ws/bnbbtc@depth
Buffer the events you receive from the stream.
Get a depth snapshot from https://api.binance.com/api/v3/depth?
symbol=BNBBTC&limit=1000
Drop any event where u is <= lastUpdateId in the snapshot.
The first processed event should have U <= lastUpdateId +1 AND u >=
lastUpdateId +1.
While listening to the stream, each new event's U should be equal to the
previous event's u +1.
The data in each event is the absolute quantity for a price level.
If the quantity is 0, remove the price level.
Receiving an event that removes a price level that is not in your local
order book can happen and is normal.
.
.
Spot Account/Trade
Test New Order (TRADE)
POST /api/v3/order/test
(HMAC SHA256)
Response:
Test new order creation and signature/recvWindow long. Creates and
validates a new order but does not send it into the matching engine.
Weight:
{}
1
Parameters:
Same as
POST /api/v3/order
Data Source: Memory
New Order (TRADE)
POST /api/v3/order (HMAC SHA256)
Send
Response ACK:
new order.
in a
{
Weight(Uid):
"symbol" : "BTCUSDT" ,
"orderId" : 28 ,
"orderListId" : - 1 , //Unless OCO, value will be -1
"clientOrderId" : "6gCrw2kRUAF9CvJDGP16IP" ,
"transactTime" : 1507725176595
1
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
side
ENUM
YES
type
ENUM
YES
timeInForce
ENUM
NO
quantity
DECIMAL
NO
quoteOrderQty
DECIMAL
NO
price
DECIMAL
NO
newClientOrderId
STRING
NO
stopPrice
DECIMAL
}
Description
Response RESULT:
{
"symbol" : "BTCUSDT" ,
"orderId" : 28 ,
"orderListId" : - 1 , //Unless OCO, value will be -1
"clientOrderId" : "6gCrw2kRUAF9CvJDGP16IP" ,
"transactTime" : 1507725176595 ,
"price" : "0.00000000" ,
"origQty" : "10.00000000" ,
"executedQty" : "10.00000000" ,
"cummulativeQuoteQty" : "10.00000000" ,
"status" : "FILLED" ,
"timeInForce" : "GTC" ,
"type" : "MARKET" ,
"side" : "SELL"
A unique id among
open orders.
Automatically
generated if not sent.
NO
Used with
STOP_LOSS
STOP_LOSS_LIMIT
TAKE_PROFIT
}
Response FULL:
,
{
,
and
,
"symbol" : "BTCUSDT" ,
"orderId" : 28 ,
"orderListId" : - 1 , //Unless OCO, value will be -1
"clientOrderId" : "6gCrw2kRUAF9CvJDGP16IP" ,
"transactTime" : 1507725176595 ,
"price" : "0.00000000" ,
"origQty" : "10.00000000" ,
"executedQty" : "10.00000000" ,
"cummulativeQuoteQty" : "10.00000000" ,
"status" : "FILLED" ,
"timeInForce" : "GTC" ,
"type" : "MARKET" ,
"side" : "SELL" ,
"fills" : [
{
"price" : "4000.00000000" ,
"qty" : "1.00000000" ,
"commission" : "4.00000000" ,
"commissionAsset" : "USDT"
},
{
"price" : "3999.00000000" ,
"qty" : "5.00000000" ,
"commission" : "19.99500000" ,
"commissionAsset" : "USDT"
},
{
"price" : "3998.00000000" ,
"qty" : "2.00000000" ,
"commission" : "7.99600000" ,
"commissionAsset" : "USDT"
},
{
"price" : "3997.00000000" ,
"qty" : "1.00000000" ,
"commission" : "3.99700000" ,
"commissionAsset" : "USDT"
},
{
"price" : "3995.00000000" ,
"qty" : "1.00000000" ,
"commission" : "3.99500000" ,
"commissionAsset" : "USDT"
}
]
TAKE_PROFIT_LIMIT
orders.
icebergQty
DECIMAL
NO
Used with
LIMIT
,
STOP_LOSS_LIMIT
,
and
TAKE_PROFIT_LIMIT to
create an iceberg
order.
newOrderRespType
ENUM
NO
Set the response
JSON. ACK RESULT or
FULL MARKET and
LIMIT order types
default to FULL all
other orders default
,
,
;
,
to ACK
recvWindow
LONG
NO
timestamp
LONG
YES
.
The value cannot be
greater than 60000
Additional mandatory parameters based on
type
:
Type
Additional mandatory parameters
LIMIT
timeInForce
MARKET
quantity
STOP_LOSS
quantity
STOP_LOSS_LIMIT
timeInForce
TAKE_PROFIT
quantity
TAKE_PROFIT_LIMIT
timeInForce
LIMIT_MAKER
quantity
Other
quantity
,
or
price
,
quoteOrderQty
stopPrice
,
quantity
,
,
price
,
stopPrice
,
price
,
stopPrice
stopPrice
,
quantity
,
}
price
,
info:
are LIMIT orders that will be rejected if they would
immediately match and trade as a taker.
STOP_LOSS and TAKE_PROFIT will execute a MARKET order when the stopP
rice is reached.
Any LIMIT or LIMIT_MAKER type order can be made an iceberg order by
sending an icebergQty
Any order with an icebergQty MUST have timeInForce set to GTC
MARKET orders using the quantity field specifies the amount of the base
asset the user wants to buy or sell at the market price.
For example, sending a MARKET order on BTCUSDT will specify how
much BTC the user is buying or selling.
MARKET orders using quoteOrderQty specifies the amount the user wants
to spend (when buying) or receive (when selling) the quote asset; the
correct quantity will be determined based on the market liquidity and q
LIMIT_MAKER
.
.
uoteOrderQty
.
Using BTCUSDT as an example:
On the BUY side, the order will buy as many BTC as quoteOrd
erQty USDT can.
On the SELL side, the order will sell as much BTC needed to
receive quoteOrderQty USDT.
MARKET orders using quoteOrderQty will not break LOT_SIZE filter rules;
the order will execute a quantity that will have the notional value as
close as possible to quoteOrderQty
same newClientOrderId can be accepted only when the previous one is
filled, otherwise the order will be rejected.
.
Trigger order price rules against market price
versions:
Price above market price:
Price below market price:
STOP_LOSS
BUY
STOP_LOSS
SELL
both MARKET and LIMIT
for
TAKE_PROFIT
,
SELL
TAKE_PROFIT
,
BUY
Data Source: Matching Engine
Cancel Order (TRADE)
DELETE /api/v3/order (HMAC SHA256)
Response:
Cancel an active order.
{
Weight(IP):
"symbol" : "LTCBTC" ,
"origClientOrderId" : "myOrder1" ,
"orderId" : 4 ,
"orderListId" : - 1 , //Unless part of an OCO, the value will always be -1.
"clientOrderId" : "cancelMyOrder1" ,
"price" : "2.00000000" ,
"origQty" : "1.00000000" ,
"executedQty" : "0.00000000" ,
"cummulativeQuoteQty" : "0.00000000" ,
"status" : "CANCELED" ,
"timeInForce" : "GTC" ,
"type" : "LIMIT" ,
"side" : "BUY"
1
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
orderId
LONG
NO
origClientOrderId
STRING
NO
Description
}
newClientOrderId
STRING
NO
Used
recvWindow
LONG
NO
The value cannot be
greater than 60000
timestamp
LONG
YES
Either
or
orderId
uniquely identify
this cancel. Automatically
generated by default.
to
must be sent.
origClientOrderId
Data Source: Matching Engine
Cancel
Open Orders on
all
Symbol (TRADE)
a
DELETE api/v3/openOrders
Response:
Cancels all active orders on
This includes OCO orders.
symbol.
a
[
{
Weight(IP):
"symbol" : "BTCUSDT" ,
"origClientOrderId" : "E6APeyTJvkMvLMYMqu1KQ4" ,
"orderId" : 11 ,
"orderListId" : - 1 ,
"clientOrderId" : "pXLV6Hz6mprAcVYpVMTGgx" ,
"price" : "0.089853" ,
"origQty" : "0.178622" ,
"executedQty" : "0.000000" ,
"cummulativeQuoteQty" : "0.000000" ,
"status" : "CANCELED" ,
"timeInForce" : "GTC" ,
"type" : "LIMIT" ,
"side" : "BUY"
1
Parameters
Name
Type
Mandatory
symbol
STRING
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Description
The value cannot be greater
than 60000
},
{
"symbol" : "BTCUSDT" ,
"origClientOrderId" : "A3EF2HCwxgZPFMrfwbgrhv" ,
"orderId" : 13 ,
"orderListId" : - 1 ,
"clientOrderId" : "pXLV6Hz6mprAcVYpVMTGgx" ,
"price" : "0.090430" ,
"origQty" : "0.178622" ,
"executedQty" : "0.000000" ,
"cummulativeQuoteQty" : "0.000000" ,
"status" : "CANCELED" ,
"timeInForce" : "GTC" ,
"type" : "LIMIT" ,
"side" : "BUY"
Data Source: Matching Engine
},
{
"orderListId" : 1929 ,
"contingencyType" : "OCO" ,
"listStatusType" : "ALL_DONE" ,
"listOrderStatus" : "ALL_DONE" ,
"listClientOrderId" : "2inzWQdDvZLHbbAmAozX2N" ,
"transactionTime" : 1585230948299 ,
"symbol" : "BTCUSDT" ,
"orders" : [
{
"symbol" : "BTCUSDT" ,
"orderId" : 20 ,
"clientOrderId" : "CwOOIPHSmYywx6jZX77TdL"
},
{
"symbol" : "BTCUSDT" ,
"orderId" : 21 ,
"clientOrderId" : "461cPg51vQjV3zIMOXNz39"
}
],
"orderReports" : [
{
"symbol" : "BTCUSDT" ,
"origClientOrderId" : "CwOOIPHSmYywx6jZX77TdL" ,
"orderId" : 20 ,
"orderListId" : 1929 ,
"clientOrderId" : "pXLV6Hz6mprAcVYpVMTGgx" ,
"price" : "0.668611" ,
"origQty" : "0.690354" ,
"executedQty" : "0.000000" ,
"cummulativeQuoteQty" : "0.000000" ,
"status" : "CANCELED" ,
"timeInForce" : "GTC" ,
"type" : "STOP_LOSS_LIMIT" ,
"side" : "BUY" ,
"stopPrice" : "0.378131" ,
"icebergQty" : "0.017083"
},
{
"symbol" : "BTCUSDT" ,
"origClientOrderId" : "461cPg51vQjV3zIMOXNz39" ,
"orderId" : 21 ,
"orderListId" : 1929 ,
"clientOrderId" : "pXLV6Hz6mprAcVYpVMTGgx" ,
"price" : "0.008791" ,
"origQty" : "0.690354" ,
"executedQty" : "0.000000" ,
"cummulativeQuoteQty" : "0.000000" ,
"status" : "CANCELED" ,
"timeInForce" : "GTC" ,
"type" : "LIMIT_MAKER" ,
"side" : "BUY" ,
"icebergQty" : "0.639962"
}
]
}
]
Query Order (USER_DATA)
GET /api/v3/order (HMAC SHA256)
Response:
Check an order's status.
{
Weight(IP):
"symbol" : "LTCBTC" ,
"orderId" : 1 ,
"orderListId" : - 1 , //Unless OCO, value will be -1
"clientOrderId" : "myOrder1" ,
"price" : "0.1" ,
"origQty" : "1.0" ,
"executedQty" : "0.0" ,
"cummulativeQuoteQty" : "0.0" ,
"status" : "NEW" ,
"timeInForce" : "GTC" ,
"type" : "LIMIT" ,
"side" : "BUY" ,
"stopPrice" : "0.0" ,
"icebergQty" : "0.0" ,
"time" : 1499827319559 ,
"updateTime" : 1499827319559 ,
"isWorking" : true ,
"origQuoteOrderQty" : "0.000000"
2
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
orderId
LONG
NO
origClientOrderId
STRING
NO
recvWindow
LONG
NO
timestamp
LONG
YES
Description
The value cannot be
greater than 60000
}
Notes:
Either orderId or origClientOrderId must be sent.
For some historical orders cummulativeQuoteQty will be <
data is not available at this time.
meaning the
0,
Data Source: Database
Current Open Orders (USER_DATA)
GET /api/v3/openOrders
Get all open orders on
symbol.
(HMAC SHA256)
Response:
symbol. Careful when accessing this with no
a
[
{
Weight(IP):
omitted
single symbol; 40 when the symbol parameter
3 for a
"symbol" : "LTCBTC" ,
"orderId" : 1 ,
"orderListId" : - 1 , //Unless OCO, the value will always be -1
"clientOrderId" : "myOrder1" ,
"price" : "0.1" ,
"origQty" : "1.0" ,
"executedQty" : "0.0" ,
"cummulativeQuoteQty" : "0.0" ,
"status" : "NEW" ,
"timeInForce" : "GTC" ,
"type" : "LIMIT" ,
"side" : "BUY" ,
"stopPrice" : "0.0" ,
"icebergQty" : "0.0" ,
"time" : 1499827319559 ,
"updateTime" : 1499827319559 ,
"isWorking" : true ,
"origQuoteOrderQty" : "0.000000"
is
Parameters:
Name
Type
Mandatory
symbol
STRING
NO
recvWindow
LONG
NO
timestamp
LONG
YES
the symbol
array.
The value cannot be greater
than 60000
not sent, orders
is
If
Description
for
symbols
all
be returned
will
an
in
}
]
Data Source: Database
Orders (USER_DATA)
All
GET /api/v3/allOrders (HMAC SHA256)
Get
Response:
account orders; active, canceled, or
all
filled.
[
Weight(IP): 10 with symbol
{
"symbol" : "LTCBTC" ,
"orderId" : 1 ,
"orderListId" : - 1 , //Unless OCO, the value will always be -1
"clientOrderId" : "myOrder1" ,
"price" : "0.1" ,
"origQty" : "1.0" ,
"executedQty" : "0.0" ,
"cummulativeQuoteQty" : "0.0" ,
"status" : "NEW" ,
"timeInForce" : "GTC" ,
"type" : "LIMIT" ,
"side" : "BUY" ,
"stopPrice" : "0.0" ,
"icebergQty" : "0.0" ,
"time" : 1499827319559 ,
"updateTime" : 1499827319559 ,
"isWorking" : true ,
"origQuoteOrderQty" : "0.000000"
Parameters:
Name
Type
Mandatory
Description
symbol
STRING
YES
orderId
LONG
NO
startTime
LONG
NO
endTime
LONG
NO
limit
INT
NO
Default 500; max 1000.
recvWindow
LONG
NO
The value cannot be greater
than 60000
timestamp
LONG
YES
}
]
Notes:
get orders >= that orderId Otherwise most
recent orders are returned.
For some historical orders cummulativeQuoteQty will be < 0, meaning the
data is not available at this time.
If startTime and/or endTime provided, orderId is not required.
orderId is set,
If
will
it
.
Data Source: Database
New OCO (TRADE)
POST /api/v3/order/oco (HMAC SHA256)
Send
Response:
new OCO
in a
{
Weight(Uid)
Parameters
"orderListId" : 0 ,
"contingencyType" : "OCO" ,
"listStatusType" : "EXEC_STARTED" ,
"listOrderStatus" : "EXECUTING" ,
"listClientOrderId" : "JYVpp3F0f5CAG15DhtrqLp" ,
"transactionTime" : 1563417480525 ,
"symbol" : "LTCBTC" ,
"orders" : [
{
"symbol" : "LTCBTC" ,
"orderId" : 2 ,
"clientOrderId" : "Kk7sqHb9J6mJWTMDVW7Vos"
},
{
"symbol" : "LTCBTC" ,
"orderId" : 3 ,
"clientOrderId" : "xTXKaGYd4bluPVp78IVRvl"
}
],
"orderReports" : [
{
"symbol" : "LTCBTC" ,
"orderId" : 2 ,
"orderListId" : 0 ,
"clientOrderId" : "Kk7sqHb9J6mJWTMDVW7Vos" ,
"transactTime" : 1563417480525 ,
"price" : "0.000000" ,
"origQty" : "0.624363" ,
"executedQty" : "0.000000" ,
"cummulativeQuoteQty" : "0.000000" ,
"status" : "NEW" ,
"timeInForce" : "GTC" ,
"type" : "STOP_LOSS" ,
"side" : "BUY" ,
"stopPrice" : "0.960664"
},
{
"symbol" : "LTCBTC" ,
"orderId" : 3 ,
"orderListId" : 0 ,
"clientOrderId" : "xTXKaGYd4bluPVp78IVRvl" ,
"transactTime" : 1563417480525 ,
"price" : "0.036435" ,
"origQty" : "0.624363" ,
"executedQty" : "0.000000" ,
"cummulativeQuoteQty" : "0.000000" ,
"status" : "NEW" ,
"timeInForce" : "GTC" ,
"type" : "LIMIT_MAKER" ,
"side" : "BUY"
}
]
1
:
:
Name
Type
Mandatory
symbol
STRING
YES
listClientOrderId
STRING
NO
side
ENUM
YES
quantity
DECIMAL
YES
limitClientOrderId
STRING
NO
price
DECIMAL
YES
limitIcebergQty
DECIMAL
NO
stopClientOrderId
STRING
NO
stopPrice
DECIMAL
YES
stopLimitPrice
DECIMAL
NO
Description
A unique Id for the
entire orderList
A unique Id
limit order
the
for
A unique Id for the
stop loss/stop loss
limit leg
provided,
If
stopLimitTimeInForce
required.
is
stopIcebergQty
DECIMAL
NO
stopLimitTimeInForce
ENUM
NO
Valid values are
GTC
FOK
/
IOC
/
newOrderRespType
ENUM
NO
Set the response
JSON.
recvWindow
LONG
NO
The value cannot be
greater than 60000
timestamp
LONG
YES
}
Other Info:
Price Restrictions:
SELL Limit Price > Last Price > Stop Price
BUY Limit Price < Last Price < Stop Price
Quantity Restrictions:
Both legs must have the same quantity
ICEBERG quantities however do not have to be the same.
Order Rate Limit
OCO counts as 2 orders against the order rate limit.
:
:
Data Source: Matching Engine
Cancel OCO (TRADE)
Cancel an entire Order
DELETE /api/v3/orderList (HMAC SHA256)
Weight(IP)
List.
Response:
1
:
{
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
orderListId
LONG
NO
"orderListId" : 0 ,
"contingencyType" : "OCO" ,
"listStatusType" : "ALL_DONE" ,
"listOrderStatus" : "ALL_DONE" ,
"listClientOrderId" : "C3wyj4WVEktd7u9aVBRXcN" ,
"transactionTime" : 1574040868128 ,
"symbol" : "LTCBTC" ,
"orders" : [
{
"symbol" : "LTCBTC" ,
"orderId" : 2 ,
"clientOrderId" : "pO9ufTiFGg3nw2fOdgeOXa"
},
{
"symbol" : "LTCBTC" ,
"orderId" : 3 ,
"clientOrderId" : "TXOvglzXuaubXAaENpaRCB"
}
],
"orderReports" : [
{
"symbol" : "LTCBTC" ,
"origClientOrderId" : "pO9ufTiFGg3nw2fOdgeOXa" ,
"orderId" : 2 ,
"orderListId" : 0 ,
"clientOrderId" : "unfWT8ig8i0uj6lPuYLez6" ,
"price" : "1.00000000" ,
"origQty" : "10.00000000" ,
"executedQty" : "0.00000000" ,
"cummulativeQuoteQty" : "0.00000000" ,
"status" : "CANCELED" ,
"timeInForce" : "GTC" ,
"type" : "STOP_LOSS_LIMIT" ,
"side" : "SELL" ,
"stopPrice" : "1.00000000"
},
{
"symbol" : "LTCBTC" ,
"origClientOrderId" : "TXOvglzXuaubXAaENpaRCB" ,
"orderId" : 3 ,
"orderListId" : 0 ,
"clientOrderId" : "unfWT8ig8i0uj6lPuYLez6" ,
"price" : "3.00000000" ,
"origQty" : "10.00000000" ,
"executedQty" : "0.00000000" ,
"cummulativeQuoteQty" : "0.00000000" ,
"status" : "CANCELED" ,
"timeInForce" : "GTC" ,
"type" : "LIMIT_MAKER" ,
"side" : "SELL"
}
]
Description
Either
or
must
orderListId
listClientOrderId
be provided
listClientOrderId
STRING
NO
Either
or
must
orderListId
listClientOrderId
be provided
newClientOrderId
STRING
NO
Used
uniquely identify
this cancel. Automatically
generated by default
recvWindow
LONG
NO
The value cannot be
greater than 60000
timestamp
LONG
YES
to
Additional notes:
Canceling an individual leg
cancel the entire OCO
will
Data Source: Matching Engine
}
Query OCO (USER_DATA)
GET /api/v3/orderList (HMAC SHA256)
Retrieves
Response:
specific OCO based on provided optional parameters
a
{
Weight(IP)
"orderListId" : 27 ,
"contingencyType" : "OCO" ,
"listStatusType" : "EXEC_STARTED" ,
"listOrderStatus" : "EXECUTING" ,
"listClientOrderId" : "h2USkA5YQpaXHPIrkd96xE" ,
"transactionTime" : 1565245656253 ,
"symbol" : "LTCBTC" ,
"orders" : [
{
"symbol" : "LTCBTC" ,
"orderId" : 4 ,
"clientOrderId" : "qD1gy3kc3Gx0rihm9Y3xwS"
},
{
"symbol" : "LTCBTC" ,
"orderId" : 5 ,
"clientOrderId" : "ARzZ9I00CPM8i3NhmU9Ega"
}
]
2
:
Parameters
:
Name
Type
Mandatory
Description
orderListId
LONG
NO
Either
or
must
orderListId
origClientOrderId
be provided
origClientOrderId
STRING
NO
Either
or
must
orderListId
origClientOrderId
be provided
recvWindow
LONG
timestamp
NO
LONG
The value cannot be
greater than 60000
}
YES
Data Source: Database
Query
OCO (USER_DATA)
all
GET /api/v3/allOrderList (HMAC SHA256)
Retrieves
Response:
OCO based on provided optional parameters
all
[
Weight(IP) 10
{
:
"orderListId" : 29 ,
"contingencyType" : "OCO" ,
"listStatusType" : "EXEC_STARTED" ,
"listOrderStatus" : "EXECUTING" ,
"listClientOrderId" : "amEEAXryFzFwYF1FeRpUoZ" ,
"transactionTime" : 1565245913483 ,
"symbol" : "LTCBTC" ,
"orders" : [
{
"symbol" : "LTCBTC" ,
"orderId" : 4 ,
"clientOrderId" : "oD7aesZqjEGlZrbtRpy5zB"
},
{
"symbol" : "LTCBTC" ,
"orderId" : 5 ,
"clientOrderId" : "Jr1h6xirOxgeJOUuYQS7V3"
}
]
Parameters
Name
Type
Mandatory
Description
fromId
LONG
NO
If
startTime
LONG
NO
endTime
LONG
NO
limit
INT
NO
Default Value: 500; Max Value:
1000
recvWindow
LONG
NO
The value cannot be greater
than 60000
timestamp
LONG
supplied, neither startTime or
endTime can be provided
},
{
"orderListId" : 28 ,
"contingencyType" : "OCO" ,
"listStatusType" : "EXEC_STARTED" ,
"listOrderStatus" : "EXECUTING" ,
"listClientOrderId" : "hG7hFNxJV6cZy3Ze4AUT4d" ,
"transactionTime" : 1565245913407 ,
"symbol" : "LTCBTC" ,
"orders" : [
{
"symbol" : "LTCBTC" ,
"orderId" : 2 ,
"clientOrderId" : "j6lFOfbmFMRjTYA7rRJ0LP"
},
{
"symbol" : "LTCBTC" ,
"orderId" : 3 ,
"clientOrderId" : "z0KCjOdditiLS5ekAFtK81"
}
]
YES
Data Source: Database
}
]
Query Open OCO (USER_DATA)
GET /api/v3/openOrderList
Weight(IP)
(HMAC SHA256)
Response:
3
:
[
Parameters
{
Name
Type
Mandatory
Description
recvWindow
LONG
NO
The value cannot be greater
than 60000
timestamp
LONG
YES
"orderListId" : 31 ,
"contingencyType" : "OCO" ,
"listStatusType" : "EXEC_STARTED" ,
"listOrderStatus" : "EXECUTING" ,
"listClientOrderId" : "wuB13fmulKj3YjdqWEcsnp" ,
"transactionTime" : 1565246080644 ,
"symbol" : "LTCBTC" ,
"orders" : [
{
"symbol" : "LTCBTC" ,
"orderId" : 4 ,
"clientOrderId" : "r3EH2N76dHfLoSZWIUw1bT"
},
{
"symbol" : "LTCBTC" ,
"orderId" : 5 ,
"clientOrderId" : "Cv1SnyPD3qhqpbjpYEHbd2"
}
]
Data Source: Database
}
]
Account Information (USER_DATA)
GET /api/v3/account (HMAC SHA256)
Response:
Get current account information.
{
Weight(IP): 10
"makerCommission" : 15 ,
"takerCommission" : 15 ,
"buyerCommission" : 0 ,
"sellerCommission" : 0 ,
"canTrade" : true ,
"canWithdraw" : true ,
"canDeposit" : true ,
"updateTime" : 123456789 ,
"accountType" : "SPOT" ,
"balances" : [
{
"asset" : "BTC" ,
"free" : "4723846.89208129" ,
"locked" : "0.00000000"
},
{
"asset" : "LTC" ,
"free" : "4763368.68006011" ,
"locked" : "0.00000000"
}
],
"permissions" : [
"SPOT"
]
Parameters:
Name
Type
Mandatory
Description
recvWindow
LONG
NO
The value cannot be greater
than 60000
timestamp
LONG
YES
Data Source: Memory => Database
}
Account Trade
(USER_DATA)
List
GET /api/v3/myTrades (HMAC SHA256)
Get trades
Response:
specific account and symbol.
for a
[
Weight(IP): 10
{
"symbol" : "BNBBTC" ,
"id" : 28457 ,
"orderId" : 100234 ,
"orderListId" : - 1 , //Unless OCO, the value will always be -1
"price" : "4.00000100" ,
"qty" : "12.00000000" ,
"quoteQty" : "48.000012" ,
"commission" : "10.10000000" ,
"commissionAsset" : "BNB" ,
"time" : 1499865549590 ,
"isBuyer" : true ,
"isMaker" : false ,
"isBestMatch" : true
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
orderId
LONG
NO
startTime
LONG
Description
This can only be used in
combination with symbol
.
NO
}
]
endTime
LONG
NO
fromId
LONG
NO
TradeId to fetch from. Default
gets most recent trades.
limit
INT
NO
Default 500; max 1000.
recvWindow
LONG
NO
The value cannot be greater
than 60000
timestamp
LONG
YES
Notes:
fromId is set,
If
get
will
it
>= that
id
fromId
Otherwise most recent
.
trades are returned.
Data Source: Database
Margin Account/Trade
Cross Margin Account Transfer (MARGIN)
POST /sapi/v1/margin/transfer (HMAC SHA256)
Response:
Execute transfer between spot account and cross margin account.
{
Weight(IP): 600
//transaction id
"tranId" : 100000001
}
Parameters:
Name
Type
Mandatory
Description
asset
STRING
YES
The asset being transferred,
e.g., BTC
amount
DECIMAL
YES
The amount
transferred
type
INT
YES
1:
recvWindow
LONG
NO
The value cannot be greater
than 60000
timestamp
LONG
YES
be
to
transfer from main account
to cross margin account 2:
transfer from cross margin
account to main account
Margin Account Borrow (MARGIN)
POST /sapi/v1/margin/loan
Apply
(HMAC SHA256)
Response:
loan.
for a
{
Weight(Uid): 3000
//transaction id
"tranId" : 100000001
}
Parameters:
Name
Type
Mandatory
Description
asset
STRING
YES
isIsolated
STRING
NO
for
symbol
STRING
NO
isolated symbol
amount
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
isolated margin or not,
"TRUE", "FALSE",default
"FALSE"
The value cannot be greater
than 60000
"isIsolated" = "TRUE", "symbol" must be sent
"isIsolated" = "FALSE" for crossed margin loan
If
Margin Account Repay (MARGIN)
POST /sapi/v1/margin/repay
Repay loan
(HMAC SHA256)
Response:
margin account.
for
{
Weight(IP): 3000
//transaction id
"tranId" : 100000001
}
Parameters:
Name
Type
Mandatory
Description
asset
STRING
YES
isIsolated
STRING
NO
for
symbol
STRING
NO
isolated symbol
amount
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
isolated margin or not,
"TRUE", "FALSE",default
"FALSE"
The value cannot be greater
than 60000
"isIsolated" = "TRUE", "symbol" must be sent
"isIsolated" = "FALSE" for crossed margin repay
If
Query Margin Asset (MARKET_DATA)
GET /sapi/v1/margin/asset
Response:
Weight(IP): 10
{
Parameters:
Name
Type
Mandatory
asset
STRING
YES
"assetFullName" : "Binance Coin" ,
"assetName" : "BNB" ,
"isBorrowable" : false ,
"isMortgageable" : true ,
"userMinBorrow" : "0.00000000" ,
"userMinRepay" : "0.00000000"
Description
}
Query Cross Margin Pair (MARKET_DATA)
GET /sapi/v1/margin/pair
Response:
Weight(IP): 10
{
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
"id" : 323355778339572400 ,
"symbol" : "BTCUSDT" ,
"base" : "BTC" ,
"quote" : "USDT" ,
"isMarginTrade" : true ,
"isBuyAllowed" : true ,
"isSellAllowed" : true
Description
}
Get All Margin Assets (MARKET_DATA)
GET /sapi/v1/margin/allAssets
Weight(IP):
Response:
1
[
Parameters:
{
"assetFullName" : "USD coin" ,
"assetName" : "USDC" ,
"isBorrowable" : true ,
"isMortgageable" : true ,
"userMinBorrow" : "0.00000000" ,
"userMinRepay" : "0.00000000"
None
},
{
"assetFullName" : "BNB-coin" ,
"assetName" : "BNB" ,
"isBorrowable" : true ,
"isMortgageable" : true ,
"userMinBorrow" : "1.00000000" ,
"userMinRepay" : "0.00000000"
},
{
"assetFullName" : "Tether" ,
"assetName" : "USDT" ,
"isBorrowable" : true ,
"isMortgageable" : true ,
"userMinBorrow" : "1.00000000" ,
"userMinRepay" : "0.00000000"
},
{
"assetFullName" : "etherum" ,
"assetName" : "ETH" ,
"isBorrowable" : true ,
"isMortgageable" : true ,
"userMinBorrow" : "0.00000000" ,
"userMinRepay" : "0.00000000"
},
{
"assetFullName" : "Bitcoin" ,
"assetName" : "BTC" ,
"isBorrowable" : true ,
"isMortgageable" : true ,
"userMinBorrow" : "0.00000000" ,
"userMinRepay" : "0.00000000"
}
]
Get All Cross Margin Pairs (MARKET_DATA)
GET /sapi/v1/margin/allPairs
Weight(IP):
Response:
1
[
Parameters:
{
"base" : "BNB" ,
"id" : 351637150141315861 ,
"isBuyAllowed" : true ,
"isMarginTrade" : true ,
"isSellAllowed" : true ,
"quote" : "BTC" ,
"symbol" : "BNBBTC"
None
},
{
"base" : "TRX" ,
"id" : 351637923235429141 ,
"isBuyAllowed" : true ,
"isMarginTrade" : true ,
"isSellAllowed" : true ,
"quote" : "BTC" ,
"symbol" : "TRXBTC"
},
{
"base" : "XRP" ,
"id" : 351638112213990165 ,
"isBuyAllowed" : true ,
"isMarginTrade" : true ,
"isSellAllowed" : true ,
"quote" : "BTC" ,
"symbol" : "XRPBTC"
},
{
"base" : "ETH" ,
"id" : 351638524530850581 ,
"isBuyAllowed" : true ,
"isMarginTrade" : true ,
"isSellAllowed" : true ,
"quote" : "BTC" ,
"symbol" : "ETHBTC"
},
{
"base" : "BNB" ,
"id" : 376870400832855109 ,
"isBuyAllowed" : true ,
"isMarginTrade" : true ,
"isSellAllowed" : true ,
"quote" : "USDT" ,
"symbol" : "BNBUSDT"
}
]
Query Margin PriceIndex (MARKET_DATA)
GET /sapi/v1/margin/priceIndex
Response:
Weight(IP): 10
{
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
"calcTime" : 1562046418000 ,
"price" : "0.00333930" ,
"symbol" : "BNBBTC"
Description
}
Margin Account New Order (TRADE)
POST /sapi/v1/margin/order
Post
new order
a
(HMAC SHA256)
Response ACK:
margin account.
for
{
Weight(Uid):
"symbol" : "BTCUSDT" ,
"orderId" : 28 ,
"clientOrderId" : "6gCrw2kRUAF9CvJDGP16IP" ,
"isIsolated" : true ,
// if isolated margin
"transactTime" : 1507725176595
6
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
isIsolated
STRING
NO
}
Description
Response RESULT:
isolated margin or
not, "TRUE",
"FALSE",default
"FALSE"
for
side
ENUM
YES
type
ENUM
YES
quantity
DECIMAL
NO
quoteOrderQty
DECIMAL
NO
{
"symbol" : "BTCUSDT" ,
"orderId" : 28 ,
"clientOrderId" : "6gCrw2kRUAF9CvJDGP16IP" ,
"transactTime" : 1507725176595 ,
"price" : "1.00000000" ,
"origQty" : "10.00000000" ,
"executedQty" : "10.00000000" ,
"cummulativeQuoteQty" : "10.00000000" ,
"status" : "FILLED" ,
"timeInForce" : "GTC" ,
"type" : "MARKET" ,
"isIsolated" : true ,
// if isolated margin
"side" : "SELL"
BUY
SELL
}
price
DECIMAL
NO
stopPrice
DECIMAL
NO
Used with
STOP_LOSS
STOP_LOSS_LIMIT
TAKE_PROFIT
Response FULL:
,
,
and
,
{
TAKE_PROFIT_LIMIT
"symbol" : "BTCUSDT" ,
"orderId" : 28 ,
"clientOrderId" : "6gCrw2kRUAF9CvJDGP16IP"
"transactTime" : 1507725176595 ,
"price" : "1.00000000" ,
"origQty" : "10.00000000" ,
"executedQty" : "10.00000000" ,
"cummulativeQuoteQty" : "10.00000000" ,
"status" : "FILLED" ,
"timeInForce" : "GTC" ,
"type" : "MARKET" ,
"side" : "SELL" ,
"marginBuyBorrowAmount" : 5 ,
// will
"marginBuyBorrowAsset" : "BTC" ,
// will
"isIsolated" : true ,
// if isolated
"fills" : [
{
"price" : "4000.00000000" ,
"qty" : "1.00000000" ,
"commission" : "4.00000000" ,
"commissionAsset" : "USDT"
},
{
"price" : "3999.00000000" ,
"qty" : "5.00000000" ,
"commission" : "19.99500000" ,
"commissionAsset" : "USDT"
},
{
"price" : "3998.00000000" ,
"qty" : "2.00000000" ,
"commission" : "7.99600000" ,
"commissionAsset" : "USDT"
},
{
"price" : "3997.00000000" ,
"qty" : "1.00000000" ,
"commission" : "3.99700000" ,
"commissionAsset" : "USDT"
},
{
"price" : "3995.00000000" ,
"qty" : "1.00000000" ,
"commission" : "3.99500000" ,
"commissionAsset" : "USDT"
}
]
orders.
newClientOrderId
STRING
NO
A unique id among
open orders.
Automatically
generated if not sent.
icebergQty
DECIMAL
NO
Used with
LIMIT
,
STOP_LOSS_LIMIT
,
and
TAKE_PROFIT_LIMIT to
create an iceberg
order.
newOrderRespType
ENUM
NO
Set the response
JSON. ACK, RESULT, or
FULL; MARKET and
LIMIT order types
default to FULL, all
other orders default
to ACK.
sideEffectType
ENUM
NO
NO_SIDE_EFFECT,
MARGIN_BUY,
AUTO_REPAY; default
NO_SIDE_EFFECT.
timeInForce
ENUM
NO
GTC,IOC,FOK
recvWindow
LONG
NO
The value cannot be
greater than 60000
timestamp
LONG
YES
,
not return if no margin trade
not return if no margin trade
margin
happens
happens
}
Margin Account Cancel Order (TRADE)
DELETE /sapi/v1/margin/order
Cancel an active order
(HMAC SHA256)
Response:
margin account.
for
{
Weight(IP): 10
"symbol" : "LTCBTC" ,
"isIsolated" : true ,
// if isolated margin
"orderId" : 28 ,
"origClientOrderId" : "myOrder1" ,
"clientOrderId" : "cancelMyOrder1" ,
"price" : "1.00000000" ,
"origQty" : "10.00000000" ,
"executedQty" : "8.00000000" ,
"cummulativeQuoteQty" : "8.00000000" ,
"status" : "CANCELED" ,
"timeInForce" : "GTC" ,
"type" : "LIMIT" ,
"side" : "SELL"
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
isIsolated
STRING
NO
Description
isolated margin or
not, "TRUE", "FALSE",
default "FALSE"
for
}
orderId
LONG
NO
origClientOrderId
STRING
NO
newClientOrderId
STRING
NO
Used
recvWindow
LONG
NO
The value cannot be
greater than 60000
timestamp
LONG
YES
uniquely identify
this cancel. Automatically
generated by default.
to
Either orderId or origClientOrderId must be sent.
Margin Account Cancel
(TRADE)
Open Orders on
all
DELETE /sapi/v1/margin/openOrders
(HMAC SHA256)
Cancels all active orders on
This includes OCO orders.
for
symbol
a
Symbol
a
Response:
margin account.
[
{
Weight(IP):
"symbol" : "BTCUSDT" ,
"isIsolated" : true ,
// if isolated margin
"origClientOrderId" : "E6APeyTJvkMvLMYMqu1KQ4" ,
"orderId" : 11 ,
"orderListId" : - 1 ,
"clientOrderId" : "pXLV6Hz6mprAcVYpVMTGgx" ,
"price" : "0.089853" ,
"origQty" : "0.178622" ,
"executedQty" : "0.000000" ,
"cummulativeQuoteQty" : "0.000000" ,
"status" : "CANCELED" ,
"timeInForce" : "GTC" ,
"type" : "LIMIT" ,
"side" : "BUY"
1
Parameters
Name
Type
Mandatory
symbol
STRING
YES
isIsolated
STRING
NO
for
recvWindow
LONG
NO
The value cannot be greater
than 60000
timestamp
LONG
Description
isolated margin or not,
"TRUE", "FALSE",default
"FALSE"
},
{
"symbol" : "BTCUSDT" ,
"isIsolated" : false ,
// if isolated margin
"origClientOrderId" : "A3EF2HCwxgZPFMrfwbgrhv" ,
"orderId" : 13 ,
"orderListId" : - 1 ,
"clientOrderId" : "pXLV6Hz6mprAcVYpVMTGgx" ,
"price" : "0.090430" ,
"origQty" : "0.178622" ,
"executedQty" : "0.000000" ,
"cummulativeQuoteQty" : "0.000000" ,
"status" : "CANCELED" ,
"timeInForce" : "GTC" ,
"type" : "LIMIT" ,
"side" : "BUY"
YES
},
{
"orderListId" : 1929 ,
"contingencyType" : "OCO" ,
"listStatusType" : "ALL_DONE" ,
"listOrderStatus" : "ALL_DONE" ,
"listClientOrderId" : "2inzWQdDvZLHbbAmAozX2N" ,
"transactionTime" : 1585230948299 ,
"symbol" : "BTCUSDT" ,
"isIsolated" : true ,
// if isolated margin
"orders" : [
{
"symbol" : "BTCUSDT" ,
"orderId" : 20 ,
"clientOrderId" : "CwOOIPHSmYywx6jZX77TdL"
},
{
"symbol" : "BTCUSDT" ,
"orderId" : 21 ,
"clientOrderId" : "461cPg51vQjV3zIMOXNz39"
}
],
"orderReports" : [
{
"symbol" : "BTCUSDT" ,
"origClientOrderId" : "CwOOIPHSmYywx6jZX77TdL" ,
"orderId" : 20 ,
"orderListId" : 1929 ,
"clientOrderId" : "pXLV6Hz6mprAcVYpVMTGgx" ,
"price" : "0.668611" ,
"origQty" : "0.690354" ,
"executedQty" : "0.000000" ,
"cummulativeQuoteQty" : "0.000000" ,
"status" : "CANCELED" ,
"timeInForce" : "GTC" ,
"type" : "STOP_LOSS_LIMIT" ,
"side" : "BUY" ,
"stopPrice" : "0.378131" ,
"icebergQty" : "0.017083"
},
{
"symbol" : "BTCUSDT" ,
"origClientOrderId" : "461cPg51vQjV3zIMOXNz39" ,
"orderId" : 21 ,
"orderListId" : 1929 ,
"clientOrderId" : "pXLV6Hz6mprAcVYpVMTGgx" ,
"price" : "0.008791" ,
"origQty" : "0.690354" ,
"executedQty" : "0.000000" ,
"cummulativeQuoteQty" : "0.000000" ,
"status" : "CANCELED" ,
"timeInForce" : "GTC" ,
"type" : "LIMIT_MAKER" ,
"side" : "BUY" ,
"icebergQty" : "0.639962"
}
]
}
]
Get Cross Margin Transfer History (USER_DATA)
GET /sapi/v1/margin/transfer (HMAC SHA256)
Weight(IP):
Response:
1
{
Parameters:
Name
Type
Mandatory
asset
STRING
NO
type
STRING
NO
startTime
LONG
NO
endTime
LONG
NO
current
LONG
NO
Currently querying page. Start
from 1. Default:1
size
LONG
NO
Default:10 Max:100
archived
STRING
NO
Default: false Set
archived data from
ago
"rows" : [
{
"amount" : "0.10000000" ,
"asset" : "BNB" ,
"status" : "CONFIRMED" ,
"timestamp" : 1566898617 ,
"txId" : 5240372201 ,
"type" : "ROLL_IN"
},
{
"amount" : "5.00000000" ,
"asset" : "USDT" ,
"status" : "CONFIRMED" ,
"timestamp" : 1566888436 ,
"txId" : 5239810406 ,
"type" : "ROLL_OUT"
},
{
"amount" : "1.00000000" ,
"asset" : "EOS" ,
"status" : "CONFIRMED" ,
"timestamp" : 1566888403 ,
"txId" : 5239808703 ,
"type" : "ROLL_IN"
}
],
"total" : 3
Description
Transfer Type: ROLL_IN,
ROLL_OUT
to true for
.
recvWindow
LONG
NO
timestamp
LONG
YES
months
6
The value cannot be greater
than 60000
Response in descending order
Returns data for last 7 days by default
Set archived to true to query data from
}
months ago
6
Query Loan Record (USER_DATA)
GET /sapi/v1/margin/loan (HMAC SHA256)
Response:
Weight(IP): 10
{
Parameters:
Name
Type
Mandatory
asset
STRING
YES
isolatedSymbol
STRING
NO
isolated symbol
txId
LONG
NO
the tranId in POST
/sapi/v1/margin/loan
"rows" : [
{
"isolatedSymbol" : "BNBUSDT" , // isolated symbol, will not be returned
"txId" : 12807067523 ,
"asset" : "BNB" ,
"principal" : "0.84624403" ,
"timestamp" : 1555056425000 ,
"status" : "CONFIRMED"
//one of PENDING (pending execution), CONFIRMED
}
],
"total" : 1
Description
}
startTime
LONG
NO
endTime
LONG
NO
current
LONG
NO
Currently querying page.
Start from 1. Default:1
size
LONG
NO
Default:10 Max:100
archived
STRING
NO
Default: false Set to
for archived data from
months ago
true
.
recvWindow
LONG
NO
timestamp
LONG
YES
6
The value cannot be greater
than 60000
txId or startTime must be sent. txId takes precedence.
Response in descending order
If isolatedSymbol is not sent, crossed margin data will be returned
Set archived to true to query data from 6 months ago
Query Repay Record (USER_DATA)
GET /sapi/v1/margin/repay
(HMAC SHA256)
Response:
Weight(IP): 10
{
Parameters:
"rows" : [
{
Name
Type
Mandatory
asset
STRING
YES
isolatedSymbol
STRING
NO
isolated symbol
txId
LONG
NO
return of
/sapi/v1/margin/repay
"isolatedSymbol" : "BNBUSDT" , // isolated symbol, will not be
"amount" : "14.00000000" ,
//Total amount repaid
"asset" : "BNB" ,
"interest" : "0.01866667" ,
//Interest repaid
"principal" : "13.98133333" ,
//Principal repaid
"status" : "CONFIRMED" ,
//one of PENDING (pending execution),
"timestamp" : 1563438204000 ,
"txId" : 2970933056
Description
}
],
"total" : 1
}
startTime
LONG
NO
endTime
LONG
NO
current
LONG
NO
Currently querying page.
Start from 1. Default:1
size
LONG
NO
Default:10 Max:100
archived
STRING
NO
Default: false Set to
for archived data from
months ago
true
.
recvWindow
LONG
NO
timestamp
LONG
YES
6
The value cannot be greater
than 60000
txId or startTime must be sent. txId takes precedence.
Response in descending order
If isolatedSymbol is not sent, crossed margin data will be returned
Set archived to true to query data from 6 months ago
Get Interest History (USER_DATA)
GET /sapi/v1/margin/interestHistory (HMAC SHA256)
Weight(IP):
Response:
1
{
Parameters:
"rows" :[
{
"isolatedSymbol" : "BNBUSDT" , // isolated symbol, will not be
"asset" : "BNB" ,
"interest" : "0.02414667" ,
"interestAccuredTime" : 1566813600000 ,
"interestRate" : "0.01600000" ,
"principal" : "36.22000000" ,
"type" : "ON_BORROW"
Name
Type
Mandatory
Description
asset
STRING
NO
isolatedSymbol
STRING
NO
startTime
LONG
NO
endTime
LONG
NO
current
LONG
NO
Currently querying page.
Start from 1. Default:1
size
LONG
NO
Default:10 Max:100
archived
STRING
NO
Default: false Set to
for archived data from
months ago
isolated symbol
returned
}
],
"total" : 1
}
true
.
recvWindow
LONG
NO
timestamp
LONG
YES
6
The value cannot be greater
than 60000
Response in descending order
If isolatedSymbol is not sent, crossed margin data will be returned
Set archived to true to query data from 6 months ago
type in response has 4 enums:
PERIODIC interest charged per hour
ON_BORROW first interest charged on borrow
PERIODIC_CONVERTED interest charged per hour converted into BNB
ON_BORROW_CONVERTED first interest charged on borrow converted
into BNB
Get Force Liquidation Record (USER_DATA)
GET /sapi/v1/margin/forceLiquidationRec (HMAC SHA256)
Weight(IP):
Response:
1
{
Parameters:
"rows" : [
{
"avgPrice" : "0.00388359" ,
"executedQty" : "31.39000000" ,
"orderId" : 180015097 ,
"price" : "0.00388110" ,
"qty" : "31.39000000" ,
"side" : "SELL" ,
"symbol" : "BNBBTC" ,
"timeInForce" : "GTC" ,
"isIsolated" : true ,
"updatedTime" : 1558941374745
}
],
"total" : 1
Name
Type
Mandatory
startTime
LONG
NO
endTime
LONG
NO
isolatedSymbol
STRING
NO
current
LONG
NO
Currently querying page.
Start from 1. Default:1
size
LONG
NO
Default:10 Max:100
recvWindow
LONG
NO
The value cannot be greater
than 60000
timestamp
LONG
YES
Response
Description
}
descending order
in
Query Cross Margin Account Details (USER_DATA)
GET /sapi/v1/margin/account (HMAC SHA256)
Response:
Weight(IP): 10
{
Parameters:
Name
Type
Mandatory
Description
recvWindow
LONG
NO
The value cannot be greater
than 60000
timestamp
LONG
YES
"borrowEnabled" : true ,
"marginLevel" : "11.64405625" ,
"totalAssetOfBtc" : "6.82728457" ,
"totalLiabilityOfBtc" : "0.58633215" ,
"totalNetAssetOfBtc" : "6.24095242" ,
"tradeEnabled" : true ,
"transferEnabled" : true ,
"userAssets" : [
{
"asset" : "BTC" ,
"borrowed" : "0.00000000" ,
"free" : "0.00499500" ,
"interest" : "0.00000000" ,
"locked" : "0.00000000" ,
"netAsset" : "0.00499500"
},
{
"asset" : "BNB" ,
"borrowed" : "201.66666672" ,
"free" : "2346.50000000" ,
"interest" : "0.00000000" ,
"locked" : "0.00000000" ,
"netAsset" : "2144.83333328"
},
{
"asset" : "ETH" ,
"borrowed" : "0.00000000" ,
"free" : "0.00000000" ,
"interest" : "0.00000000" ,
"locked" : "0.00000000" ,
"netAsset" : "0.00000000"
},
{
"asset" : "USDT" ,
"borrowed" : "0.00000000" ,
"free" : "0.00000000" ,
"interest" : "0.00000000" ,
"locked" : "0.00000000" ,
"netAsset" : "0.00000000"
}
]
}
Query Margin Account's Order (USER_DATA)
GET /sapi/v1/margin/order
(HMAC SHA256)
Response:
Weight(IP): 10
{
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
isIsolated
STRING
NO
orderId
LONG
NO
origClientOrderId
STRING
NO
recvWindow
LONG
NO
timestamp
LONG
YES
"clientOrderId" : "ZwfQzuDIGpceVhKW5DvCmO" ,
"cummulativeQuoteQty" : "0.00000000" ,
"executedQty" : "0.00000000" ,
"icebergQty" : "0.00000000" ,
"isWorking" : true ,
"orderId" : 213205622 ,
"origQty" : "0.30000000" ,
"price" : "0.00493630" ,
"side" : "SELL" ,
"status" : "NEW" ,
"stopPrice" : "0.00000000" ,
"symbol" : "BNBBTC" ,
"isIsolated" : true ,
"time" : 1562133008725 ,
"timeInForce" : "GTC" ,
"type" : "LIMIT" ,
"updateTime" : 1562133008725
Description
isolated margin or
not, "TRUE", "FALSE",
default "FALSE"
for
The value cannot be
greater than 60000
Either orderId or origClientOrderId must be sent.
For some historical orders cummulativeQuoteQty
the data is not available at this time.
be <
will
}
meaning
0,
Query Margin Account's Open Orders (USER_DATA)
GET /sapi/v1/margin/openOrders
(HMAC SHA256)
Response:
Weight(IP): 10
[
Parameters:
{
Name
Type
Mandatory
symbol
STRING
NO
isIsolated
STRING
NO
for
recvWindow
LONG
NO
The value cannot be greater
than 60000
timestamp
LONG
YES
"clientOrderId" : "qhcZw71gAkCCTv0t0k8LUK" ,
"cummulativeQuoteQty" : "0.00000000" ,
"executedQty" : "0.00000000" ,
"icebergQty" : "0.00000000" ,
"isWorking" : true ,
"orderId" : 211842552 ,
"origQty" : "0.30000000" ,
"price" : "0.00475010" ,
"side" : "SELL" ,
"status" : "NEW" ,
"stopPrice" : "0.00000000" ,
"symbol" : "BNBBTC" ,
"isIsolated" : true ,
"time" : 1562040170089 ,
"timeInForce" : "GTC" ,
"type" : "LIMIT" ,
"updateTime" : 1562040170089
Description
isolated margin or not,
"TRUE", "FALSE",default
"FALSE"
}
the symbol is not sent, orders for all symbols will be returned in an
array.
When all symbols are returned, the number of requests counted against
the rate limiter is equal to the number of symbols currently trading on
the exchange.
If isIsolated ="TRUE", symbol must be sent.
If
]
Query Margin Account's All Orders (USER_DATA)
GET /sapi/v1/margin/allOrders (HMAC SHA256)
Response:
Weight(IP): 200
[
Request Limit
60times/min per
{
"clientOrderId" : "D2KDy4DIeS56PvkM13f8cP" ,
"cummulativeQuoteQty" : "0.00000000" ,
"executedQty" : "0.00000000" ,
"icebergQty" : "0.00000000" ,
"isWorking" : false ,
"orderId" : 41295 ,
"origQty" : "5.31000000" ,
"price" : "0.22500000" ,
"side" : "SELL" ,
"status" : "CANCELED" ,
"stopPrice" : "0.18000000" ,
"symbol" : "BNBBTC" ,
"isIsolated" : false ,
"time" : 1565769338806 ,
"timeInForce" : "GTC" ,
"type" : "TAKE_PROFIT_LIMIT" ,
"updateTime" : 1565769342148
IP
Parameters:
Name
Type
Mandatory
Description
symbol
STRING
YES
isIsolated
STRING
NO
orderId
LONG
NO
startTime
LONG
NO
endTime
LONG
NO
limit
INT
NO
Default 500; max 500.
recvWindow
LONG
NO
The value cannot be greater
than 60000
timestamp
LONG
YES
isolated margin or not,
"TRUE", "FALSE",default
"FALSE"
for
},
{
"clientOrderId" : "gXYtqhcEAs2Rn9SUD9nRKx" ,
"cummulativeQuoteQty" : "0.00000000" ,
"executedQty" : "0.00000000" ,
"icebergQty" : "1.00000000" ,
"isWorking" : true ,
"orderId" : 41296 ,
"origQty" : "6.65000000" ,
"price" : "0.18000000" ,
"side" : "SELL" ,
"status" : "CANCELED" ,
"stopPrice" : "0.00000000" ,
"symbol" : "BNBBTC" ,
"isIsolated" : false ,
"time" : 1565769348687 ,
"timeInForce" : "GTC" ,
"type" : "LIMIT" ,
"updateTime" : 1565769352226
orderId is set, it will get orders >= that orderId. Otherwise most recent
orders are returned.
For some historical orders cummulativeQuoteQty will be < 0, meaning
the data is not available at this time.
If
},
{
"clientOrderId" : "duDq1BqohhcMmdMs9FSuDy" ,
"cummulativeQuoteQty" : "0.39450000" ,
"executedQty" : "2.63000000" ,
"icebergQty" : "0.00000000" ,
"isWorking" : true ,
"orderId" : 41297 ,
"origQty" : "2.63000000" ,
"price" : "0.00000000" ,
"side" : "SELL" ,
"status" : "FILLED" ,
"stopPrice" : "0.00000000" ,
"symbol" : "BNBBTC" ,
"isIsolated" : false ,
"time" : 1565769358139 ,
"timeInForce" : "GTC" ,
"type" : "MARKET" ,
"updateTime" : 1565769358139
}
]
Margin Account New OCO (TRADE)
POST /sapi/v1/margin/order/oco
Send
new OCO
in a
(HMAC SHA256)
Response:
margin account
for a
{
Weight(Uid)
Parameters
"orderListId" : 0 ,
"contingencyType" : "OCO" ,
"listStatusType" : "EXEC_STARTED" ,
"listOrderStatus" : "EXECUTING" ,
"listClientOrderId" : "JYVpp3F0f5CAG15DhtrqLp" ,
"transactionTime" : 1563417480525 ,
"symbol" : "LTCBTC" ,
"marginBuyBorrowAmount" : "5" ,
// will not return if no margin trade
"marginBuyBorrowAsset" : "BTC" ,
// will not return if no margin trade
"isIsolated" : false ,
// if isolated margin
"orders" : [
{
"symbol" : "LTCBTC" ,
"orderId" : 2 ,
"clientOrderId" : "Kk7sqHb9J6mJWTMDVW7Vos"
},
{
"symbol" : "LTCBTC" ,
"orderId" : 3 ,
"clientOrderId" : "xTXKaGYd4bluPVp78IVRvl"
}
],
"orderReports" : [
{
"symbol" : "LTCBTC" ,
"orderId" : 2 ,
"orderListId" : 0 ,
"clientOrderId" : "Kk7sqHb9J6mJWTMDVW7Vos" ,
"transactTime" : 1563417480525 ,
"price" : "0.000000" ,
"origQty" : "0.624363" ,
"executedQty" : "0.000000" ,
"cummulativeQuoteQty" : "0.000000" ,
"status" : "NEW" ,
"timeInForce" : "GTC" ,
"type" : "STOP_LOSS" ,
"side" : "BUY" ,
"stopPrice" : "0.960664"
},
{
"symbol" : "LTCBTC" ,
"orderId" : 3 ,
"orderListId" : 0 ,
"clientOrderId" : "xTXKaGYd4bluPVp78IVRvl" ,
"transactTime" : 1563417480525 ,
"price" : "0.036435" ,
"origQty" : "0.624363" ,
"executedQty" : "0.000000" ,
"cummulativeQuoteQty" : "0.000000" ,
"status" : "NEW" ,
"timeInForce" : "GTC" ,
"type" : "LIMIT_MAKER" ,
"side" : "BUY"
}
]
6
:
:
Name
Type
Mandatory
symbol
STRING
YES
Description
happens
isIsolated
STRING
NO
for
isolated margin or
not, "TRUE",
"FALSE",default
"FALSE"
listClientOrderId
STRING
NO
A unique Id for the
entire orderList
side
ENUM
YES
quantity
DECIMAL
YES
limitClientOrderId
STRING
NO
price
DECIMAL
YES
limitIcebergQty
DECIMAL
NO
stopClientOrderId
STRING
NO
stopPrice
DECIMAL
YES
stopLimitPrice
DECIMAL
NO
A unique Id
limit order
the
for
A unique Id for the
stop loss/stop loss
limit leg
provided,
If
stopLimitTimeInForce
required.
is
stopIcebergQty
DECIMAL
NO
stopLimitTimeInForce
ENUM
NO
Valid values are
GTC
FOK
/
IOC
/
newOrderRespType
ENUM
NO
Set the response
JSON.
sideEffectType
ENUM
NO
NO_SIDE_EFFECT,
MARGIN_BUY,
AUTO_REPAY; default
NO_SIDE_EFFECT.
recvWindow
LONG
NO
The value cannot be
greater than 60000
timestamp
LONG
YES
}
Other Info:
Price Restrictions:
SELL Limit Price > Last Price > Stop Price
BUY Limit Price < Last Price < Stop Price
Quantity Restrictions:
Both legs must have the same quantity
ICEBERG quantities however do not have to be the same.
Order Rate Limit
OCO counts as 2 orders against the order rate limit.
:
:
Margin Account Cancel OCO (TRADE)
DELETE /sapi/v1/margin/orderList (HMAC SHA256)
Cancel an entire Order
Response:
margin account.
List for a
{
Weight(Uid)
"orderListId" : 0 ,
"contingencyType" : "OCO" ,
"listStatusType" : "ALL_DONE" ,
"listOrderStatus" : "ALL_DONE" ,
"listClientOrderId" : "C3wyj4WVEktd7u9aVBRXcN" ,
"transactionTime" : 1574040868128 ,
"symbol" : "LTCBTC" ,
"isIsolated" : false ,
// if isolated margin
"orders" : [
{
"symbol" : "LTCBTC" ,
"orderId" : 2 ,
"clientOrderId" : "pO9ufTiFGg3nw2fOdgeOXa"
},
{
"symbol" : "LTCBTC" ,
"orderId" : 3 ,
"clientOrderId" : "TXOvglzXuaubXAaENpaRCB"
}
],
"orderReports" : [
{
"symbol" : "LTCBTC" ,
"origClientOrderId" : "pO9ufTiFGg3nw2fOdgeOXa" ,
"orderId" : 2 ,
"orderListId" : 0 ,
"clientOrderId" : "unfWT8ig8i0uj6lPuYLez6" ,
"price" : "1.00000000" ,
"origQty" : "10.00000000" ,
"executedQty" : "0.00000000" ,
"cummulativeQuoteQty" : "0.00000000" ,
"status" : "CANCELED" ,
"timeInForce" : "GTC" ,
"type" : "STOP_LOSS_LIMIT" ,
"side" : "SELL" ,
"stopPrice" : "1.00000000"
},
{
"symbol" : "LTCBTC" ,
"origClientOrderId" : "TXOvglzXuaubXAaENpaRCB" ,
"orderId" : 3 ,
"orderListId" : 0 ,
"clientOrderId" : "unfWT8ig8i0uj6lPuYLez6" ,
"price" : "3.00000000" ,
"origQty" : "10.00000000" ,
"executedQty" : "0.00000000" ,
"cummulativeQuoteQty" : "0.00000000" ,
"status" : "CANCELED" ,
"timeInForce" : "GTC" ,
"type" : "LIMIT_MAKER" ,
"side" : "SELL"
}
]
1
:
Parameters:
Name
Type
Mandatory
Description
symbol
STRING
YES
isIsolated
STRING
NO
for
orderListId
LONG
NO
Either
isolated margin or
not, "TRUE", "FALSE",
default "FALSE"
or
must
orderListId
listClientOrderId
be provided
listClientOrderId
STRING
NO
Either
or
must
orderListId
listClientOrderId
be provided
newClientOrderId
STRING
NO
Used
uniquely identify
this cancel. Automatically
generated by default
recvWindow
LONG
NO
The value cannot be
greater than 60000
timestamp
LONG
YES
to
Additional notes:
Canceling an individual leg
cancel the entire OCO
will
}
Query Margin Account's OCO (USER_DATA)
GET /sapi/v1/margin/orderList (HMAC SHA256)
Retrieves
Response:
specific OCO based on provided optional parameters
a
{
Weight(IP) 10
"orderListId" : 27 ,
"contingencyType" : "OCO" ,
"listStatusType" : "EXEC_STARTED" ,
"listOrderStatus" : "EXECUTING" ,
"listClientOrderId" : "h2USkA5YQpaXHPIrkd96xE" ,
"transactionTime" : 1565245656253 ,
"symbol" : "LTCBTC" ,
"isIsolated" : false ,
// if isolated margin
"orders" : [
{
"symbol" : "LTCBTC" ,
"orderId" : 4 ,
"clientOrderId" : "qD1gy3kc3Gx0rihm9Y3xwS"
},
{
"symbol" : "LTCBTC" ,
"orderId" : 5 ,
"clientOrderId" : "ARzZ9I00CPM8i3NhmU9Ega"
}
]
:
Parameters
:
Name
Type
Mandatory
Description
isIsolated
STRING
NO
for
symbol
STRING
NO
mandatory for isolated
margin, not supported
cross margin
orderListId
LONG
isolated margin or
not, "TRUE", "FALSE",
default "FALSE"
NO
Either
for
or
must
orderListId
origClientOrderId
be provided
origClientOrderId
STRING
NO
Either
}
or
must
orderListId
origClientOrderId
be provided
recvWindow
LONG
NO
The value cannot be
greater than 60000
timestamp
LONG
YES
Query Margin Account's
all
GET /sapi/v1/margin/allOrderList
(HMAC SHA256)
Retrieves all OCO
parameters
OCO (USER_DATA)
Response:
specific margin account based on provided optional
for a
[
{
"orderListId" : 29 ,
"contingencyType" : "OCO" ,
"listStatusType" : "EXEC_STARTED" ,
"listOrderStatus" : "EXECUTING" ,
"listClientOrderId" : "amEEAXryFzFwYF1FeRpUoZ" ,
"transactionTime" : 1565245913483 ,
"symbol" : "LTCBTC" ,
"isIsolated" : true ,
// if isolated margin
"orders" : [
{
"symbol" : "LTCBTC" ,
"orderId" : 4 ,
"clientOrderId" : "oD7aesZqjEGlZrbtRpy5zB"
},
{
"symbol" : "LTCBTC" ,
"orderId" : 5 ,
"clientOrderId" : "Jr1h6xirOxgeJOUuYQS7V3"
}
]
Weight(IP) 200
:
Parameters
Name
Type
Mandatory
Description
isIsolated
STRING
NO
for
symbol
STRING
NO
mandatory for isolated margin,
not supported for cross margin
fromId
LONG
NO
startTime
LONG
NO
endTime
LONG
NO
limit
INT
NO
Default Value: 500; Max Value:
1000
recvWindow
LONG
NO
The value cannot be greater
than 60000
timestamp
LONG
YES
isolated margin or not,
"TRUE", "FALSE",default
"FALSE"
supplied, neither startTime
or endTime can be provided
If
},
{
"orderListId" : 28 ,
"contingencyType" : "OCO" ,
"listStatusType" : "EXEC_STARTED" ,
"listOrderStatus" : "EXECUTING" ,
"listClientOrderId" : "hG7hFNxJV6cZy3Ze4AUT4d" ,
"transactionTime" : 1565245913407 ,
"symbol" : "LTCBTC" ,
"orders" : [
{
"symbol" : "LTCBTC" ,
"orderId" : 2 ,
"clientOrderId" : "j6lFOfbmFMRjTYA7rRJ0LP"
},
{
"symbol" : "LTCBTC" ,
"orderId" : 3 ,
"clientOrderId" : "z0KCjOdditiLS5ekAFtK81"
}
]
}
]
Query Margin Account's Open OCO (USER_DATA)
GET /sapi/v1/margin/openOrderList (HMAC SHA256)
Response:
Weight(IP) 10
:
[
Parameters
{
Name
Type
Mandatory
Description
isIsolated
STRING
NO
for
symbol
STRING
NO
mandatory for isolated margin,
not supported for cross margin
recvWindow
LONG
NO
The value cannot be greater
than 60000
timestamp
LONG
YES
"orderListId" : 31 ,
"contingencyType" : "OCO" ,
"listStatusType" : "EXEC_STARTED" ,
"listOrderStatus" : "EXECUTING" ,
"listClientOrderId" : "wuB13fmulKj3YjdqWEcsnp" ,
"transactionTime" : 1565246080644 ,
"symbol" : "LTCBTC" ,
"isIsolated" : false ,
// if isolated margin
"orders" : [
{
"symbol" : "LTCBTC" ,
"orderId" : 4 ,
"clientOrderId" : "r3EH2N76dHfLoSZWIUw1bT"
},
{
"symbol" : "LTCBTC" ,
"orderId" : 5 ,
"clientOrderId" : "Cv1SnyPD3qhqpbjpYEHbd2"
}
]
isolated margin or not,
"TRUE", "FALSE",default
"FALSE"
}
]
Query Margin Account's Trade
(USER_DATA)
List
GET /sapi/v1/margin/myTrades (HMAC SHA256)
Response:
Weight(IP): 10
[
Parameters:
{
Name
Type
Mandatory
symbol
STRING
YES
isIsolated
STRING
NO
startTime
LONG
NO
"commission" : "0.00006000" ,
"commissionAsset" : "BTC" ,
"id" : 34 ,
"isBestMatch" : true ,
"isBuyer" : false ,
"isMaker" : false ,
"orderId" : 39324 ,
"price" : "0.02000000" ,
"qty" : "3.00000000" ,
"symbol" : "BNBBTC" ,
"isIsolated" : false ,
"time" : 1561973357171
Description
isolated margin or not,
"TRUE", "FALSE",default
"FALSE"
for
}
]
endTime
LONG
NO
fromId
LONG
NO
TradeId to fetch from. Default
gets most recent trades.
limit
INT
NO
Default 500; max 1000.
recvWindow
LONG
NO
The value cannot be greater
than 60000
timestamp
LONG
YES
fromId is set, it will get trades >= that fromId. Otherwise most recent
trades are returned.
If
Query Max Borrow (USER_DATA)
GET /sapi/v1/margin/maxBorrowable (HMAC SHA256)
Response:
Weight(IP): 50
{
Parameters:
"amount" : "1.69248805" , // account's currently max borrowable amount with
"borrowLimit" : "60" // max borrowable amount limited by the account level
}
Name
Type
Mandatory
Description
asset
STRING
YES
isolatedSymbol
STRING
NO
isolated symbol
recvWindow
LONG
NO
The value cannot be greater
than 60000
timestamp
LONG
YES
isolatedSymbol is not sent, crossed margin data will be sent.
borrowLimit is also available from https://www.binance.com/en/marginfee
If
Query Max Transfer-Out Amount (USER_DATA)
GET /sapi/v1/margin/maxTransferable (HMAC SHA256)
Response:
Weight(IP): 50
{
Parameters:
"amount" : "3.59498107"
}
Name
Type
Mandatory
asset
STRING
YES
isolatedSymbol
STRING
NO
isolated symbol
recvWindow
LONG
NO
The value cannot be greater
than 60000
timestamp
LONG
YES
isolatedSymbol
If
Description
not sent, crossed margin data
is
be sent.
will
Isolated Margin Account Transfer (MARGIN)
POST /sapi/v1/margin/isolated/transfer
(HMAC SHA256)
Response:
Weight(Uid): 600
{
Parameters:
//transaction id
"tranId" : 100000001
}
Name
Type
Mandatory
Description
asset
STRING
YES
asset,such as BTC
symbol
STRING
YES
transFrom
STRING
YES
"SPOT", "ISOLATED_MARGIN"
transTo
STRING
YES
"SPOT", "ISOLATED_MARGIN"
amount
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
No more than 60000
Get Isolated Margin Transfer History (USER_DATA)
GET /sapi/v1/margin/isolated/transfer (HMAC SHA256)
Weight(IP):
Response:
1
{
Parameters:
Name
Type
Mandatory
asset
STRING
NO
symbol
STRING
YES
transFrom
STRING
NO
"SPOT", "ISOLATED_MARGIN"
transTo
STRING
NO
"SPOT", "ISOLATED_MARGIN"
startTime
LONG
NO
endTime
LONG
NO
current
LONG
NO
Current page, default
size
LONG
NO
Default 10, max 100
recvWindow
LONG
NO
No more than 60000
timestamp
LONG
YES
"rows" : [
{
"amount" : "0.10000000" ,
"asset" : "BNB" ,
"status" : "CONFIRMED" ,
"timestamp" : 1566898617000 ,
"txId" : 5240372201 ,
"transFrom" : "SPOT" ,
"transTo" : "ISOLATED_MARGIN"
},
{
"amount" : "5.00000000" ,
"asset" : "USDT" ,
"status" : "CONFIRMED" ,
"timestamp" : 1566888436123 ,
"txId" : 5239810406 ,
"transFrom" : "ISOLATED_MARGIN" ,
"transTo" : "SPOT"
}
],
"total" : 2
Description
1
}
Query Isolated Margin Account Info (USER_DATA)
GET /sapi/v1/margin/isolated/account (HMAC SHA256)
Response:
Weight(IP): 10
"symbols"
If
is
not sent
Parameters:
{
Name
Type
Mandatory
Description
symbols
STRING
NO
Max 5 symbols can be sent;
separated by ",". e.g.
"BTCUSDT,BNBUSDT,ADAUSDT"
recvWindow
LONG
NO
No more than 60000
timestamp
LONG
YES
"symbols"
If "symbols"
returned.
not sent, all isolated assets will be returned.
sent, only the isolated assets of the sent symbols
is
If
is
"assets" :[
{
"baseAsset" :
{
"asset" : "BTC" ,
"borrowEnabled" : true ,
"borrowed" : "0.00000000" ,
"free" : "0.00000000" ,
"interest" : "0.00000000" ,
"locked" : "0.00000000" ,
"netAsset" : "0.00000000" ,
"netAssetOfBtc" : "0.00000000" ,
"repayEnabled" : true ,
"totalAsset" : "0.00000000"
},
"quoteAsset" :
{
"asset" : "USDT" ,
"borrowEnabled" : true ,
"borrowed" : "0.00000000" ,
"free" : "0.00000000" ,
"interest" : "0.00000000" ,
"locked" : "0.00000000" ,
"netAsset" : "0.00000000" ,
"netAssetOfBtc" : "0.00000000" ,
"repayEnabled" : true ,
"totalAsset" : "0.00000000"
},
"symbol" : "BTCUSDT" ,
"isolatedCreated" : true ,
"enabled" : true , // true-enabled, false-disabled
"marginLevel" : "0.00000000" ,
"marginLevelStatus" : "EXCESSIVE" , // "EXCESSIVE", "NORMAL", "MARGIN_CALL",
"marginRatio" : "0.00000000" ,
"indexPrice" : "10000.00000000" ,
"liquidatePrice" : "1000.00000000" ,
"liquidateRate" : "1.00000000" ,
"tradeEnabled" : true
}
],
"totalAssetOfBtc" : "0.00000000" ,
"totalLiabilityOfBtc" : "0.00000000" ,
"totalNetAssetOfBtc" : "0.00000000"
be
will
}
"symbols"
If
is
sent
{
"assets" :[
{
"baseAsset" :
{
"asset" : "BTC" ,
"borrowEnabled" : true ,
"borrowed" : "0.00000000" ,
"free" : "0.00000000" ,
"interest" : "0.00000000" ,
"locked" : "0.00000000" ,
"netAsset" : "0.00000000" ,
"netAssetOfBtc" : "0.00000000" ,
"repayEnabled" : true ,
"totalAsset" : "0.00000000"
},
"quoteAsset" :
{
"asset" : "USDT" ,
"borrowEnabled" : true ,
"borrowed" : "0.00000000" ,
"free" : "0.00000000" ,
"interest" : "0.00000000" ,
"locked" : "0.00000000" ,
"netAsset" : "0.00000000" ,
"netAssetOfBtc" : "0.00000000" ,
"repayEnabled" : true ,
"totalAsset" : "0.00000000"
},
"symbol" : "BTCUSDT" ,
"isolatedCreated" : true ,
"enabled" : true , // true-enabled, false-disabled
"marginLevel" : "0.00000000" ,
"marginLevelStatus" : "EXCESSIVE" , // "EXCESSIVE", "NORMAL", "MARGIN_CALL",
"marginRatio" : "0.00000000" ,
"indexPrice" : "10000.00000000" ,
"liquidatePrice" : "1000.00000000" ,
"liquidateRate" : "1.00000000" ,
"tradeEnabled" : true
}
]
}
Disable Isolated Margin Account (TRADE)
DELETE /sapi/v1/margin/isolated/account (HMAC SHA256)
Response:
Disable isolated margin account for a specific symbol. Each trading pair can
only be deactivated once every 24 hours.
{
"success" : true ,
"symbol" : "BTCUSDT"
Weight(Uid): 300
}
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Description
No more than 60000
Enable Isolated Margin Account (TRADE)
POST /sapi/v1/margin/isolated/account (HMAC SHA256)
Enable isolated margin account
Response:
specific symbol.
for a
{
Weight(Uid): 300
"success" : true ,
"symbol" : "BTCUSDT"
}
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Description
No more than 60000
Query Enabled Isolated Margin Account Limit
(USER_DATA)
GET /sapi/v1/margin/isolated/accountLimit
Query enabled isolated margin account
(HMAC SHA256)
Response:
limit.
{
Weight(IP):
"enabledAccount" : 5 ,
"maxAccount" : 20
1
}
Parameters:
Name
Type
Mandatory
Description
recvWindow
LONG
NO
No more than 60000
timestamp
LONG
YES
Query Isolated Margin Symbol (USER_DATA)
GET /sapi/v1/margin/isolated/pair (HMAC SHA256)
Response:
Weight(IP): 10
{
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
"symbol" : "BTCUSDT" ,
"base" : "BTC" ,
"quote" : "USDT" ,
"isMarginTrade" : true ,
"isBuyAllowed" : true ,
"isSellAllowed" : true
Description
}
recvWindow
LONG
NO
No more than 60000
timestamp
LONG
YES
Get All Isolated Margin Symbol(USER_DATA)
GET /sapi/v1/margin/isolated/allPairs (HMAC SHA256)
Response:
Weight(IP): 10
[
Parameters:
{
Name
Type
Mandatory
Description
recvWindow
LONG
NO
No more than 60000
timestamp
LONG
YES
"base" : "BNB" ,
"isBuyAllowed" : true ,
"isMarginTrade" : true ,
"isSellAllowed" : true ,
"quote" : "BTC" ,
"symbol" : "BNBBTC"
},
{
"base" : "TRX" ,
"isBuyAllowed" : true ,
"isMarginTrade" : true ,
"isSellAllowed" : true ,
"quote" : "BTC" ,
"symbol" : "TRXBTC"
}
]
Toggle BNB Burn On Spot Trade And Margin
Interest (USER_DATA)
POST /sapi/v1/bnbBurn
Weight(IP):
(HMAC SHA256)
Response:
1
{
Parameters:
"spotBNBBurn" : true ,
"interestBNBBurn" : false
}
Name
Type
Mandatory
Description
spotBNBBurn
STRING
NO
"true" or "false";
Determines whether to use
BNB to pay for trading
fees on SPOT
interestBNBBurn
STRING
NO
"true" or "false";
Determines whether to use
BNB to pay for margin
loan's interest
recvWindow
LONG
NO
No more than 60000
timestamp
LONG
YES
"spotBNBBurn" and "interestBNBBurn" should be sent
least one.
at
Get BNB Burn Status (USER_DATA)
GET /sapi/v1/bnbBurn (HMAC SHA256)
Weight(IP):
Response:
1
{
Parameters:
"spotBNBBurn" : true ,
"interestBNBBurn" : false
}
Name
Type
Mandatory
Description
recvWindow
LONG
NO
No more than 60000
timestamp
LONG
YES
Query Margin Interest Rate History (USER_DATA)
GET /sapi/v1/margin/interestRateHistory (HMAC SHA256)
Weight(IP):
Response:
1
[
Parameters:
{
"asset" : "BTC" ,
"dailyInterestRate" : "0.00025000" ,
"timestamp" : 1611544731000 ,
"vipLevel" : 1
Name
Type
Mandatory
Description
asset
STRING
YES
vipLevel
INT
NO
Default: user's vip level
startTime
LONG
NO
Default:
},
{
"asset" : "BTC" ,
"dailyInterestRate" : "0.00035000" ,
"timestamp" : 1610248118000 ,
"vipLevel" : 1
days ago
7
}
endTime
LONG
NO
Default: present. Maximum
range: 3 months.
limit
INT
NO
Default: 20. Maximum: 100
recvWindow
LONG
NO
No more than 60000
timestamp
LONG
YES
]
User Data Streams
The base API endpoint is: https://api.binance.com
A User Data Stream listenKey is valid for 60 minutes after creation.
Doing a PUT on a listenKey will extend its validity for 60 minutes.
Doing a DELETE on a listenKey will close the stream and invalidate the
listenKey
.
Doing a POST on an account with an active listenKey will return the
currently active listenKey and extend its validity for 60 minutes.
The base websocket endpoint is: wss://stream.binance.com:9443
User Data Streams are accessed at /ws/ or /stream?
streams=
A single connection to stream.binance.com is only valid for 24 hours;
expect to be disconnected at the 24 hour mark
LISTEN KEY (SPOT)
Create
ListenKey (USER_STREAM)
a
POST /api/v3/userDataStream
Response:
Start a new user data stream. The stream will close after 60 minutes unless
keepalive is sent. If the account has an active listenKey that listenKey
will be returned and its validity will be extended for 60 minutes.
a
{
,
"listenKey" : "pqia91ma19a5s61cv6a81va65sdf19v8a65a1a5s61cv6a81va65sdf19v8a65a1"
}
Weight:
1
Parameters:
NONE
Data Source: Memory
Ping/Keep-alive
ListenKey (USER_STREAM)
a
PUT /api/v3/userDataStream
Response:
Keepalive a user data stream to prevent a time out. User data streams will
close after 60 minutes. It's recommended to send a ping about every 30
minutes.
Weight:
{}
1
Parameters:
Name
Type
Mandatory
listenKey
STRING
YES
Description
Data Source: Memory
Close
ListenKey (USER_STREAM)
a
DELETE /api/v3/userDataStream
Close out
Response:
user data stream.
a
{}
Weight:
1
Parameters:
Name
Type
Mandatory
listenKey
STRING
YES
Description
Data Source: Memory
LISTEN KEY (MARGIN)
Create
ListenKey (USER_STREAM)
a
POST /sapi/v1/userDataStream
Weight:
Response:
1
{ "listenKey" :
"T3ee22BIYuWqmvne0HNq2A2WsFlEtLhvWCtItw6ffhhdmjifQ2tRbuKkTHhr"
Parameters:
NONE
Ping/Keep-alive
ListenKey (USER_STREAM)
a
PUT /sapi/v1/userDataStream
Weight:
Response:
1
{}
Parameters:
Name
Type
Mandatory
listenKey
STRING
YES
Close
Description
ListenKey (USER_STREAM)
a
DELETE /sapi/v1/userDataStream
Weight:
Response:
1
{}
Parameters:
Name
Type
Mandatory
listenKey
STRING
YES
Description
LISTEN KEY (ISOLATED MARGIN)
Generate
Listen Key (USER_STREAM)
a
POST /sapi/v1/userDataStream/isolated
Weight:
Response:
1
{
Parameters:
"listenKey":
"T3ee22BIYuWqmvne0HNq2A2WsFlEtLhvWCtItw6ffhhdmjifQ2tRbuKkTHhr"
}
Name
Type
Mandatory
symbol
STRING
YES
Ping/Keep-alive
Description
Listen Key (USER_STREAM)
a
PUT /sapi/v1/userDataStream/isolated
Weight:
Response:
1
{}
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
listenKey
STRING
YES
Close
Description
ListenKey (USER_STREAM)
a
DELETE /sapi/v1/userDataStream/isolated
Weight:
Response:
1
{}
Parameters:
Name
Type
Mandatory
symbol
STRING
YES
listenKey
STRING
YES
Description
Payload: Account Update
sent any time an account balance has changed
and contains the assets that were possibly changed by the event that
generated the balance change.
outboundAccountPosition is
Payload:
{
"e" :
"E" :
"u" :
"B" :
{
"outboundAccountPosition" , //Event type
1564034571105 ,
//Event Time
1564034571073 ,
//Time of last account update
[
//Balances Array
"a" : "ETH" ,
"f" : "10000.000000" ,
"l" : "0.000000"
//Asset
//Free
//Locked
}
]
}
Payload: Balance Update
Balance Update occurs during the following:
Deposits or withdrawals from the account
Transfer of funds between accounts (e.g. Spot
Margin)
to
Payload
{
"e"
"E"
"a"
"d"
"T"
:
:
:
:
:
"balanceUpdate" ,
1573200697110 ,
"BTC" ,
"100.00000000" ,
1573200697068
//Event Type
//Event Time
//Asset
//Balance Delta
//Clear Time
}
Payload: Order Update
Orders are updated with the
event.
executionReport
Check the Public API Definitions and below
Average price can be found by doing
relevant enum definitions.
for
divided by
Z
z
.
Execution types:
Payload:
NEW - The order has been accepted into the engine.
CANCELED - The order has been canceled by the user.
REPLACED (currently unused)
REJECTED - The order has been rejected and was not processed. (This is
never pushed into the User Data Stream)
TRADE - Part of the order or all of the order's quantity has filled.
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)
the order is an OCO, an event will be displayed named
addition to the executionReport event.
{
"e"
"E"
"s"
"c"
"S"
"o"
"f"
"q"
"p"
"P"
"F"
"g"
"C"
"x"
"X"
"r"
"i"
"l"
"z"
"L"
"n"
"N"
"T"
"t"
"I"
"w"
"m"
"M"
"O"
"Z"
"Y"
"Q"
ListStatus in
If
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
"executionReport" ,
// Event type
1499405658658 ,
// Event time
"ETHBTC" ,
// Symbol
"mUvoqJxFIILMdfAW5iGSOW" , // Client order ID
"BUY" ,
// Side
"LIMIT" ,
// Order type
"GTC" ,
// Time in force
"1.00000000" ,
// Order quantity
"0.10264410" ,
// Order price
"0.00000000" ,
// Stop price
"0.00000000" ,
// Iceberg quantity
-1 ,
// OrderListId
"" ,
// Original client order ID; This is the ID
"NEW" ,
// Current execution type
"NEW" ,
// Current order status
"NONE" ,
// Order reject reason; will be an error
4293153 ,
// Order ID
"0.00000000" ,
// Last executed quantity
"0.00000000" ,
// Cumulative filled quantity
"0.00000000" ,
// Last executed price
"0" ,
// Commission amount
null ,
// Commission asset
1499405658657 ,
// Transaction time
-1 ,
// Trade ID
8641984 ,
// Ignore
true ,
// Is the order on the book?
false ,
// Is this trade the maker side?
false ,
// Ignore
1499405658657 ,
// Order creation time
"0.00000000" ,
// Cumulative quote asset transacted quantity
"0.00000000" ,
// Last quote asset transacted quantity (i.e.
"0.00000000"
// Quote Order Qty
code.
}
Payload
{
"e" :
"E" :
"s" :
"g" :
"c" :
"l" :
"L" :
"r" :
"C" :
"T" :
"O" :
{
"listStatus" ,
1564035303637 ,
"ETHBTC" ,
2,
"OCO" ,
"EXEC_STARTED" ,
"EXECUTING" ,
"NONE" ,
"F4QN4G8DlFATFlIUQ0cjdD" ,
1564035303625 ,
[
//Event Type
//Event Time
//Symbol
//OrderListId
//Contingency Type
//List Status Type
//List Order Status
//List Reject Reason
//List Client Order ID
//Transaction Time
//An array of objects
"s" : "ETHBTC" ,
//Symbol
"i" : 17 ,
// orderId
"c" : "AJYsMjErWJesZvqlJCTUgL" //ClientOrderId
},
{
"s" : "ETHBTC" ,
"i" : 18 ,
"c" : "bfYPSQdLoqAJeNrOr9adzq"
}
]
}
Savings Endpoints
The endpoints below allow you to interact with Binance Savings,
previously known as Binance Lending.
For more information on this, please refer to the Binance Savings page
Get Flexible Product
(USER_DATA)
List
GET /sapi/v1/lending/daily/product/list (HMAC SHA256)
Weight(IP):
Response:
1
[
Parameters:
{
Name
Type
Mandatory
Description
status
ENUM
NO
"ALL", "SUBSCRIBABLE",
"UNSUBSCRIBABLE"; Default:
"ALL"
featured
STRING
NO
"ALL", "TRUE"; Default: "ALL"
current
LONG
NO
Current query page. Default:
Min: 1
size
LONG
NO
Default: 50, Max: 100
recvWindow
LONG
NO
The value cannot be greater
than 60000
timestamp
LONG
YES
"asset" : "BTC" ,
"avgAnnualInterestRate" : "0.00250025" ,
"canPurchase" : true ,
"canRedeem" : true ,
"dailyInterestPerThousand" : "0.00685000" ,
"featured" : true ,
"minPurchaseAmount" : "0.01000000" ,
"productId" : "BTC001" ,
"purchasedAmount" : "16.32467016" ,
"status" : "PURCHASING" ,
"upLimit" : "200.00000000" ,
"upLimitPerUser" : "5.00000000"
1,
},
{
"asset" : "BUSD" ,
"avgAnnualInterestRate" : "0.01228590" ,
"canPurchase" : true ,
"canRedeem" : true ,
"dailyInterestPerThousand" : "0.03836000" ,
"featured" : true ,
"minPurchaseAmount" : "0.10000000" ,
"productId" : "BUSD001" ,
"purchasedAmount" : "10.38932339" ,
"status" : "PURCHASING" ,
"upLimit" : "100000.00000000" ,
"upLimitPerUser" : "50000.00000000"
}
]
Get Left Daily Purchase Quota of Flexible Product
(USER_DATA)
GET /sapi/v1/lending/daily/userLeftQuota
Weight(IP):
(HMAC SHA256)
Response:
1
{
Parameters:
"asset" : "BUSD" ,
"leftQuota" : "50000.00000000"
Name
Type
Mandatory
productId
STRING
YES
recvWindow
LONG
NO
timestamp
LONG
YES
}
Description
The value cannot be greater
than 60000
Purchase Flexible Product (USER_DATA)
POST /sapi/v1/lending/daily/purchase
Weight(IP):
(HMAC SHA256)
Response:
1
{
Parameters:
"purchaseId" : 40607
}
Name
Type
Mandatory
productId
STRING
YES
amount
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Description
The value cannot be greater
than 60000
Get Left Daily Redemption Quota of Flexible
Product (USER_DATA)
GET /sapi/v1/lending/daily/userRedemptionQuota
Weight(IP):
(HMAC SHA256)
Response:
1
{
Parameters:
Name
Type
Mandatory
"asset" : "USDT" ,
"dailyQuota" : "10000000.00000000" ,
"leftQuota" : "0.00000000" ,
"minRedemptionAmount" : "0.10000000"
Description
}
productId
STRING
YES
type
ENUM
YES
"FAST", "NORMAL"
recvWindow
LONG
NO
The value cannot be greater
than 60000
timestamp
LONG
YES
Redeem Flexible Product (USER_DATA)
POST /sapi/v1/lending/daily/redeem (HMAC SHA256)
Weight(IP):
Response:
1
{}
Parameters:
Name
Type
Mandatory
Description
productId
STRING
YES
amount
DECIMAL
YES
type
ENUM
YES
"FAST", "NORMAL"
recvWindow
LONG
NO
The value cannot be greater
than 60000
timestamp
LONG
YES
Get Flexible Product Position (USER_DATA)
GET /sapi/v1/lending/daily/token/position
Weight(IP):
(HMAC SHA256)
Response:
1
[
Parameters:
{
Name
Type
Mandatory
asset
STRING
YES
recvWindow
LONG
NO
timestamp
LONG
YES
"annualInterestRate" : "0.02600000" ,
"asset" : "USDT" ,
"avgAnnualInterestRate" : "0.02599895" ,
"canRedeem" : true ,
"dailyInterestRate" : "0.00007123" ,
"freeAmount" : "75.46000000" ,
"freezeAmount" : "0.00000000" , // abandoned
"lockedAmount" : "0.00000000" , // abandoned
"productId" : "USDT001" ,
"productName" : "USDT" ,
"redeemingAmount" : "0.00000000" ,
"todayPurchasedAmount" : "0.00000000" ,
"totalAmount" : "75.46000000" ,
"totalInterest" : "0.22759183"
Description
The value cannot be greater
than 60000
}
]
Get Fixed and Activity Project List(USER_DATA)
GET /sapi/v1/lending/project/list (HMAC SHA256)
Weight(IP):
Response:
1
[
Parameters:
{
Name
Type
Mandatory
asset
STRING
NO
type
ENUM
YES
"ACTIVITY",
"CUSTOMIZED_FIXED"
status
ENUM
NO
"ALL", "SUBSCRIBABLE",
"UNSUBSCRIBABLE"; default
"ALL"
isSortAsc
BOOLEAN
NO
default "true"
"asset" : "USDT" ,
"displayPriority" : 1 ,
"duration" : 90 ,
"interestPerLot" : "1.35810000" ,
"interestRate" : "0.05510000" ,
"lotSize" : "100.00000000" ,
"lotsLowLimit" : 1 ,
"lotsPurchased" : 74155 ,
"lotsUpLimit" : 80000 ,
"maxLotsPerUser" : 2000 ,
"needKyc" : false ,
"projectId" : "CUSDT90DAYSS001" ,
"projectName" : "USDT" ,
"status" : "PURCHASING" ,
"type" : "CUSTOMIZED_FIXED" ,
"withAreaLimitation" : false
Description
}
sortBy
ENUM
NO
"START_TIME", "LOT_SIZE",
"INTEREST_RATE",
"DURATION"; default
"START_TIME"
current
LONG
NO
Currently querying page.
Start from 1. Default:1
size
LONG
NO
Default:10, Max:100
recvWindow
LONG
NO
The value cannot be greater
than 60000
timestamp
LONG
YES
]
Purchase Fixed/Activity Project (USER_DATA)
POST /sapi/v1/lending/customizedFixed/purchase
Weight(IP):
(HMAC SHA256)
Response:
1
{
Parameters:
"purchaseId" : "18356"
}
Name
Type
Mandatory
projectId
STRING
YES
lot
LONG
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Description
The value cannot be greater
than 60000
Get Fixed/Activity Project Position (USER_DATA)
GET /sapi/v1/lending/project/position/list
Weight(IP):
(HMAC SHA256)
Response:
1
[
Parameters:
{
Name
Type
Mandatory
asset
STRING
YES
projectId
STRING
NO
status
ENUM
NO
"HOLDING", "REDEEMED"
recvWindow
LONG
NO
The value cannot be greater
than 60000
timestamp
LONG
YES
"asset" : "USDT" ,
"canTransfer" : true ,
"createTimestamp" : 1587010770000 ,
"duration" : 14 ,
"endTime" : 1588291200000 ,
"interest" : "0.19950000" ,
"interestRate" : "0.05201250" ,
"lot" : 1 ,
"positionId" : 51724 ,
"principal" : "100.00000000" ,
"projectId" : "CUSDT14DAYSS001" ,
"projectName" : "USDT" ,
"purchaseTime" : 1587010771000 ,
"redeemDate" : "2020-05-01" ,
"startTime" : 1587081600000 ,
"status" : "HOLDING" ,
"type" : "CUSTOMIZED_FIXED"
Description
}
]
Lending Account (USER_DATA)
GET /sapi/v1/lending/union/account
Weight(IP):
(HMAC SHA256)
Response:
1
{
Parameters:
Name
Type
Mandatory
Description
recvWindow
LONG
NO
The value cannot be greater
than 60000
timestamp
LONG
YES
"positionAmountVos" : [
{
"amount" : "75.46000000" ,
"amountInBTC" : "0.01044819" ,
"amountInUSDT" : "75.46000000" ,
"asset" : "USDT"
},
{
"amount" : "1.67072036" ,
"amountInBTC" : "0.00023163" ,
"amountInUSDT" : "1.67289230" ,
"asset" : "BUSD"
}
],
"totalAmountInBTC" : "0.01067982" ,
"totalAmountInUSDT" : "77.13289230" ,
"totalFixedAmountInBTC" : "0.00000000" ,
"totalFixedAmountInUSDT" : "0.00000000" ,
"totalFlexibleInBTC" : "0.01067982" ,
"totalFlexibleInUSDT" : "77.13289230"
}
Get Purchase Record (USER_DATA)
GET /sapi/v1/lending/union/purchaseRecord
Weight(IP):
(HMAC SHA256)
Response:
1
Flexible Products
Parameters:
[
Name
Type
Mandatory
lendingType
ENUM
YES
asset
STRING
NO
Description
{
"amount" : "100.00000000" ,
"asset" : "USDT" ,
"createTime" : 1575018510000 ,
"lendingType" : "DAILY" ,
"productName" : "USDT" ,
"purchaseId" : 26055 ,
"status" : "SUCCESS"
"DAILY" for flexible, "ACTIVITY"
for activity,
"CUSTOMIZED_FIXED" for fixed
}
startTime
LONG
NO
endTime
LONG
NO
current
LONG
NO
]
Fixed/Activity Products
Currently querying page. Start
from 1. Default:1
[
{
size
LONG
NO
Default:10, Max:100
recvWindow
LONG
NO
The value cannot be greater
than 60000
timestamp
LONG
YES
"amount" : "100.00000000" ,
"asset" : "USDT" ,
"createTime" : 1575018453000 ,
"lendingType" : "ACTIVITY" ,
"lot" : 1 ,
"productName" : "【Special】USDT 7D (8%)" ,
"purchaseId" : 36857 ,
"status" : "SUCCESS"
}
The time between
days.
If startTime and
will be returned.
and
startTime
cannot be longer than 30
endTime
are both not sent, then the
endTime
]
30 days' data
last
Get Redemption Record (USER_DATA)
GET /sapi/v1/lending/union/redemptionRecord
Weight(IP):
(HMAC SHA256)
Response:
1
Flexible Products
Parameters:
[
Name
Type
Mandatory
lendingType
ENUM
YES
asset
STRING
NO
startTime
LONG
NO
endTime
LONG
NO
current
LONG
NO
Description
{
"amount" : "10.54000000" ,
"asset" : "USDT" ,
"createTime" : 1577257222000 ,
"principal" : "10.54000000" ,
"projectId" : "USDT001" ,
"projectName" : "USDT" ,
"status" : "PAID" ,
"type" : "FAST"
"DAILY" for flexible, "ACTIVITY"
for activity,
"CUSTOMIZED_FIXED" for fixed
}
]
Fixed/Activity Products
Currently querying page. Start
from 1. Default:1
[
{
size
LONG
NO
Default:10, Max:100
recvWindow
LONG
NO
The value cannot be greater
than 60000
timestamp
LONG
YES
The time between
days.
If startTime and
will be returned.
and
startTime
"amount" : "0.07070000" ,
"asset" : "USDT" ,
"createTime" : 1566200161000 ,
"interest" : "0.00070000" ,
"principal" : "0.07000000" ,
"projectId" : "test06" ,
"projectName" : "USDT 1 day (10% anniualized)" ,
"startTime" : 1566198000000 ,
"status" : "PAID"
cannot be longer than 30
endTime
}
]
are both not sent, then the
endTime
30 days' data
last
Get Interest History (USER_DATA)
GET /sapi/v1/lending/union/interestHistory
Weight(IP):
(HMAC SHA256)
Response:
1
[
Parameters:
{
Name
Type
Mandatory
Description
lendingType
ENUM
YES
"DAILY" for flexible, "ACTIVITY"
for activity,
"CUSTOMIZED_FIXED" for fixed
asset
STRING
NO
startTime
LONG
NO
"asset" : "BUSD" ,
"interest" : "0.00006408" ,
"lendingType" : "DAILY" ,
"productName" : "BUSD" ,
"time" : 1577233578000
},
{
"asset" : "USDT" ,
"interest" : "0.00687654" ,
"lendingType" : "DAILY" ,
"productName" : "USDT" ,
"time" : 1577233562000
}
]
endTime
LONG
NO
current
LONG
NO
Currently querying page. Start
from 1. Default:1
size
LONG
NO
Default:10, Max:100
recvWindow
LONG
NO
The value cannot be greater
than 60000
timestamp
LONG
YES
The time between
days.
If startTime and
will be returned.
and
startTime
cannot be longer than 30
endTime
are both not sent, then the
endTime
30 days' data
last
Change Fixed/Activity Position to Daily
Position(USER_DATA)
POST /sapi/v1/lending/positionChanged (HMAC SHA256)
Weight(IP):
Response:
1
Parameters:
{
"dailyPurchaseId" : 862290 ,
"success" : true ,
"time" : 1577233578000
Name
Type
Mandatory
projectId
STRING
YES
lot
LONG
YES
positionId
LONG
NO
for
recvWindow
LONG
NO
no more than
timestamp
LONG
YES
PositionId
}
mandatory parameter
is
Description
fixed position
60000
fixed position.
for
Mining Endpoints
The endpoints below allow to interact with Binance Pool.
For more information on this, please refer to the Binance Pool page
Acquiring Algorithm (USER_DATA)
GET /sapi/v1/mining/pub/algoList
Weight(IP):
(HMAC SHA256)
Response:
1
{
Parameter:
Name
Type
Mandatory
recvWindow
LONG
NO
timestamp
LONG
YES
"code" : 0 ,
"msg" : "" ,
"data" : [
{
"algoName" : "sha256" ,
"algoId" : 1 ,
"poolIndex" : 0 ,
"unit" : "h/s"
}
]
Description
// Algorithm name
// Algorithm ID
// Sequence
//
Unit
}
Acquiring CoinName (USER_DATA)
GET /sapi/v1/mining/pub/coinList
Weight(IP):
(HMAC SHA256)
1
Parameter:
Name
Type
Mandatory
recvWindow
LONG
NO
timestamp
LONG
YES
Description
Response:
{
"code" : 0 ,
"msg" : "" ,
"data" : [
{
"coinName" : "BTC" ,
"coinId" : 1 ,
"poolIndex" : 0 ,
"algoId" : 1 ,
"algoName" : "sha256"
}
]
// Currencyname
// id
// Sort
// Algorithm
//Name of algorithm
}
Request for Detail Miner
(USER_DATA)
List
GET /sapi/v1/mining/worker/detail (HMAC SHA256)
Weight(IP):
Response:
5
{
Parameter:
Name
Type
Mandatory
Description
For Example
algo
STRING
YES
Algorithm(sha256)
sha256
userName
STRING
YES
Mining account
test
workerName
STRING
YES
Miner’s
name(required)
bhdc1.16A10404B
recvWindow
LONG
NO
timestamp
LONG
YES
"code" : 0 ,
"msg" : "" ,
"data" : [
{
"workerName" : "bhdc1.16A10404B" ,
"type" : "H_hashrate" ,
"hashrateDatas" : [
{
"time" : 1587902400000 ,
"hashrate" : "0" ,
"reject" : 0
},
{
"time" : 1587906000000 ,
"hashrate" : "0" ,
"reject" : 0
}
]
},
{
"workerName" : "bhdc1.16A10404B" ,
"type" : "D_hashrate" ,
"hashrateDatas" : [
{
"time" : 1587902400000 ,
"hashrate" : "0" ,
"reject" : 0
},
{
"time" : 1587906000000 ,
"hashrate" : "0" ,
"reject" : 0
}
]
}
]
//Mining Account name
// Type of hourly hashrate
// Time
// Hashrate
//Rejection Rate
//Mining Account name
//Type of daily hashrate
// Time
// Hashrate
//Rejection Rate
}
Request for Miner
(USER_DATA)
List
GET /sapi/v1/mining/worker/list
Weight(IP):
(HMAC SHA256)
Response:
5
{
Parameter:
Name
Type
Mandatory
Description
For Example
algo
STRING
YES
Algorithm(sha256)
sha256
userName
STRING
YES
Mining account
test
pageIndex
INTEGER
NO
Page number,
default is first page,
start form 1
sort
INTEGER
NO
sort
sequence(default=0)0
positive sequence,1
negative sequence
sortColumn
INTEGER
NO
Sort by( default 1):
1: miner name,
2: real-time
computing power,
3: daily average
computing power,
4: real-time rejection
rate,
5: last submission
time
workerStatus
INTEGER
NO
recvWindow
LONG
NO
timestamp
LONG
YES
"code" : 0 ,
"msg" : "" ,
"data" : {
"workerDatas" : [
{
"workerId" : "1420554439452400131" , //Miner ID
"workerName" : "2X73" ,
//Miner's name
"status" : 3 ,
// Status:1 valid, 2 invalid,
"hashRate" : 0 ,
// Real-time rate
"dayHashRate" : 0 ,
//24H Hashrate
"rejectRate" : 0 ,
//Real-time Rejection Rate
"lastShareTime" : 1587712919000
// Last submission time
},
{
"workerId" : "7893926126382807951" ,
"workerName" : "AZDC1.1A10101" ,
"status" : 2 ,
"hashRate" : 29711247541680 ,
"dayHashRate" : 12697781298013.66 ,
"rejectRate" : 0 ,
"lastShareTime" : 1587969727000
}
],
"totalNum" : 18530 ,
// Total amount
"pageSize" : 20
// Rows per page
}
3
}
miners
status(default=0)0
all,1 valid,2
invalid,3failure
Earnings List(USER_DATA)
GET /sapi/v1/mining/payment/list
Weight(IP):
(HMAC SHA256)
Response:
5
{
Parameter:
Name
Type
Mandatory
Description
Example
algo
STRING
YES
Transfer
algorithm(sha256)
sha256
userName
STRING
YES
Mining account
test
coin
STRING
NO
Coin name
startDate
Long
NO
Search date,
millisecond
timestamp, while
empty query all
endDate
Long
NO
Search date,
millisecond
timestamp, while
empty query all
pageIndex
INTEGER
NO
Page number,
empty default
first page, starting
from 1
pageSize
INTEGER
NO
Number of pages,
minimum 10,
maximum 200
recvWindow
LONG
NO
timestamp
LONG
YES
Extra Bonus
"code" : 0 ,
"msg" : "" ,
"data" : {
"accountProfits" : [
{
"time" : 1586188800000 ,
// Mining date
"type" : 31 , // 0:Mining Wallet,5:Mining Address,7:Pool Savings,8:Transferred,31:Income
"hashTransfer" : null ,
// Transferred Hashrate
"transferAmount" : null ,
// Transferred Income
"dayHashRate" : 129129903378244 , // Daily Hashrate
"profitAmount" : 8.6083060304 ,
//Earnings Amount
"coinName" : "BTC" ,
// Coin Type
"status" : 2
//Status:0:Unpaid, 1:Paying 2:Paid
},
{
"time" : 1607529600000 ,
"coinName" : "BTC" ,
"type" : 0 ,
"dayHashRate" : 9942053925926 ,
"profitAmount" : 0.85426469 ,
"hashTransfer" : 200000000000 ,
"transferAmount" : 0.02180958 ,
"status" : 2
},
{
"time" : 1607443200000 ,
"coinName" : "BTC" ,
"type" : 31 ,
"dayHashRate" : 200000000000 ,
"profitAmount" : 0.02905916 ,
"hashTransfer" : null ,
"transferAmount" : null ,
"status" : 2
}
],
"totalNum" : 3 ,
// Total Rows
"pageSize" : 20
// Rows per page
}
}
(USER_DATA)
List
GET /sapi/v1/mining/payment/other (HMAC SHA256)
Weight(IP):
Response:
5
{
Parameter:
Name
Type
Mandatory
Description
Example
algo
STRING
YES
Transfer
algorithm(sha256)
sha256
userName
STRING
YES
Mining Account
test
coin
STRING
NO
Coin Name
startDate
Long
NO
Search date,
millisecond
timestamp, while
empty query all
}
endDate
Long
NO
Search date,
millisecond
timestamp, while
empty query all
pageIndex
INTEGER
NO
Page number,
empty default
first page, starting
from 1
pageSize
INTEGER
NO
Number of pages,
minimum 10,
maximum 200
recvWindow
LONG
NO
timestamp
LONG
YES
Hashrate Resale
"code" : 0 ,
"msg" : "" ,
"data" : {
"otherProfits" : [
{
"time" : 1607443200000 ,
// Mining date
"coinName" : "BTC" ,
// Coin Name
"type" : 4 ,
// 1: Merged Mining, 2: Activity Bonus, 3:Rebate
"profitAmount" : 0.0011859 , //Amount
"status" : 2
//Status:0:Unpaid, 1:Paying 2:Paid
}
],
"totalNum" : 3 ,
// Total Rows
"pageSize" : 20
// Rows per page
}
(USER_DATA)
List
GET /sapi/v1/mining/hash-transfer/config/details/list (HMAC SHA256)
Weight(IP):
Response:
5
{
Parameter:
Name
Type
Mandatory
Description
pageIndex
INTEGER
NO
Page number,
empty default
first page,
starting from 1
pageSize
INTEGER
NO
Number of
pages, minimum
10, maximum 200
recvWindow
LONG
NO
timestamp
LONG
YES
"code" : 0 ,
"msg" : "" ,
"data" : {
"configDetails" : [
{
"configId" : 168 ,
// Mining ID
"poolUsername" : "123" , //Transfer out of subaccount
"toPoolUsername" : "user1" , // Transfer into subaccount
"algoName" : "Ethash" ,
// Transfer algorithm
"hashRate" : 5000000 ,
// Transferred Hashrate quantity
"startDay" : 20201210 ,
// Start date
"endDay" : 20210405 ,
//End date
"status" : 1
//Status:0 Processing,1:Cancelled,2:Terminated
},
{
"configId" : 166 ,
"poolUsername" : "pop" ,
"toPoolUsername" : "111111" ,
"algoName" : "Ethash" ,
"hashRate" : 3320000 ,
"startDay" : 20201226 ,
"endDay" : 20201227 ,
"status" : 0
}
],
"totalNum" : 21 ,
"pageSize" : 200
}
Example
}
Hashrate Resale Detail (USER_DATA)
GET /sapi/v1/mining/hash-transfer/profit/details (HMAC SHA256)
Weight(IP):
Response:
5
{
Parameter:
Name
Type
Mandatory
Description
Example
configId
INTEGER
YES
Mining ID
168
userName
STRING
YES
Mining Account
pageIndex
INTEGER
NO
Page number,
empty default
first page,
starting from 1
pageSize
INTEGER
NO
recvWindow
LONG
NO
timestamp
LONG
YES
"code" : 0 ,
"msg" : "" ,
"data" : {
"profitTransferDetails" : [{
"poolUsername" : "test4001" ,
// Transfer out of sub-account
"toPoolUsername" : "pop" ,
// Transfer into subaccount
"algoName" : "sha256" ,
// Transfer algorithm
"hashRate" : 200000000000 , // Transferred Hashrate quantity
"day" : 20201213 ,
// Transfer date
"amount" : 0.2256872 ,
// Transferred income
"coinName" : "BTC"
// Coin Name
test
},
{
"poolUsername" : "test4001" ,
"toPoolUsername" : "pop" ,
"algoName" : "sha256" ,
"hashRate" : 200000000000 ,
"day" : 20201213 ,
"amount" : 0.2256872 ,
"coinName" : "BTC"
Number of
pages, minimum
10, maximum 200
}
],
"totalNum" : 8 ,
"pageSize" : 200
}
}
Hashrate Resale Request (USER_DATA)
POST /sapi/v1/mining/hash-transfer/config
Weight(IP):
(HMAC SHA256)
Response:
5
{
Parameter:
"code" : 0 ,
"msg" : "" ,
"data" : 171
Name
Type
Mandatory
Description
Example
userName
STRING
YES
Mining Account
test
algo
STRING
YES
Transfer
algorithm(sha256)
sha256
endDate
Long
YES
Resale End Time
(Millisecond
timestamp)
1617659086000
startDate
Long
YES
Resale Start
Time(Millisecond
timestamp)
1607659086000
toPoolUser
STRING
YES
Mining Account
S19pro
hashRate
Long
YES
Resale hashrate
h/s must be
transferred (BTC
greater than
500000000000
ETH is greater
than 500000)
100000000
recvWindow
LONG
NO
timestamp
LONG
YES
// Mining Account
}
is
Cancel hashrate resale configuration(USER_DATA)
POST /sapi/v1/mining/hash-transfer/config/cancel
Weight(IP):
(HMAC SHA256)
Response:
5
{
Parameter:
Name
Type
Mandatory
Description
Example
configId
INTEGER
YES
Mining ID
168
userName
STRING
YES
Mining Account
test
recvWindow
LONG
NO
timestamp
LONG
YES
Statistic
}
(USER_DATA)
List
GET /sapi/v1/mining/statistics/user/status
Weight(IP):
"code" : 0 ,
"msg" : "" ,
"data" : true
(HMAC SHA256)
Response:
5
{
Parameter:
Name
Type
Mandatory
Description
For Example
algo
STRING
YES
Algorithm(sha256)
sha256
userName
STRING
YES
Mining account
test
recvWindow
LONG
NO
timestamp
LONG
YES
"code" : 0 ,
"msg" : "" ,
"data" : {
"fifteenMinHashRate" : "457835490067496409.00000000" ,
"dayHashRate" : "214289268068874127.65000000" ,
"validNum" : 0 ,
"invalidNum" : 17562 ,
"profitToday" :{
"BTC" : "0.00314332" ,
"BSV" : "56.17055953" ,
"BCH" : "106.61586001"
},
"profitYesterday" :{
"BTC" : "0.00314332" ,
"BSV" : "56.17055953" ,
"BCH" : "106.61586001"
},
"userName" : "test" ,
"unit" : "h/s" ,
"algo" : "sha256"
// 15 mins
// 24H
// Effective
// Invalid
// Today's
Hashrate
//
Yesterday's
// Mining account
// Hashrate unit
// Algorithm
}
}
Account
(USER_DATA)
List
GET /sapi/v1/mining/statistics/user/list
Weight(IP):
(HMAC SHA256)
Response:
5
{
Parameter:
Name
Type
Mandatory
Description
"code" : 0 ,
"msg" : "" ,
"data" : [
{
"type" : "H_hashrate" ,
"userName" : "test" ,
"list" : [
{
"time" : 1585267200000 ,
"hashrate" : "0.00000000"
"reject" : "0.00000000"
},
{
"time" : 1585353600000 ,
"hashrate" : "0.00000000"
"reject" : "0.00000000"
}
]
},
{
"type" : "D_hashrate" ,
"userName" : "test" ,
"list" : [
{
"time" : 1587906000000 ,
"hashrate" : "0.00000000"
"reject" : "0.00000000"
},
{
"time" : 1587909600000 ,
"hashrate" : "0.00000000"
"reject" : "0.00000000"
}
]
}
]
For Example
algo
STRING
YES
Algorithm(sha256)
sha256
userName
STRING
YES
Mining account
test
recvWindow
LONG
NO
timestamp
LONG
YES
//Type of hourly hashrate
// Mining account
// Time
, // Hashrate
//Rejection Rate
,
//Type of daily hashrate
// Mining account
// Time
, // Hashrate
//Rejection Rate
,
}
Futures
New Future Account Transfer (USER_DATA)
POST /sapi/v1/futures/transfer
(HMAC SHA256)
Response:
Execute transfer between spot account and futures account.
{
Weight(IP):
"tranId" : 100000001
1
//transaction id
}
Parameters:
Name
Type
Mandatory
Description
asset
STRING
YES
The asset being transferred,
e.g., USDT
amount
DECIMAL
YES
The amount
transferred
type
INT
YES
1:
recvWindow
LONG
NO
timestamp
LONG
YES
be
to
transfer from spot account
to USDT-Ⓜ futures account.
2: transfer from USDT-Ⓜ
futures account to spot
account.
3: transfer from spot account
to COIN-Ⓜ futures account.
4: transfer from COIN-Ⓜ
futures account to spot
account.
Get Future Account Transaction History
(USER_DATA)
List
GET /sapi/v1/futures/transfer (HMAC SHA256)
Response:
Weight(IP): 10
{
Parameters:
Name
Type
Mandatory
asset
STRING
YES
startTime
LONG
YES
endTime
LONG
NO
"rows" : [
{
"asset" : "USDT" ,
"tranId" : 100000001 ,
"amount" : "40.84624400" ,
"type" : "1" , // one of 1( from spot to USDT-Ⓜ), 2( from USDT-Ⓜ to
"timestamp" : 1555056425000 ,
"status" : "CONFIRMED" //one of PENDING (pending to execution), CONFIRMED
}
],
"total" : 1
Description
spot),
}
current
LONG
NO
Currently querying page. Start
from 1. Default:1
size
LONG
NO
Default:10 Max:100
recvWindow
LONG
NO
timestamp
LONG
YES
Borrow For Cross-Collateral (TRADE)
POST /sapi/v1/futures/loan/borrow
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
coin
STRING
YES
amount
DECIMAL
YES when
collateralAmount
empty
"coin" : "USDT" ,
"amount" : "4.50000000" ,
"collateralCoin" : "BUSD" ,
"collateralAmount" : "5.00000000" ,
"time" : 1582540328433 ,
"borrowId" : "438648398970089472"
Description
}
is
collateralCoin
STRING
YES
collateralAmount
DECIMAL
YES when amount
empty
recvWindow
LONG
NO
timestamp
LONG
YES
is
Weight(Uid): 3000
Rate Limit:
1/1s per account
Cross-Collateral Borrow History (USER_DATA)
GET /sapi/v1/futures/loan/borrow/history
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
coin
STRING
NO
startTime
LONG
NO
endTime
LONG
NO
limit
LONG
NO
recvWindow
LONG
NO
timestamp
LONG
YES
"rows" :[
{
Description
"confirmedTime" : 1582540328433 ,
"coin" : "USDT" ,
"collateralRate" : "0.89991001" , // collateralLevel
"leftTotal" : "4.5" ,
"leftPrincipal" : "4.5" ,
"deadline" : 4736102399000 ,
"collateralCoin" : "BUSD" ,
"collateralAmount" : "5.0" ,
"orderStatus" : "PENDING" ,
"borrowId" : "438648398970089472"
default 500, max 1000
}
],
"total" : 1
}
Weight(IP): 10
Repay For Cross-Collateral (TRADE)
POST /sapi/v1/futures/loan/repay
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
coin
STRING
YES
collateralCoin
STRING
YES
amount
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
"coin" : "USDT" ,
"amount" : "1.68" ,
"collateralCoin" : "BUSD" ,
"repayId" : "439659223998894080"
Description
}
Weight(Uid): 3000
Rate Limit:
1/1s per account
Cross-Collateral Repayment History (USER_DATA)
GET /sapi/v1/futures/loan/repay/history HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
coin
STRING
NO
startTime
LONG
NO
endTime
LONG
NO
limit
LONG
NO
recvWindow
LONG
NO
timestamp
LONG
"rows" :[
{
Description
"coin" : "USDT" ,
"amount" : "1.68" ,
"collateralCoin" : "BUSD" ,
"repayType" : "NORMAL" , // "COLLATERAL" for collateral repayment
"releasedCollateral" : "1.80288889" ,
"price" : "1.001" , // Loan/collateral exchange rate
"repayCollateral" : "10010" , // Only for collateral repayment
"confirmedTime" : 1582781327575 ,
"updateTime" : 1582794387516 , // time
"status" : "PENDING" ,
"repayId" : "439659223998894080"
default 500, max 1000
}
],
"total" : 1
YES
}
Weight(IP): 10
Cross-Collateral Wallet (USER_DATA)
GET /sapi/v1/futures/loan/wallet
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
recvWindow
LONG
NO
timestamp
LONG
YES
"totalCrossCollateral" : "5.8238577133" ,
"totalBorrowed" : "5.07000000" ,
"totalInterest" : "0.0" , // New for interest collection
"interestFreeLimit" : "100000" , // New for interest free limit
"asset" : "USDT" ,
"crossCollaterals" :[
{
"collateralCoin" : "BUSD" ,
"locked" : "5.82211108" ,
"loanAmount" : "5.07" ,
"currentCollateralRate" : "0.87168984" ,
// collateralLevel
"interestFreeLimitUsed" : "5.07" , // New for interest free limit
"principalForInterest" : "0.0" , // New for interest collection
"interest" : "0.0" // New for interest collection
},
{
"collateralCoin" : "BTC" ,
"locked" : "0" ,
"loanAmount" : "0" ,
"currentCollateralRate" : "0" ,
// collateralLevel
"interestFreeLimitUsed" : "0" , // New for interest free limit
"principalForInterest" : "0.0" , // New for interest collection
"interest" : "0.0" // New for interest collection
}
]
Description
Weight(IP): 10
}
Cross-Collateral Wallet V2 (USER_DATA)
GET /sapi/v2/futures/loan/wallet
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
recvWindow
LONG
NO
timestamp
LONG
YES
Weight(IP):
"totalCrossCollateral" : "5.8238577133" ,
"totalBorrowed" : "5.07000000" ,
"totalInterest" : "0.0" , // New for interest collection
"interestFreeLimit" : "100000" , // New for interest free limit
"asset" : "USD" , // New for USD value
"crossCollaterals" :[
{
"loanCoin" : "USDT" ,
"collateralCoin" : "BUSD" ,
"locked" : "5.82211108" ,
"loanAmount" : "5.07" ,
"currentCollateralRate" : "0.87168984" ,
// collateralLevel
"interestFreeLimitUsed" : "5.07" , // New for interest free limit
"principalForInterest" : "0.0" , // New for interest collection
"interest" : "0.0" // New for interest collection
},
{
"loanCoin" : "BUSD" ,
"collateralCoin" : "BTC" ,
"locked" : "0" ,
"loanAmount" : "0" ,
"currentCollateralRate" : "0" ,
// collateralLevel
"interestFreeLimitUsed" : "0" , // New for interest free limit
"principalForInterest" : "0.0" , // New for interest collection
"interest" : "0.0" // New for interest collection
}
]
Description
1
}
Cross-Collateral Information (USER_DATA)
GET /sapi/v1/futures/loan/configs (HMAC SHA256)
Response:
Parameters:
[
Name
Type
Mandatory
collateralCoin
STRING
NO
recvWindow
LONG
NO
timestamp
LONG
YES
{
Description
"collateralCoin" : "BUSD" ,
"rate" : "0.9" ,
"marginCallCollateralRate" : "0.95" ,
"liquidationCollateralRate" : "0.98" ,
"currentCollateralRate" : "0.87168984" ,
"interestRate" : "0.0" , // New for interest collection
"interestGracePeriod" : "0" //Days, new for interest collection
}
]
all
collateral data
be returned
will
collateralCoin
if
not sent
is
Weight(IP): 10
Cross-Collateral Information V2 (USER_DATA)
GET /sapi/v2/futures/loan/configs (HMAC SHA256)
Response:
Parameters:
[
Name
Type
Mandatory
loanCoin
STRING
NO
collateralCoin
STRING
NO
recvWindow
LONG
NO
timestamp
LONG
YES
loan and collateral data
not sent
Weight(IP):
"loanCoin" : "BUSD" ,
"collateralCoin" : "BTC" ,
"rate" : "0.9" ,
"marginCallCollateralRate" : "0.95" ,
"liquidationCollateralRate" : "0.98" ,
"currentCollateralRate" : "0.87168984" ,
"interestRate" : "0.0" , // New for interest collection
"interestGracePeriod" : "0" //Days, new for interest collection
}
]
be returned
will
all
{
Description
loanCoin or collateralCoin
if
is
1
Calculate Rate After Adjust Cross-Collateral LTV
(USER_DATA)
GET /sapi/v1/futures/loan/calcAdjustLevel
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
collateralCoin
STRING
YES
amount
DECIMAL
YES
direction
ENUM
YES
recvWindow
LONG
NO
timestamp
LONG
YES
"afterCollateralRate" : "0.89736451"
Description
}
"ADDITIONAL", "REDUCED"
Weight(IP): 50
Calculate Rate After Adjust Cross-Collateral LTV V2
(USER_DATA)
GET /sapi/v2/futures/loan/calcAdjustLevel
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
loanCoin
STRING
YES
collateralCoin
STRING
YES
amount
DECIMAL
YES
direction
ENUM
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Weight(IP):
"afterCollateralRate" : "0.89736451"
Description
}
"ADDITIONAL", "REDUCED"
1
Get Max Amount for Adjust Cross-Collateral LTV
(USER_DATA)
GET /sapi/v1/futures/loan/calcMaxAdjustAmount
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
collateralCoin
STRING
YES
recvWindow
LONG
NO
timestamp
LONG
YES
"maxInAmount" : "9.97109038" ,
"maxOutAmount" : "0.50952693"
Description
}
Weight(IP): 50
Get Max Amount for Adjust Cross-Collateral LTV V2
(USER_DATA)
GET /sapi/v2/futures/loan/calcMaxAdjustAmount
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
loanCoin
STRING
YES
collateralCoin
STRING
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Weight(IP):
"maxInAmount" : "9.97109038" ,
"maxOutAmount" : "0.50952693"
Description
}
1
Adjust Cross-Collateral LTV (TRADE)
POST /sapi/v1/futures/loan/adjustCollateral
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
collateralCoin
STRING
YES
amount
DECIMAL
YES
direction
ENUM
YES
recvWindow
LONG
NO
timestamp
LONG
YES
"collateralCoin" : "BUSD" ,
"direction" : "ADDITIONAL" ,
"amount" : "5.00000000" ,
"time" : 1583540328433
Description
}
"ADDITIONAL", "REDUCED"
Weight(Uid): 3000
RateLimit: 1/1s per account
Adjust Cross-Collateral LTV V2 (TRADE)
POST /sapi/v2/futures/loan/adjustCollateral
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
loanCoin
STRING
YES
collateralCoin
STRING
YES
amount
DECIMAL
YES
direction
ENUM
YES
recvWindow
LONG
NO
timestamp
LONG
YES
"loanCoin" : "BUSD" ,
"collateralCoin" : "BTC" ,
"direction" : "ADDITIONAL" ,
"amount" : "5.00000000" ,
"time" : 1583540328433
Description
}
"ADDITIONAL", "REDUCED"
RateLimit: 1/1s per account
Adjust Cross-Collateral LTV History (USER_DATA)
GET /sapi/v1/futures/loan/adjustCollateral/history (HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
loanCoin
STRING
NO
collateralCoin
STRING
NO
startTime
LONG
NO
endTime
LONG
NO
limit
LONG
NO
"rows" :[
{
Description
"amount" : ".17398184" ,
"collateralCoin" : "BUSD" ,
"coin" : "USDT" ,
"preCollateralRate" : "0.87054861" ,
"afterCollateralRate" : "0.89736451" ,
"direction" : "REDUCED" ,
"status" : "COMPLETED" ,
"adjustTime" : 1583978243588
}
],
"total" : 1
default 500, max 1000
}
recvWindow
LONG
NO
timestamp
LONG
YES
data
All
be returned
will
loanCoin or collateralCoin
if
not sent
is
Weight(IP): 10
Cross-Collateral Liquidation History (USER_DATA)
GET /sapi/v1/futures/loan/liquidationHistory
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
loanCoin
STRING
NO
collateralCoin
STRING
NO
startTime
LONG
NO
endTime
LONG
NO
limit
LONG
NO
recvWindow
LONG
NO
timestamp
LONG
YES
data
All
be returned
will
"collateralAmountForLiquidation" : "10.12345678" ,
"collateralCoin" : "BUSD" ,
"forceLiquidationStartTime" : 1583978243588 ,
"coin" : "USDT" ,
"restCollateralAmountAfterLiquidation" : "15.12345678" ,
"restLoanAmount" : "11.12345678" ,
"status" : "PENDING"
}
],
"total" : 1
default 500, max 1000
loanCoin or collateralCoin
if
"rows" :[
{
Description
}
not sent
is
Weight(IP): 10
Check Collateral Repay Limit (USER_DATA)
Check the maximum and minimum
when repay with collateral.
limit
GET /sapi/v1/futures/loan/collateralRepayLimit
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
coin
STRING
YES
collateralCoin
STRING
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Weight(IP):
"coin" : "USDT" ,
"collateralCoin" : "BTC" ,
"max" : "15000" ,
"min" : "15"
Description
}
1
Get Collateral Repay Quote (USER_DATA)
Get quote before repay with collateral
within 25 seconds.
mandatory, the quote
is
GET /sapi/v1/futures/loan/collateralRepay
will
be valid
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
coin
STRING
YES
collateralCoin
STRING
YES
amount
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Weight(IP):
"coin" : "USDT" ,
"collateralCoin" : "BTC" ,
"amount" : "0.00222" ,
"quoteId" : "8a03da95f0ad4fdc8067e3b6cde72423"
Description
}
repay amount
1
Repay with Collateral (USER_DATA)
Repay with collateral. Get quote before repay with collateral
the quote will be valid within 25 seconds.
POST /sapi/v1/futures/loan/collateralRepay
mandatory,
is
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
quoteId
STRING
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Weight(IP):
"coin" : "USDT" ,
"collateralCoin" : "BTC" ,
"amount" : "30" ,
"quoteId" : "3eece81ca2734042b2f538ea0d9cbdd3"
Description
}
1
Collateral Repayment Result (USER_DATA)
Check collateral repayment result.
GET /sapi/v1/futures/loan/collateralRepayResult
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
quoteId
STRING
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Weight(IP):
"quoteId" : "3eece81ca2734042b2f538ea0d9cbdd3" ,
"status" : "SUCCESS"
Description
}
1
Cross-Collateral Interest History (USER_DATA)
GET /sapi/v1/futures/loan/interestHistory
(HMAC SHA256)
Response:
Parameters:
{
Name
Type
Mandatory
collateralCoin
STRING
NO
startTime
LONG
NO
endTime
LONG
NO
current
LONG
NO
"rows" :[
{
Description
"collateralCoin" : "BUSD" ,
"interestCoin" : "USDT" ,
"interest" : "2.354" ,
"interestFreeLimitUsed" : "0" , // New for interest free limit
"principalForInterest" : "10000" ,
"interestRate" : "0.002" ,
"time" : 1582794387516
}
],
"total" : 1
Currently querying page.
Start from 1. Default:1
}
limit
LONG
NO
recvWindow
LONG
NO
timestamp
LONG
YES
Weight(IP):
Default:500 Max:1000
1
BLVT Endpoints
Get BLVT Info (MARKET_DATA)
GET /sapi/v1/blvt/tokenInfo
Weight(IP):
Response:
1
[
Parameters:
{
Name
Type
Mandatory
Description
tokenName
STRING
NO
BTCDOWN, BTCUP
"tokenName" : "BTCDOWN" ,
"description" : "3X Short Bitcoin Token" ,
"underlying" : "BTC" ,
"tokenIssued" : "717953.95" ,
"basket" : "-821.474 BTCUSDT Futures" ,
"currentBaskets" :[
{
"symbol" : "BTCUSDT" ,
"amount" : "-1183.984" ,
"notionalValue" : "-22871089.96704"
}
],
"nav" : "4.79" ,
"realLeverage" : "-2.316" ,
"fundingRate" : "0.001020" ,
"dailyManagementFee" : "0.0001" ,
"purchaseFeePct" : "0.0010" ,
"dailyPurchaseLimit" : "100000.00" ,
"redeemFeePct" : "0.0010" ,
"dailyRedeemLimit" : "1000000.00" ,
"timstamp" : 1583127900000
},
{
"tokenName" : "LINKUP" ,
"description" : "3X LONG ChainLink Token" ,
"underlying" : "LINK" ,
"tokenIssued" : "163846.99" ,
"basket" : "417288.870 LINKUSDT Futures" ,
"currentBaskets" :[
{
"symbol" : "LINKUSDT" ,
"amount" : "1640883.83" ,
"notionalValue" : "22596611.22293"
}
],
"nav" : "9.60" ,
"realLeverage" : "2.597" ,
"fundingRate" : "-0.000917" ,
"dailyManagementFee" : "0.0001" ,
"purchaseFeePct" : "0.0010" ,
"dailyPurchaseLimit" : "100000.00" ,
"redeemFeePct" : "0.0010" ,
"dailyRedeemLimit" : "1000000.00" ,
"timstamp" : 1583127900000
}
]
Historical BLVT NAV Kline/Candlestick
The BLVT NAV system
on fapi
based on Binance Futures, so the endpoint
is
Please go to here to check the endpoint and operate
fapi usage specifications.
based
is
accordance with the
in
Subscribe BLVT (USER_DATA)
POST /sapi/v1/blvt/subscribe
Weight(IP):
(HMAC SHA256)
Response:
1
{
Parameters:
Name
Type
Mandatory
Description
tokenName
STRING
YES
BTCDOWN, BTCUP
"id" : 123 ,
"status" : "S" , // S, P, and F for "success", "pending", and "failure"
"tokenName" : "LINKUP" ,
"amount" : "0.95590905" , // subscribed token amount
"cost" : "9.99999995" , // subscription cost in usdt
"timstamp" : 1600249972899
}
cost
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
spot balance
Query Subscription Record (USER_DATA)
GET /sapi/v1/blvt/subscribe/record
Weight(IP):
(HMAC SHA256)
Response:
1
[
Parameters:
{
Name
Type
Mandatory
Description
tokenName
STRING
NO
BTCDOWN, BTCUP
id
LONG
NO
startTime
LONG
NO
endTime
LONG
NO
limit
INT
NO
recvWindow
LONG
NO
timestamp
LONG
YES
Only the data
}
]
default 1000, max 1000
the latest 90 days
of
"id" : 1 ,
"tokenName" : "LINKUP" ,
"amount" : "0.54216292" , // Subscription amount
"nav" : "18.42621386" , // NAV price of subscription
"fee" : "0.00999000" , // Subscription fee in usdt
"totalCharge" : "9.99999991" , // Subscription cost in usdt
"timstamp" : 1599127217916
available
is
Redeem BLVT (USER_DATA)
POST /sapi/v1/blvt/redeem
Weight(IP):
(HMAC SHA256)
Response:
1
{
Parameters:
Name
Type
Mandatory
Description
tokenName
STRING
YES
BTCDOWN, BTCUP
"id" : 123 ,
"status" : "S" , // S, P, and F for "success", "pending", and "failure"
"tokenName" : "LINKUP" ,
"redeemAmount" : "0.95590905" ,
// Redemption token amount
"amount" : "10.05022099" ,
// Redemption value in usdt
"timstamp" : 1600250279614
}
amount
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Query Redemption Record (USER_DATA)
GET /sapi/v1/blvt/redeem/record
Weight(IP):
(HMAC SHA256)
Response:
1
[
Parameters:
{
Name
Type
Mandatory
Description
tokenName
STRING
NO
BTCDOWN, BTCUP
id
LONG
NO
}
]
startTime
LONG
NO
endTime
LONG
NO
limit
INT
NO
recvWindow
LONG
NO
timestamp
LONG
YES
Only the data
default 1000, max 1000
the latest 90 days
of
"id" : 1 ,
"tokenName" : "LINKUP" ,
"amount" : "0.54216292" , // Redemption amount
"nav" : "18.36345064" , // NAV of redemption
"fee" : "0.00995598" , // Reemption fee
"netProceed" : "9.94602604" , // Net redemption value in usdt
"timstamp" : 1599128003050
available
is
Get BLVT User Limit Info (USER_DATA)
GET /sapi/v1/blvt/userLimit (HMAC SHA256)
Weight(IP):
Response:
1
[
Parameters:
{
"tokenName" : "LINKUP" ,
"userDailyTotalPurchaseLimit" : "1000" , // USDT
"userDailyTotalRedeemLimit" : "1000"
// USDT
Name
Type
Mandatory
Description
tokenName
STRING
NO
BTCDOWN, BTCUP
},
{
"tokenName" : "LINKDOWN" ,
"userDailyTotalPurchaseLimit" : "1000" , // USDT
"userDailyTotalRedeemLimit" : "50000"
// USDT
recvWindow
LONG
NO
timestamp
LONG
YES
}
]
Websocket BLVT Info Streams
The BLVT NAV system is based on Binance Futures, so the endpoint
on futures websocket service.
Please go to here to check the stream event and operate
the fstream or fstream3 usage specifications.
based
is
accordance with
in
BLVT NAV Kline/Candlestick Streams
The BLVT NAV system is based on Binance Futures, so the endpoint
on futures websocket service.
Please go to here to check the stream event and operate
the fstream or fstream3 usage specifications.
based
is
accordance with
in
BSwap Endpoints
The endpoints below allow you to interact with BSwap.
For more information on this, please refer to the BSwap page
Swap Pools (MARKET_DATA)
List All
GET /sapi/v1/bswap/pools
Get metadata about
Response:
swap pools.
all
[
Weight(IP):
{
1
Parameters:
None
"poolId" :
"poolName"
"assets" :
"BUSD"
"USDT"
]
2,
: "BUSD/USDT" ,
[
,
"poolId" :
"poolName"
"assets" :
"BUSD"
"DAI"
]
3,
: "BUSD/DAI" ,
[
,
"poolId" :
"poolName"
"assets" :
"USDT"
"DAI"
]
4,
: "USDT/DAI" ,
[
,
},
{
},
{
}
]
Get liquidity information of
pool (USER_DATA)
a
GET /sapi/v1/bswap/liquidity (HMAC SHA256)
Get liquidity information and user share
Response:
pool.
of a
[
Weight(IP):
1 for
{
"poolId" : 2 ,
"poolNmae" : "BUSD/USDT" ,
"updateTime" : 1565769342148 ,
"liquidity" : {
"BUSD" : 100000315.79 ,
"USDT" : 99999245.54
},
"share" : {
"shareAmount" : 12415 ,
"sharePercentage" : 0.00006207 ,
"asset" : {
"BUSD" : 6207.02 ,
"USDT" : 6206.95
}
}
one pool
10 when the poolId parameter
omitted
is
Parameter:
Name
Type
Mandatory
poolId
LONG
NO
recvWindow
LONG
NO
timestamp
LONG
YES
Description
}
]
Add Liquidity (TRADE)
POST /sapi/v1/bswap/liquidityAdd
Add liquidity
(HMAC SHA256)
Response:
pool.
to a
{
Weight(Uid): 1000 (Additional:
times one second)
3
"operationId" : 12341
}
Parameter:
Name
Type
Mandatory
poolId
LONG
YES
type
STRING
NO
asset
STRING
YES
quantity
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Description
"Single" to add a single
token; "Combination" to add
dual tokens. Default "Single"
Remove Liquidity (TRADE)
POST /sapi/v1/bswap/liquidityRemove
(HMAC SHA256)
Remove liquidity from a pool, type include
is mandatory for single asset removal
Response:
and
SINGLE
COMBINATION
asset
,
{
"operationId" : 12341
Weight(Uid): 1000 (Additional:
}
times one second)
3
Parameters:
Name
Type
Mandatory
poolId
LONG
YES
type
STRING
YES
Description
single asset
SINGLE for
removal, COMBINATION for
combination of all coins
removal
asset
LIST
NO
Mandatory
removal
shareAmount
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
for
single asset
Get Liquidity Operation Record (USER_DATA)
GET /sapi/v1/bswap/liquidityOps
(HMAC SHA256)
Response:
Get liquidity operation (add/remove) records.
[
Weight(Uid): 3000
{
"operationId" : 12341 ,
"poolId" : 2 ,
"poolName" : "BUSD/USDT" ,
"operation" : "ADD" , // "ADD" or "REMOVE"
"status" : 1 , // 0: pending, 1: success, 2: failed
"updateTime" : 1565769342148 ,
"shareAmount" : "10.1"
Parameters:
Name
Type
Mandatory
operationId
LONG
NO
Description
}
]
poolId
LONG
NO
operation
ENUM
NO
startTime
LONG
NO
endTime
LONG
NO
limit
LONG
NO
recvWindow
LONG
NO
timestamp
LONG
YES
or
ADD
REMOVE
default
max 100
3,
Request Quote (USER_DATA)
GET /sapi/v1/bswap/quote (HMAC SHA256)
Response:
Request a quote for swap quote asset (selling asset)
asset), essentially price/exchange rates.
quantity
quoteQty is
quote asset
of
base asset (buying
for
{
"quoteAsset" : "USDT" ,
"baseAsset" : "BUSD" ,
"quoteQty" : 300000 ,
"baseQty" : 299975 ,
"price" : 1.00008334 ,
"slippage" : 0.00007245 ,
"fee" : 120
(to sell).
Please be noted the quote is for reference only, the actual price will change
as the liquidity changes, it's recommended to swap immediate after request
a quote for slippage prevention.
}
Weight(Uid): 150
Parameters:
Name
Type
Mandatory
quoteAsset
STRING
YES
baseAsset
STRING
YES
quoteQty
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Description
Swap (TRADE)
POST /sapi/v1/bswap/swap (HMAC SHA256)
Swap
quoteAsset for baseAsset
Response:
.
{
Weight(Uid): 1000 (Additional:
times one second)
3
"swapId" : 2314
}
Parameters:
Name
Type
Mandatory
quoteAsset
STRING
YES
baseAsset
STRING
YES
quoteQty
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Description
Get Swap History (USER_DATA)
GET /sapi/v1/bswap/swap (HMAC SHA256)
Response:
Get swap history.
[
Weight(Uid): 3000
{
"swapId" : 2314 ,
"swapTime" : 1565770342148 ,
"status" : 0 , // 0: pending, 1: success, 2: failed
"quoteAsset" : "USDT" ,
"baseAsset" : "BUSD" ,
"quoteQty" : 300000 ,
"baseQty" : 299975 ,
"price" : 1.00008334 ,
"fee" : 120
Parameters:
Name
Type
Mandatory
swapId
LONG
NO
startTime
LONG
NO
Description
}
]
endTime
LONG
NO
status
INT
NO
quoteAsset
STRING
NO
baseAsset
STRING
NO
limit
LONG
NO
recvWindow
LONG
NO
timestamp
LONG
YES
pending for swap,
success, 2: failed
0:
default
1:
max 100
3,
Get Pool Configure (USER_DATA)
GET /sapi/v1/bswap/poolConfigure
(HMAC SHA256)
Response:
Weight(IP): 150
[
Parameters:
{
Name
Type
Mandatory
poolId
LONG
NO
recvWindow
LONG
NO
timestamp
LONG
YES
"poolId" : 2 ,
"poolNmae" : "BUSD/USDT" ,
"updateTime" : 1565769342148 ,
"liquidity" : {
"constantA" : 2000 , //"NA" if pool is an innovation pool
"minRedeemShare" : 0.1 ,
"slippageTolerance" : 0.2 //The swap proceeds only when the slippage
},
"assetConfigure" :{
"BUSD" : {
"minAdd" : 10 ,
"maxAdd" : 20 ,
"minSwap" : 10 ,
"maxSwap" : 30
}
"USDT" : {
"minAdd" : 10 ,
"maxAdd" : 20 ,
"minSwap" : 10 ,
"maxSwap" : 30
}
}
Description
}
]
Add Liquidity Preview (USER_DATA)
GET /sapi/v1/bswap/addLiquidityPreview
Calculate expected share amount
token.
(HMAC SHA256)
adding liquidity
for
Response:
single or dual
in
{
"quoteAsset" : "USDT" ,
"baseAsset" : "BUSD" , //Display
"quoteAmt" : 300000 ,
"baseAmt" : 299975 , // Display
"price" : 1.00008334 ,
"share" : 1.23 ,
"slippage" : 0.00007245 , //Not
"fee" : 120 , // Not display if
Weight(IP): 150
Parameters:
Name
Type
Mandatory
poolId
LONG
YES
type
STRING
YES
quoteAsset
STRING
YES
quoteQty
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Description
for type is "COMBINATION"
for type is "COMBINATION"
display if type is "COMBINATION"
type is "COMBINATION"
}
"SINGLE" for adding a single
token;"COMBINATION" for
adding dual tokens
Remove Liquidity Preview (USER_DATA)
GET /sapi/v1/bswap/removeLiquidityPreview
Calculate the expected asset amount
token redemption.
(HMAC SHA256)
Response:
single token redemption or dual
of
{
"quoteAsset" : "USDT" ,
"baseAsset" : "BUSD" , //Display for type is "COMBINATION"
"quoteAmt" : 300000 ,
"baseAmt" : 299975 , //Display for type is "COMBINATION"
"price" : 1.00008334 ,
"slippage" : 0.00007245 , //Display for type is "SINGLE"
"fee" : 120 //Display for type is "SINGLE"
Weight(IP): 150
Parameters:
Name
Type
Mandatory
poolId
LONG
YES
type
STRING
YES
quoteAsset
STRING
YES
shareAmount
DECIMAL
YES
recvWindow
LONG
NO
timestamp
LONG
YES
Description
}
Type is "SINGLE", remove
and obtain a single
token;Type is
"COMBINATION", remove
and obtain dual token.
Fiat Endpoints
Get Fiat Deposit/Withdraw History (USER_DATA)
GET /sapi/v1/fiat/orders (HMAC SHA256)
Weight(IP):
Response:
1
{
Parameters:
Name
Type
Mandatory
Description
transactionType
STRING
YES
0-deposit,1-withdraw
beginTime
LONG
NO
endTime
LONG
NO
page
INT
NO
default
rows
INT
NO
default 100, max 500
recvWindow
LONG
NO
timestamp
LONG
YES
"code" : "000000" ,
"message" : "success" ,
"data" : [
{
"orderNo" : "7d76d611-0568-4f43-afb6-24cac7767365" ,
"fiatCurrency" : "BRL" ,
"indicatedAmount" : "10.00" ,
"amount" : "10.00" ,
"totalFee" : "0.00" ,
// Trade fee
"method" : "BankAccount" , // Trade method
"status" : "Expired" , // Processing, Failed, Successful, Finished,
"createTime" : 1626144956000 ,
"updateTime" : 1626400907000
}
],
"total" : 1 ,
"success" : true
1
Refunding,
}
beginTime and endTime are not sent, the recent 30-day data
returned.
will
If
be
Get Fiat Payments History (USER_DATA)
GET /sapi/v1/fiat/payments (HMAC SHA256)
Weight(IP):
Response:
1
{
Parameters:
Name
Type
Mandatory
Description
transactionType
STRING
YES
0-buy,1-sell
beginTime
LONG
NO
endTime
LONG
NO
page
INT
NO
default
rows
INT
NO
default 100, max 500
recvWindow
LONG
NO
"code" : "000000" ,
"message" : "success" ,
"data" : [
{
"orderNo" : "353fca443f06466db0c4dc89f94f027a" ,
"sourceAmount" : "20.0" , // Fiat trade amount
"fiatCurrency" : "EUR" ,
// Fiat token
"obtainAmount" : "4.462" , // Crypto trade amount
"cryptoCurrency" : "LUNA" , // Crypto token
"totalFee" : "0.2" ,
// Trade fee
"price" : "4.437472" ,
"status" : "Failed" , // Processing, Completed, Failed, Refunded
"createTime" : 1624529919000 ,
"updateTime" : 1624529919000
}
],
"total" : 1 ,
"success" : true
1
}
timestamp
LONG
YES
beginTime and endTime are not sent, the recent 30-day data
returned.
will
If
be
C2C Endpoints
Get C2C Trade History (USER_DATA)
GET /sapi/v1/c2c/orderMatch/listUserOrderHistory (HMAC SHA256)
Weight(IP):
Response:
1
{
Parameters:
Name
Type
Mandatory
Description
tradeType
STRING
YES
BUY, SELL
startTimestamp
LONG
NO
endTimestamp
LONG
NO
page
INT
NO
default
rows
INT
NO
recvWindow
LONG
NO
timestamp
LONG
YES
"code" : "000000" ,
"message" : "success" ,
"data" : [
{
"orderNumber" : "20219644646554779648" ,
"advNo" : "11218246497340923904" ,
"tradeType" : "SELL" ,
"asset" : "BUSD" ,
"fiat" : "CNY" ,
"fiatSymbol" : "¥" ,
"amount" : "5000.00000000" , // Quantity (in Crypto)
"totalPrice" : "33400.00000000" ,
"unitPrice" : "6.68" , // Unit Price (in Fiat)
"orderStatus" : "COMPLETED" , // PENDING, TRADING, BUYER_PAYED,
"createTime" : 1619361369000 ,
"commission" : "0" ,
// Transaction Fee (in Crypto)
"counterPartNickName" : "ab***" ,
"advertisementRole" : "TAKER"
}
],
"total" : 1 ,
"success" : true
1
default 100, max 100
startTimestamp and endTimestamp are not sent, the recent 30-day
data will be returned.
The max interval between startTimestamp and endTimestamp is 30 days.
If
}
Error Codes
Errors consist of two parts: an error code and
universal, but messages can vary.
message. Codes are
a
The error JSON payload:
{
"code" : - 1121 ,
"msg" : "Invalid symbol."
}
10xx
General Server or Network issues
-
-1000 UNKNOWN
An unknown error occurred while processing the request.
An unknown error occurred while processing the request.[%s]
-1001 DISCONNECTED
Internal error; unable
process your request. Please
to
again.
try
-1002 UNAUTHORIZED
You are not authorized
execute this request.
to
-1003 TOO_MANY_REQUESTS
Too many requests queued.
Too much request weight used; please use the websocket for live updates
to avoid polling the API.
Too much request weight used; current limit is %s request weight per %s
%s. Please use the websocket for live updates to avoid polling the API.
Way too much request weight used; IP banned until %s. Please use the
websocket for live updates to avoid bans.
-1004 SERVER_BUSY
Server
busy, please wait and
is
again
try
-1006 UNEXPECTED_RESP
An unexpected response was received from the message bus. Execution
status unknown.
-1007 TIMEOUT
Timeout waiting for response from backend server. Send status unknown;
execution status unknown.
-1014 UNKNOWN_ORDER_COMPOSITION
Unsupported order combination.
-1015 TOO_MANY_ORDERS
Too many new orders.
Too many new orders; current
limit
%s orders per %s.
is
-1016 SERVICE_SHUTTING_DOWN
This service
no longer available.
is
-1020 UNSUPPORTED_OPERATION
This operation
not supported.
is
-1021 INVALID_TIMESTAMP
Timestamp
Timestamp
request is outside of the recvWindow.
request was 1000ms ahead of the server's time.
for this
for this
-1022 INVALID_SIGNATURE
Signature
request
for this
not
is
valid.
-1099 Not found, authenticated, or authorized
This replaces error code -1999
11xx
2xxx Request issues
-
-1100 ILLEGAL_CHARS
characters found
characters found
characters found
Illegal
Illegal
Illegal
parameter.
a parameter. %s
parameter %s legal range
in a
in
in
%s
is
;
.
-1101 TOO_MANY_PARAMETERS
Too many parameters sent for this endpoint.
Too many parameters; expected %s and received
Duplicate values for a parameter detected.
%s
.
-1102 MANDATORY_PARAM_EMPTY_OR_MALFORMED
A mandatory parameter was not sent, was empty/null, or malformed.
Mandatory parameter %s was not sent, was empty/null, or malformed.
Param %s or %s must be sent, but both were empty/null!
-1103 UNKNOWN_PARAM
An unknown parameter was sent.
-1104 UNREAD_PARAMETERS
Not
Not
s
sent parameters were read.
sent parameters were read; read
all
all
parameter(s) but was sent
%s
%
.
-1105 PARAM_EMPTY
A parameter was empty.
Parameter %s was empty.
-1106 PARAM_NOT_REQUIRED
A parameter was sent when not required.
Parameter %s sent when not required.
-1111 BAD_PRECISION
Precision
over the maximum defined
is
asset.
for this
-1112 NO_DEPTH
No orders on book
symbol.
for
-1114 TIF_NOT_REQUIRED
TimeInForce parameter sent when not required.
-1115 INVALID_TIF
Invalid timeInForce.
-1116 INVALID_ORDER_TYPE
Invalid orderType.
-1117 INVALID_SIDE
Invalid side.
-1118 EMPTY_NEW_CL_ORD_ID
New client order ID was empty.
-1119 EMPTY_ORG_CL_ORD_ID
Original client order ID was empty.
-1120 BAD_INTERVAL
Invalid interval.
-1121 BAD_SYMBOL
Invalid symbol.
-1125 INVALID_LISTEN_KEY
This listenKey does not
exist.
-1127 MORE_THAN_XX_HOURS
Lookup interval is too big.
More than %s hours between startTime and endTime.
-1128 OPTIONAL_PARAMS_BAD_COMBO
Combination
optional parameters invalid.
of
-1130 INVALID_PARAMETER
Invalid data sent for a parameter.
Data sent for parameter %s is not
valid.
-1131 BAD_RECV_WINDOW
recvWindow must be less than 60000
-2010 NEW_ORDER_REJECTED
NEW_ORDER_REJECTED
-2011 CANCEL_REJECTED
CANCEL_REJECTED
-2013 NO_SUCH_ORDER
Order does not
exist.
-2014 BAD_API_KEY_FMT
API-key format invalid.
-2015 REJECTED_MBX_KEY
Invalid API-key,
or permissions
IP,
action.
for
-2016 NO_TRADING_WINDOW
No trading window could be found
instead.
the symbol.
for
ticker/24hrs
Try
3xxx-5xxx SAPI-specific issues
-3000 INNER_FAILURE
Internal server error.
-3001 NEED_ENABLE_2FA
Please enable 2FA
first.
-3002 ASSET_DEFICIENCY
We don't have this asset.
-3003 NO_OPENED_MARGIN_ACCOUNT
Margin account does not
exist.
-3004 TRADE_NOT_ALLOWED
Trade not allowed.
-3005 TRANSFER_OUT_NOT_ALLOWED
Transferring out not allowed.
-3006 EXCEED_MAX_BORROWABLE
Your borrow amount has exceed maximum borrow amount.
-3007 HAS_PENDING_TRANSACTION
You have pending transaction, please
again
try
later.
-3008 BORROW_NOT_ALLOWED
Borrow not allowed.
-3009 ASSET_NOT_MORTGAGEABLE
This asset are not allowed
transfer into margin account currently.
to
-3010 REPAY_NOT_ALLOWED
Repay not allowed.
-3011 BAD_DATE_RANGE
Your input date
invalid.
is
-3012 ASSET_ADMIN_BAN_BORROW
Borrow
banned
is
asset.
for this
-3013 LT_MIN_BORROWABLE
Borrow amount less than minimum borrow amount.
-3014 ACCOUNT_BAN_BORROW
Borrow
banned
is
account.
for this
-3015 REPAY_EXCEED_LIABILITY
Repay amount exceeds borrow amount.
-3016 LT_MIN_REPAY
Repay amount less than minimum repay amount.
-3017 ASSET_ADMIN_BAN_MORTGAGE
This asset are not allowed
transfer into margin account currently.
to
-3018 ACCOUNT_BAN_MORTGAGE
Transferring
has been banned
in
account.
for this
-3019 ACCOUNT_BAN_ROLLOUT
Transferring out has been banned
account.
for this
-3020 EXCEED_MAX_ROLLOUT
Transfer out amount exceeds max amount.
-3021 PAIR_ADMIN_BAN_TRADE
Margin account are not allowed
to
trade
trading
this
pair.
-3022 ACCOUNT_BAN_TRADE
You account's trading
banned.
is
-3023 WARNING_MARGIN_LEVEL
You can't transfer out/place order under current margin
level.
-3024 FEW_LIABILITY_LEFT
The unpaid debt
too small after this repayment.
is
-3025 INVALID_EFFECTIVE_TIME
Your input date
invalid.
is
-3026 VALIDATION_FAILED
Your input param
invalid.
is
-3027 NOT_VALID_MARGIN_ASSET
Not
valid margin asset.
a
-3028 NOT_VALID_MARGIN_PAIR
Not
valid margin
a
pair.
-3029 TRANSFER_FAILED
Transfer failed.
-3036 ACCOUNT_BAN_REPAY
This account
not allowed
is
repay.
to
-3037 PNL_CLEARING
PNL
clearing. Wait
is
second.
a
-3038 LISTEN_KEY_NOT_FOUND
Listen key not found.
-3041 BALANCE_NOT_CLEARED
Balance
not enough
is
-3042 PRICE_INDEX_NOT_FOUND
PriceIndex not available
margin
for this
pair.
-3043 TRANSFER_IN_NOT_ALLOWED
Transferring
not allowed.
in
-3044 SYSTEM_BUSY
System busy.
-3999 NOT_WHITELIST_USER
This function
only available
is
invited users.
for
-4001 CAPITAL_INVALID
Invalid operation.
-4002 CAPITAL_IG
Invalid get.
-4003 CAPITAL_IEV
Your input email
invalid.
is
-4004 CAPITAL_UA
You don't login or auth.
-4005 CAPAITAL_TOO_MANY_REQUEST
Too many new requests.
-4006 CAPITAL_ONLY_SUPPORT_PRIMARY_ACCOUNT
Support main account only.
-4007 CAPITAL_ADDRESS_VERIFICATION_NOT_PASS
Address validation
not passed.
is
-4008 CAPITAL_ADDRESS_TAG_VERIFICATION_NOT_PASS
Address tag validation
not passed.
is
-4010 CAPITAL_WHITELIST_EMAIL_CONFIRM
White
mail has been confirmed.
list
-4011 CAPITAL_WHITELIST_EMAIL_EXPIRED
White
mail
list
invalid.
is
-4012 CAPITAL_WHITELIST_CLOSE
White
not opened.
list is
-4013 CAPITAL_WITHDRAW_2FA_VERIFY
2FA
not opened.
is
-4014 CAPITAL_WITHDRAW_LOGIN_DELAY
Withdraw
not allowed within
is
min login.
2
-4015 CAPITAL_WITHDRAW_RESTRICTED_MINUTE
Withdraw
limited.
is
-4016 CAPITAL_WITHDRAW_RESTRICTED_PASSWORD
Within 24 hours after password modification, withdrawal
prohibited.
is
-4017 CAPITAL_WITHDRAW_RESTRICTED_UNBIND_2FA
Within 24 hours after the release
2FA, withdrawal
of
prohibited.
is
-4018 CAPITAL_WITHDRAW_ASSET_NOT_EXIST
We don't have this asset.
-4019 CAPITAL_WITHDRAW_ASSET_PROHIBIT
Current asset
is
not open
withdrawal.
for
-4021 CAPITAL_WITHDRAW_AMOUNT_MULTIPLE
Asset withdrawal must be an %s multiple
%s.
of
-4022 CAPITAL_WITHDRAW_MIN_AMOUNT
Not less than the minimum pick-up quantity %s.
-4023 CAPITAL_WITHDRAW_MAX_AMOUNT
Within 24 hours, the withdrawal exceeds the maximum amount.
-4024 CAPITAL_WITHDRAW_USER_NO_ASSET
You don't have this asset.
-4025 CAPITAL_WITHDRAW_USER_ASSET_LESS_THAN_ZERO
The number
hold asset
of
less
is
than zero.
-4026 CAPITAL_WITHDRAW_USER_ASSET_NOT_ENOUGH
You have insufficient balance.
-4027 CAPITAL_WITHDRAW_GET_TRAN_ID_FAILURE
Failed
obtain tranId.
to
-4028 CAPITAL_WITHDRAW_MORE_THAN_FEE
The amount
withdrawal must be greater than the Commission.
of
-4029 CAPITAL_WITHDRAW_NOT_EXIST
The withdrawal record does not
exist.
-4030 CAPITAL_WITHDRAW_CONFIRM_SUCCESS
Confirmation
successful asset withdrawal.
of
-4031 CAPITAL_WITHDRAW_CANCEL_FAILURE
Cancellation failed.
-4032 CAPITAL_WITHDRAW_CHECKSUM_VERIFY_FAILURE
Withdraw verification exception.
-4033 CAPITAL_WITHDRAW_ILLEGAL_ADDRESS
address.
Illegal
-4034 CAPITAL_WITHDRAW_ADDRESS_CHEAT
The address
suspected
is
fake.
of
-4035 CAPITAL_WITHDRAW_NOT_WHITE_ADDRESS
This address
not on the whitelist. Please join and
is
again.
try
-4036 CAPITAL_WITHDRAW_NEW_ADDRESS
The new address needs
be withdrawn
to
hours.
in {0}
-4037 CAPITAL_WITHDRAW_RESEND_EMAIL_FAIL
Re-sending Mail failed.
-4038 CAPITAL_WITHDRAW_RESEND_EMAIL_TIME_OUT
Please
again
try
minutes.
in 5
-4039 CAPITAL_USER_EMPTY
The user does not
exist.
-4040 CAPITAL_NO_CHARGE
This address not charged.
-4041 CAPITAL_MINUTE_TOO_SMALL
Please
again
try
one minute.
in
-4042 CAPITAL_CHARGE_NOT_RESET
This asset cannot get deposit address again.
-4043 CAPITAL_ADDRESS_TOO_MUCH
More than 100 recharge addresses were used
24 hours.
in
-4044 CAPITAL_BLACKLIST_COUNTRY_GET_ADDRESS
This
blacklist country.
is a
-4045 CAPITAL_GET_ASSET_ERROR
Failure
acquire assets.
to
-4046 CAPITAL_AGREEMENT_NOT_CONFIRMED
Agreement not confirmed.
-4047 CAPITAL_DATE_INTERVAL_LIMIT
Time interval must be within 0-90 days
-5001 ASSET_DRIBBLET_CONVERT_SWITCH_OFF
Don't allow transfer
micro assets.
to
-5002 ASSET_ASSET_NOT_ENOUGH
You have insufficient balance.
-5003 ASSET_USER_HAVE_NO_ASSET
You don't have this asset.
-5004 USER_OUT_OF_TRANSFER_FLOAT
The residual balances have exceeded 0.001BTC, Please re-choose.
The residual balances of %s have exceeded 0.001BTC, Please re-choose.
-5005 USER_ASSET_AMOUNT_IS_TOO_LOW
The residual balances
The residual balances
the BTC is too low
%s is too low, Please re-choose.
of
of
-5006 USER_CAN_NOT_REQUEST_IN_24_HOURS
Only transfer once
24 hours.
in
-5007 AMOUNT_OVER_ZERO
Quantity must be greater than zero.
-5008 ASSET_WITHDRAW_WITHDRAWING_NOT_ENOUGH
Insufficient amount
returnable assets.
of
-5009 PRODUCT_NOT_EXIST
Product does not
exist.
-5010 TRANSFER_FAIL
Asset transfer
fail.
-5011 FUTURE_ACCT_NOT_EXIST
future account not exists.
-5012 TRANSFER_PENDING
Asset transfer
pending.
is in
-5021 PARENT_SUB_HAVE_NO_RELATION
This parent sub have no relation
-5012 FUTURE_ACCT_OR_SUBRELATION_NOT_EXIST
future account or sub relation not exists.
6XXX
Savings Issues
-
-6001 DAILY_PRODUCT_NOT_EXIST
Daily product not exists.
-6003 DAILY_PRODUCT_NOT_ACCESSIBLE
Product not exist or you don't have permission
-6004 DAILY_PRODUCT_NOT_PURCHASABLE
Product not
purchase status
in
-6005 DAILY_LOWER_THAN_MIN_PURCHASE_LIMIT
Smaller than min purchase
limit
-6006 DAILY_REDEEM_AMOUNT_ERROR
Redeem amount error
-6007 DAILY_REDEEM_TIME_ERROR
Not
in
redeem time
-6008 DAILY_PRODUCT_NOT_REDEEMABLE
Product not
redeem status
in
-6009 REQUEST_FREQUENCY_TOO_HIGH
Request frequency too high
-6011 EXCEEDED_USER_PURCHASE_LIMIT
Exceeding the maximum num allowed
to
purchase per user
-6012 BALANCE_NOT_ENOUGH
Balance not enough
-6013 PURCHASING_FAILED
Purchasing failed
-6014 UPDATE_FAILED
Exceed up-limit allowed
purchased
to
-6015 EMPTY_REQUEST_BODY
Empty request body
-6016 PARAMS_ERR
Parameter
err
-6017 NOT_IN_WHITELIST
Not
in
whitelist
-6018 ASSET_NOT_ENOUGH
Asset not enough
-6019 PENDING
Need confirm
-6020 PROJECT_NOT_EXISTS
Project not exists
70xx
-
Futures
-7001 FUTURES_BAD_DATE_RANGE
Date range
not supported.
is
-7002 FUTURES_BAD_TYPE
Data request type
is
not supported.
-9xxx Filter failures
Error message
Description
"Filter
failure: PRICE_FILTER"
too high, too low,
and/or not following the tick
size rule for the symbol.
"Filter
failure: PERCENT_PRICE"
X% too high or X% too
low from the average weighted
price over the last Y minutes.
"Filter
failure: LOT_SIZE"
too high, too low,
and/or not following the step
size rule for the symbol.
"Filter
failure: MIN_NOTIONAL"
price
price is
price is
quantity is
be
valid order
a
too low to
the symbol.
quantity is
*
for
"Filter
failure: ICEBERG_PARTS"
order would break into
too many parts; icebergQty is
too small.
"Filter
failure: MARKET_LOT_SIZE"
order's quantity is too
high, too low, and/or not
following the step size rule for
the symbol.
"Filter
failure: MAX_POSITION"
The account's position has
reached the maximum defined
ICEBERG
MARKET
limit.
This is composed of the sum of
the balance of the base asset,
and the sum of the quantity of
all open BUY orders.
"Filter
failure: MAX_NUM_ORDERS"
Account has too many open
orders on the symbol.
"Filter
failure: MAX_ALGO_ORDERS"
Account has too many open
stop loss and/or take profit
orders on the symbol.
"Filter
failure:
MAX_NUM_ICEBERG_ORDERS"
Account has too many open
iceberg orders on the symbol.
"Filter
failure:
EXCHANGE_MAX_NUM_ORDERS"
Account has too many open
orders on the exchange.
failure:
EXCHANGE_MAX_ALGO_ORDERS"
Account has too many open
stop loss and/or take profit
orders on the exchange.
"Filter
10xxx
Futures Cross Collateral
-
-10017 REPAY_CHECK_BEYOND_LIABILITY
Repay amount should not be larger than
13xxx
liability.
BLVT
-
-13000 BLVT_FORBID_REDEEM
Redeption
the token
of
is
forbiden now
-13001 BLVT_EXCEED_DAILY_LIMIT
Exceeds individual 24h redemption
the token
limit of
-13002 BLVT_EXCEED_TOKEN_DAILY_LIMIT
Exceeds total 24h redemption
the token
limit of
-13003 BLVT_FORBID_PURCHASE
Subscription
of
the token
is
forbiden now
-13004 BLVT_EXCEED_DAILY_PURCHASE_LIMIT
Exceeds individual 24h subscription
the token
limit of
-13005 BLVT_EXCEED_TOKEN_DAILY_PURCHASE_LIMIT
Exceeds total 24h subscription
the token
limit of
-13006 BLVT_PURCHASE_LESS_MIN_AMOUNT
Subscription amount
is
too small
-13007 BLVT_PURCHASE_AGREEMENT_NOT_SIGN
The Agreement
is
not signed
Order Rejection Issues
Error messages like these are indicated when the error
from the matching engine:
is
coming specifically
-1010 ERROR_MSG_RECEIVED
-2010 NEW_ORDER_REJECTED
-2011 CANCEL_REJECTED
The following messages which
will
indicate the specific error:
Error message
Description
"Unknown order sent."
The order (by either
clientOrderId
,
orderId
,
origClientOrderId
)
could not be found.
"Duplicate order sent."
The
"Market
The symbol
is
closed."
clientOrderId is
Not enough funds
action.
"Market orders are not
supported for this symbol."
MARKET is
"Iceberg orders are not
supported for this symbol."
icebergQty is
"Stop loss
supported
limit orders are not
for this symbol."
"Take profit orders are not
supported for this symbol."
not enabled on the
not enabled on the
symbol
STOP_LOSS_LIMIT
is
not enabled on the
symbol
not enabled on the
TAKE_PROFIT is
symbol
"Price * QTY
price
less."
complete the
to
not enabled on the symbol.
STOP_LOSS is
the symbol
zero or
use.
symbol
"Take profit limit orders are
not supported for this
symbol."
is
in
not trading.
is
"Account has insufficient
balance for requested action."
"Stop loss orders are not
supported for this symbol."
already
TAKE_PROFIT_LIMIT is
*
quantity is
not enabled on
too low
"IcebergQty exceeds QTY."
must be less than the
order quantity
"This action disabled
this account."
Contact customer support; some
actions have been disabled on the
account.
is
on
"Unsupported order
combination"
icebergQty
The
orderType
stopPrice
,
,
timeInForce
and/or
combination
isn't
,
icebergQty
allowed.
"Order would trigger
immediately."
The order's stop price is not valid when
compared to the last traded price.
"Cancel order is invalid. Check
origClientOrderId and
orderId."
No origClientOrderId or
sent in.
"Order would immediately
match and take."
order type would
immediately match and trade, and not
be a pure maker order.
"The relationship of the prices
for the orders is not correct."
The prices set in the OCO is breaking
the Price rules.
The rules are:
SELL Orders Limit Price > Last Price >
Stop Price
BUY Orders Limit Price < Last Price <
Stop Price
orderId
was
LIMIT_MAKER
:
:
"OCO orders are not
supported for this symbol"
OCO is
not enabled on the symbol.
"Quote order qty market
orders are not support for
this symbol."
orders using the parameter
quoteOrderQty are not enabled on this
symbol.
MARKET
Notes
Request Parameters
Email Address
Email address should be encoded.
into alice%40test.com x
e.g. alice@test.com
should be encoded
DISTRIBUTING,
PDF Page 28
Case 1:23-cv-01599-ABJ Document 15-1 Filed 06/06/23 Page 27 of 30
Verify
Please make sure that you are visiting
https://www.binance.com
Please enter an email address, phone number, Telegram or WeChat ID to check
representative. Stay safe from scammers.
if
they are an official Binance
Security Guides
General Security Principles
Common Scams on Mobile Devices
What Is Phishing?