Binance
Binance API Information
Binance API Link: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information
Main Endpoints
- Base Endpoint:
https://api.binance.com - Alternatives:
https://api-gcp.binance.com
https://api1.binance.com
https://api2.binance.com
https://api3.binance.com
https://api4.binance.com
Response Format
- Data format: JSON object or array.
- Sorting: Ascending order (oldest data first).
- Timestamps:
- Default: Milliseconds.
- Alternative: Microseconds (header:
X-MBX-TIME-UNIT:MICROSECOND).
Time Parameters
- Accepted units: Milliseconds or microseconds.
HTTP Return Codes
Binance API Link: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/http-return-codes
- 4XX error codes are used for client-side errors; the issue lies with the sender.
- 403 error code is used for WAF Limit (Web Application Firewall) violations.
- 409 error code is used when a
cancelReplaceorder is partially successful. (That is, the cancellation fails, but the new order is successfully placed.) - 429 error code is used when the request rate limit is exceeded.
- 418 error code is returned when an IP address continues sending requests after receiving 429 codes and is automatically banned.
- 5XX error codes indicate server-side errors; the issue lies with Binance. This should not be considered a transaction failure; the transaction status is UNKNOWN and may still succeed.
Binance Error Codes
Binance API Link: https://developers.binance.com/docs/binance-spot-api-docs/errors
Errors consist of two parts: an error code and a message. Codes are universal, but messages may vary. Below is an example of an error JSON payload:
{
"code": -1121,
"msg": "Invalid symbol."
}10xx - General Server or Network Issues
- 1000 UNKNOWN An unknown error occurred while processing the request.
- 1001 DISCONNECTED Internal error; unable to process your request. Please try again.
- 1002 UNAUTHORIZED ou are not authorized to execute this request.
- 1003 TOO_MANY_REQUESTS Too many requests are queued. Excessive request weight used; the current limit is %s request weight per %s. Use WebSocket streams for real-time updates.
- 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.
- 1008 SERVER_BUSY Server is currently overloaded with other requests. Please try again in a few minutes.
- 1013 INVALID_MESSAGE The request is rejected by the API. (i.e. The request didn’t reach the Matching Engine.)
- 1014 UNKNOWN_ORDER_COMPOSITION Unsupported order combination.
- 1015 TOO_MANY_ORDERS Too many new orders.
- 1016 SERVICE_SHUTTING_DOWN This service is no longer available.
- 1020 UNSUPPORTED_OPERATION This operation is not supported.
- 1021 INVALID_TIMESTAMP Timestamp for this request is outside of the recvWindow.
- 1022 INVALID_SIGNATURE Signature for this request is not valid.
11xx - Request issues
- 1100 ILLEGAL_CHARS Illegal characters found in a parameter.
- 1101 TOO_MANY_PARAMETERS Too many parameters sent for this endpoint.
- 1102 MANDATORY_PARAM_EMPTY_OR_MALFORMED A mandatory parameter was not sent, was empty/null, or malformed.
- 1103 UNKNOWN_PARAM An unknown parameter was sent.
- 1104 UNREAD_PARAMETERS Not all sent parameters were read.
- 1105 PARAM_EMPTY A parameter was empty.
- 1106 PARAM_NOT_REQUIRED A parameter was sent when not required.
- 1108 PARAM_OVERFLOW Parameter ‘%s’ overflowed.
- 1111 BAD_PRECISION Parameter ‘%s’ has too much precision.
- 1112 NO_DEPTH No orders on book for symbol.
- 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.
- 1121 BAD_SYMBOL Invalid symbol.
- 1122 INVALID_SYMBOLSTATUS Invalid symbolStatus.
- 1125 INVALID_LISTEN_KEY This listenKey does not exist.
- 1130 INVALID_PARAMETER Invalid data sent for a parameter.
- 1134 BAD_STRATEGY_TYPE
strategyTypewas less than 1000000. - 1135 INVALID_JSON Invalid JSON Request
- 1194 INVALID_TIME_UNIT Invalid value for time unit; expected either MICROSECOND or MILLISECOND.
Messages for -1010 ERROR_MSG_RECEIVED, -2010 NEW_ORDER_REJECTED, and -2011 CANCEL_REJECTED
| Error Message | Description |
|---|---|
| “Unknown order sent.” | The order (by either orderId, clOrdId, or origClOrdId) could not be found. |
| “Duplicate order sent.” | The clOrdId is already in use. |
| “Market is closed.” | The symbol is not trading. |
| “Account has insufficient balance for requested action.” | Not enough funds to complete the action. |
| “Market orders are not supported for this symbol.” | MARKET is not enabled on the symbol. |
| “Iceberg orders are not supported for this symbol.” | icebergQty is not enabled on the symbol. |
| “Stop loss orders are not supported for this symbol.” | STOP_LOSS is not enabled on the symbol. |
| “Stop loss limit orders are not supported for this symbol.” | STOP_LOSS_LIMIT is not enabled on the symbol. |
| “Take profit orders are not supported for this symbol.” | TAKE_PROFIT is not enabled on the symbol. |
| “Take profit limit orders are not supported for this symbol.” | TAKE_PROFIT_LIMIT is not enabled on the symbol. |
| “Price * QTY is zero or less.” | price * quantity is too low. |
| “IcebergQty exceeds QTY.” | icebergQty must be less than the order quantity. |
| “This action is disabled on this account.” | Contact customer support; some actions have been disabled on the account. |
| “This account may not place or cancel orders.” | Contact customer support; the account has trading ability disabled. |
| “Unsupported order combination” | The orderType, timeInForce, stopPrice, and/or icebergQty combination is not 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 origClOrdId and orderId.” | No origClOrdId or orderId was sent in. |
| “Order would immediately match and take.” | The LIMIT_MAKER 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 are breaking the price restrictions: BUY: LIMIT_MAKER price < Last Traded Price < stopPrice, SELL: LIMIT_MAKER price > Last Traded Price > stopPrice |
| “OCO orders are not supported for this symbol” | OCO is not enabled on the symbol. |
| “Quote order qty market orders are not supported for this symbol.” | MARKET orders using the parameter quoteOrderQty are not enabled on the symbol. |
| “Trailing stop orders are not supported for this symbol.” | Orders using trailingDelta are not enabled on the symbol. |
| “Order cancel-replace is not supported for this symbol.” | POST /api/v3/order/cancelReplace (REST API) or order.cancelReplace (WebSocket API) is not enabled on the symbol. |
| “This symbol is not permitted for this account.” | Account and symbol do not have the same permissions (e.g., SPOT, MARGIN, etc). |
| “This symbol is restricted for this account.” | Account is unable to trade on that symbol (e.g., an ISOLATED_MARGIN account cannot place SPOT orders). |
| “Order was not canceled due to cancel restrictions.” | Either cancelRestrictions was set to ONLY_NEW but the order status was not NEW, or cancelRestrictions was set to ONLY_PARTIALLY_FILLED but the order status was not PARTIALLY_FILLED. |
| “Rest API trading is not enabled.” / “WebSocket API trading is not enabled.” | The order is being placed on a server that is not configured to allow access to TRADE endpoints. |
| “Order book liquidity is less than LOT_SIZE filter minimum quantity.” | Quote quantity market orders cannot be placed when the order book liquidity is less than the minimum quantity configured for the LOT_SIZE filter. |
| “Order book liquidity is less than MARKET_LOT_SIZE filter minimum quantity.” | Quote quantity market orders cannot be placed when the order book liquidity is less than the minimum quantity for the MARKET_LOT_SIZE filter. |
| “Order book liquidity is less than symbol minimum quantity.” | Quote quantity market orders cannot be placed when there are no orders on the book. |
Errors regarding POST /api/v3/order/cancelReplace
- 2021 Order cancel-replace partially failed This code is sent when either the cancellation of the order failed or the new order placement failed but not both.
- 2022 Order cancel-replace failed This code is sent when both the cancellation of the order failed and the new order placement failed.
Filter failures
| Error Message | Description |
|---|---|
| “Filter failure: PRICE_FILTER” | price is too high, too low, and/or not following the tick size rule for the symbol. |
| “Filter failure: PERCENT_PRICE” | price is X% too high or X% too low from the average weighted price over the last Y minutes. |
| “Filter failure: LOT_SIZE” | quantity is too high, too low, and/or not following the step size rule for the symbol. |
| “Filter failure: MIN_NOTIONAL” | price * quantity is too low to be a valid order for the symbol. |
| “Filter failure: NOTIONAL” | price * quantity is not within the range of minNotional and maxNotional. |
| “Filter failure: ICEBERG_PARTS” | ICEBERG order would break into too many parts; icebergQty is too small. |
| “Filter failure: MARKET_LOT_SIZE” | MARKET 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 limit. This includes the sum of the base asset balance and all open BUY orders’ quantity. |
| “Filter failure: MAX_NUM_ORDERS” | The account has too many open orders on the symbol. |
| “Filter failure: MAX_NUM_ALGO_ORDERS” | The account has too many open stop loss and/or take profit orders on the symbol. |
| “Filter failure: MAX_NUM_ICEBERG_ORDERS” | The account has too many open iceberg orders on the symbol. |
| “Filter failure: TRAILING_DELTA” | trailingDelta is not within the defined range of the filter for that order type. |
| “Filter failure: EXCHANGE_MAX_NUM_ORDERS” | The account has too many open orders on the exchange. |
| “Filter failure: EXCHANGE_MAX_NUM_ALGO_ORDERS” | The account has too many open stop loss and/or take profit orders on the exchange. |
| “Filter failure: EXCHANGE_MAX_NUM_ICEBERG_ORDERS” | The account has too many open iceberg orders on the exchange. |
General Information on Endpoints
Binance API Link: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-information-on-endpoints
For GET endpoints, parameters must be sent as a query string.
For POST, PUT, and DELETE endpoints, the parameters may be sent as a query string or in the request body
with content type application/x-www-form-urlencoded. You may mix parameters
between both the query string 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 query string parameter will be used.
LIMITS
Binance API Link: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/limits
General Info on Limits
-
IntervalLetter Values:
SECOND=>SMINUTE=>MHOUR=>HDAY=>D
-
IntervalNum:
- The combination of
intervalNumandintervalLetterrepresents a time interval. Example:intervalNum 5andintervalLetter M=> “Every 5 minutes.”
- The combination of
-
Rate Limits:
- The
rateLimitsarray in/api/v3/exchangeInfodefines the exchange’s limits forRAW_REQUESTS,REQUEST_WEIGHT, andORDERS. - These limits are detailed in the Rate limiters (
rateLimitType) section.
- The
-
HTTP 429 Error:
- Returned when you exceed the request rate limit.
IP Limits
-
Each response header includes
X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter), which indicates the current weight used for your IP. -
Each endpoint has a weight value:
- Heavier operations and operations involving multiple symbols carry higher weights.
-
When a 429 Error is received:
- Pause requests instead of spamming the API.
-
Rate Limit Violations:
- Repeated violations result in an automatic IP ban:
- An HTTP 418 status code is returned.
- Ban durations increase with repeated violations (2 minutes to 3 days).
- Repeated violations result in an automatic IP ban:
-
Retry-After Header:
- In a
429response, it specifies how long to wait before retrying to avoid exceeding limits. - In a
418response, it indicates the time remaining until the ban is lifted.
- In a
-
API Limits:
- Limits are based on the IP address, not the API key.
Unfilled Order Count
-
Each successful order response includes the
X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)header. This header indicates how many orders you have placed within a specific time interval. -
Unfilled Order Rules:
- Responses for rejected or unfilled orders are not guaranteed.
- When the limit is exceeded:
- A 429 Error is returned (without a Retry-After header).
- If you have continuously unfilled orders, you can continue placing orders via the API. For more information: Spot Unfilled Order Count Rules.
-
Account Tracking:
- The unfilled order count is tracked separately for each account.
RCXT Binance API Information
Binance exchange has 3 Base Endpoints:
- apiUrl:
api.binance.com - fapiUrl:
fapi.binance.com - dapiUrl:
dapi.binance.com
Rate Limits
On the Binance exchange, rate limits are determined on an endpoint-by-endpoint basis.
The rate limit for each Base Endpoint is set as follows:
| API Type | Limit (1 Minute) |
|---|---|
| apiUrl | 6,000 Request Weight |
| fapiUrl | 2,400 Request Weight |
| dapiUrl | 2,400 Request Weight |
On the Binance exchange, the rate limit for each endpoint is set as follows:
| Limit (1 Minute) | Spot | Margin | Usd Futures | Coin Futures | Isolated Margin | Earn |
|---|---|---|---|---|---|---|
| Fetch Balances | 20 Request Weight | 10 Request Weight | 5 Request Weight | 1 Request Weight | 10 Request Weight | 150 Request Weight |
| Fetch Trades | 20 Request Weight | 10 Request Weight | 5 Request Weight | 41 Request Weight | ||
| Fetch Orders | 40 Request Weight | 230 Request Weight | 10 Request Weight | 50 Request Weight | 5 Request Weight |
| Limit (1 Minute) | FiatBuyFiatSell | DepositWithdrawal | TransferIn | TransferOut |
|---|---|---|---|---|
| Fetch DepositWithdrawals | 1 Request Weight | 90000 Request Weight(UID) | 1 Request Weight | 18000 Request Weight(UID) |
- UID (User Identifier) is a unique identification number that uniquely identifies each user. In the Binance API, a specific rate limit is applied to user requests, and this limit is determined specifically for each user based on their UID.
Fetch Balances
To withdraw locked balance, the locked parameter must be set to iMargin. In this case, the Isolated Margin balance will be retrieved.
"iMargin": If theisLockedparameter is specified as"iMargin", only the"Isolated Margin"balance will be retrieved.
Spot Balance
- The Base Endpoint is
apiUrl(api.binance.com). - The Endpoint used is
/api/v3/account. - The RCXT Endpoint is
api/v1/binance/balances.
To query Binance wallet balances, the user sends a GET request.
This request must include the necessary header and query parameters:
-
The
apiKeyandsecretKeyvalues are taken from the header. -
The
isLockedvalue is taken from the query parameters. -
Limiter:
- Each API endpoint has an assigned Request Weight value. The Request Weight for Spot Balance is 20.
Margin Balance
- The Base Endpoint is
apiUrl(api.binance.com). - The Endpoint used is
/sapi/v1/margin/account. - The RCXT Endpoint is
api/v1/binance/balances.
To query Binance wallet balances, the user sends a GET request.
This request must include the necessary header and query parameters:
-
The
apiKeyandsecretKeyvalues are taken from the header. -
The
isLockedvalue is taken from the query parameters. -
Limiter:
- Each API endpoint has an assigned Request Weight value. The Request Weight for Margin Balance is 10.
Isolated Margin Balance
- The Base Endpoint is
apiUrl(api.binance.com). - The Endpoint used is
/sapi/v1/margin/isolated/account. - The RCXT Endpoint is
api/v1/binance/balances.
To query Binance wallet balances, the user sends a GET request.
This request must include the necessary header and query parameters:
-
The
apiKeyandsecretKeyvalues are taken from the header. -
The
isLockedvalue is taken from the query parameters. -
Limiter:
- Each API endpoint has an assigned Request Weight value. The Request Weight for Isolated Margin Balance is 10.
USD Futures Balance
- The Base Endpoint is
fapiUrl(fapi.binance.com). - The Endpoint used is
/fapi/v2/balance. - The RCXT Endpoint is
api/v1/binance/balances.
To query Binance wallet balances, the user sends a GET request.
This request must include the necessary header and query parameters:
-
The
apiKeyandsecretKeyvalues are taken from the header. -
The
isLockedvalue is taken from the query parameters. -
Limiter:
- Each API endpoint has an assigned Request Weight value. The Request Weight for USD Futures Balance is 5.
Coin Futures Balance
- The Base Endpoint is
dapiUrl(dapi.binance.com). - The Endpoint used is
/dapi/v1/balance. - The RCXT Endpoint is
api/v1/binance/balances.
To query Binance wallet balances, the user sends a GET request.
This request must include the necessary header and query parameters:
-
The
apiKeyandsecretKeyvalues are taken from the header. -
The
isLockedvalue is taken from the query parameters. -
Limiter:
- Each API endpoint has an assigned Request Weight value. The Request Weight for Coin Futures Balance is 1.
Earn Balance
- The Base Endpoint is
apiUrl(api.binance.com). - The Endpoints used are
/sapi/v1/simple-earn/flexible/positionand/sapi/v1/simple-earn/locked/position. - The RCXT Endpoint is
api/v1/binance/balances.
To query Binance wallet balances, the user sends a GET request.
This request must include the necessary header and query parameters:
-
The
apiKeyandsecretKeyvalues are taken from the header. -
The
isLockedvalue is taken from the query parameters. -
Limiter:
- Each API endpoint has an assigned Request Weight value. The Request Weight for Earn Balance is 150.
Response Example:
{
"spot": [
{
"coin": "BTTC", #asset
"total": "208850.4"
}
],
"margin": [
{
"coin": "DOGE", #asset
"total": "0.00399992"
}
],
"isolatedMargin": [
{
"coin": "DOGE", #asset
"total": "20.55645083"
}
],
"futures": [
{
"coin": "USDT", #asset
"total": "0.03733590"
},
{
"coin": "DOGE", #asset
"total": "2000.00000000"
}
],
"earnings": [
{
"coin": "BNB", #asset
"total": "0.07886113"
}
]
}Fetch Trades
Spot Trades
-
The Base Endpoint is
apiUrl(api.binance.com). -
The Endpoint used is
/api/v3/myTrades. -
The RCXT Endpoint is
api/v1/binance/trades. -
The
apiKeyandsecretKeyvalues are taken from the header. -
The following query parameters are used:
startTime,symbol,fromId, andtype:startTime: Specifies the starting date from which to retrieve data.symbol: Determines which trading pair transactions to fetch (e.g., BTCUSDT).fromId: Used to retrieve a specific trade by its ID.type: The available values are spot, margin, imargin, cfutures, and ufutures. For Spot Trades, spot must be selected.
-
Limiter:
- Each API endpoint has an assigned Request Weight value. The Request Weight for Spot Trades is 20.
- A maximum of 1000 records can be retrieved per page.
Margin Trades
-
The Base Endpoint is
apiUrl(api.binance.com). -
The Endpoint used is
/sapi/v1/margin/myTrades. -
The RCXT Endpoint is
api/v1/binance/trades. -
The
apiKeyandsecretKeyvalues are taken from the header. -
The following query parameters are used:
startTime,symbol,fromId, andtype:startTime: Specifies the starting date from which to retrieve data.symbol: Determines which trading pair transactions to fetch (e.g., BTCUSDT).fromId: Used to retrieve a specific trade by its ID.type: The available values are spot, margin, imargin, cfutures, and ufutures. For Margin Trades, margin must be selected.
-
Limiter:
- Each API endpoint has an assigned Request Weight value. The Request Weight for Margin Trades is 10.
- A maximum of 1000 records can be retrieved per page.
USD Futures Trades
-
The Base Endpoint is
fapiUrl(fapi.binance.com). -
The Endpoint used is
/fapi/v1/userTrades. -
The RCXT Endpoint is
api/v1/binance/trades. -
The
apiKeyandsecretKeyvalues are taken from the header. -
The following query parameters are used:
startTime,symbol,fromId, andtype:startTime: Specifies the starting date from which to retrieve data.symbol: Determines which trading pair transactions to fetch (e.g., BTCUSDT).fromId: Used to retrieve a specific trade by its ID.type: The available values are spot, margin, imargin, cfutures, and ufutures. For USD Futures Trades, ufutures must be selected.
-
Limiter:
- Each API endpoint has an assigned Request Weight value. The Request Weight for USD Futures Trades is 5.
- A maximum of 1000 records can be retrieved per page.
Coin Futures Trades
-
The Base Endpoint is
dapiUrl(dapi.binance.com). -
The Endpoint used is
/dapi/v1/userTrades. -
The RCXT Endpoint is
api/v1/binance/trades. -
The
apiKeyandsecretKeyvalues are taken from the header. -
The following query parameters are used:
startTime,symbol,fromId, andtype:startTime: Specifies the starting date from which to retrieve data.symbol: Determines which trading pair transactions to fetch (e.g., BTCUSDT).fromId: Used to retrieve a specific trade by its ID.type: The available values are spot, margin, imargin, cfutures, and ufutures. For Coin Futures Trades, cfutures must be selected.
-
Limiter:
- Each API endpoint has an assigned Request Weight value. The Request Weight for Coin Futures Trades is 41.
- A maximum of 1000 records can be retrieved per page.
Response Example:
{
"trades": [
{
"orderId": "226664511", #orderId
"tradeId": "27082209", #id
"isBuyer": false, #isBuyer
"isMaker": false, #isMaker
"price": "0.07610000", #price
"quantity": "199.90000000", #qty
"symbol": "ACAUSDT", #symbol
"time": 1737552748284, #time
"commission": "0.01521239", #commission
"commissionCurrency": "USDT" #commissionAsset
}
],
"cursor": ""
}Fetch Orders
Spot Orders
-
The Base Endpoint is
apiUrl(api.binance.com). -
The Endpoint used is
/api/v3/allOrders. -
The RCXT Endpoint is
api/v1/binance/orders. -
apiKeyandsecretKeyvalues are taken from the header. -
Query parameters include
startTime,endTime,symbol,orderId,singleOrderId,type, andorderStatus:startTime: The date from which we want to fetch the data.endTime: The date until which we want to fetch the data.symbol: The symbol pair for which we placed the order (e.g., BTCUSDT).orderId: Used to filter by a specific order ID.singleOrderId: Used to filter by a single order ID.type: Possible values are spot, margin, imargin, cfutures, and ufutures. For Spot Orders, spot should be selected.orderStatus: IforderStatusis “open”, it fetches Open Orders; if “closed”, it fetches Closed Orders.
-
Limiter:
- Each API endpoint has a specific Request Weight assigned. The Request Weight for Spot Orders is 40.
- A maximum of 1000 records can be retrieved per page.
Spot Open Orders
-
The Base Endpoint is
apiUrl(api.binance.com). -
The Endpoint used is
/api/v3/openOrders. -
The RCXT Endpoint is
api/v1/binance/orders. -
apiKeyandsecretKeyvalues are taken from the header. -
Query parameters include
startTime,endTime,symbol,orderId,singleOrderId,type, andorderStatus:startTime: The date from which we want to fetch the data.endTime: The date until which we want to fetch the data.symbol: The symbol pair for which we placed the order (e.g., BTCUSDT).orderId: Used to filter by a specific order ID.singleOrderId: Used to filter by a single order ID.type: Possible values are spot, margin, imargin, ufutures, and cfutures. For Spot Open Orders, spot should be selected.orderStatus: IforderStatusis “open”, it fetches Open Orders; if “closed”, it fetches Closed Orders.
-
Limiter:
- Each API endpoint has a specific Request Weight assigned. The Request Weight for Spot Open Orders is 40.
Margin Orders
-
The Base Endpoint is
apiUrl(api.binance.com). -
The Endpoint used is
/sapi/v1/margin/allOrders. -
The RCXT Endpoint is
api/v1/binance/orders. -
apiKeyandsecretKeyvalues are taken from the header. -
Query parameters include
startTime,endTime,symbol,orderId,singleOrderId,type, andorderStatus:startTime: The date from which we want to fetch the data.endTime: The date until which we want to fetch the data.symbol: The symbol pair for which we placed the order (e.g., BTCUSDT).orderId: Used to filter by a specific order ID.singleOrderId: Used to filter by a single order ID.type: Possible values are spot, margin, imargin, ufutures, and cfutures. For Margin Orders, margin should be selected.orderStatus: IforderStatusis “open”, it fetches Open Orders; if “closed”, it fetches Closed Orders.
-
Limiter:
- Each API endpoint has a specific Request Weight assigned. The Request Weight for Margin Orders is 230.
- A maximum of 500 records can be retrieved per page.
Margin Open Orders
-
The Base Endpoint is
apiUrl(api.binance.com). -
The Endpoint used is
/sapi/v1/margin/openOrders. -
The RCXT Endpoint is
api/v1/binance/orders. -
apiKeyandsecretKeyvalues are taken from the header. -
Query parameters include
startTime,endTime,symbol,orderId,singleOrderId,type, andorderStatus:startTime: The date from which we want to fetch the data.endTime: The date until which we want to fetch the data.symbol: The symbol pair for which we placed the order (e.g., BTCUSDT).orderId: Used to filter by a specific order ID.singleOrderId: Used to filter by a single order ID.type: Possible values are spot, margin, imargin, cfutures, and ufutures. For Margin Open Orders, margin should be selected.orderStatus: IforderStatusis “open”, it fetches Open Orders; if “closed”, it fetches Closed Orders.
-
Limiter:
- Each API endpoint has a specific Request Weight assigned. The Request Weight for Margin Open Orders is 230.
Isolated Margin Orders
-
The Base Endpoint is
apiUrl(api.binance.com). -
The Endpoint used is
/sapi/v1/margin/allOrders. -
The RCXT Endpoint is
api/v1/binance/orders. -
apiKeyandsecretKeyvalues are taken from the header. -
Query parameters include
startTime,endTime,symbol,orderId,singleOrderId,type, andorderStatus:startTime: The date from which we want to fetch the data.endTime: The date until which we want to fetch the data.symbol: The symbol pair for which we placed the order (e.g., BTCUSDT).orderId: Used to filter by a specific order ID.singleOrderId: Used to filter by a single order ID.type: Possible values are spot, margin, imargin, ufutures, and cfutures. For Isolated Margin Orders, imargin should be selected.orderStatus: IforderStatusis “open”, it fetches Open Orders; if “closed”, it fetches Closed Orders.
-
Limiter:
- Each API endpoint has a specific Request Weight assigned. The Request Weight for Isolated Margin Orders is 230.
- A maximum of 500 records can be retrieved per page.
Isolated Margin Open Orders
-
The Base Endpoint is
apiUrl(api.binance.com). -
The Endpoint used is
/sapi/v1/margin/openOrders. -
The RCXT Endpoint is
api/v1/binance/orders. -
apiKeyandsecretKeyvalues are taken from the header. -
Query parameters include
startTime,endTime,symbol,orderId,singleOrderId,type, andorderStatus:startTime: The date from which we want to fetch the data.endTime: The date until which we want to fetch the data.symbol: The symbol pair for which we placed the order (e.g., BTCUSDT).orderId: Used to filter by a specific order ID.singleOrderId: Used to filter by a single order ID.type: Possible values are spot, margin, imargin, ufutures, and cfutures. For Isolated Margin Open Orders, imargin should be selected.orderStatus: IforderStatusis “open”, it fetches Open Orders; if “closed”, it fetches Closed Orders.
-
Limiter:
- Each API endpoint has a specific Request Weight assigned. The Request Weight for Isolated Margin Open Orders is 230.
Usd Futures Orders
-
The Base Endpoint is
fapiUrl(fapi.binance.com). -
The Endpoint used is
/fapi/v1/allOrders. -
The RCXT Endpoint is
api/v1/binance/orders. -
apiKeyandsecretKeyvalues are taken from the header. -
Query parameters include
startTime,endTime,symbol,orderId,singleOrderId,type, andorderStatus:startTime: The date from which we want to fetch the data.endTime: The date until which we want to fetch the data.symbol: The symbol pair for which we placed the order (e.g., BTCUSDT).orderId: Used to filter by a specific order ID.singleOrderId: Used to filter by a single order ID.type: Possible values are spot, margin, imargin, ufutures, and cfutures. For Usd Futures Orders, ufutures should be selected.orderStatus: IforderStatusis “open”, it fetches Open Orders; if “closed”, it fetches Closed Orders.
-
Limiter:
- Each API endpoint has a specific Request Weight assigned. The Request Weight for Usd Futures Orders is 10.
- A maximum of 1000 records can be retrieved per page.
Usd Futures Open Orders
-
The Base Endpoint is
fapiUrl(fapi.binance.com). -
The Endpoint used is
/fapi/v1/openOrders. -
The RCXT Endpoint is
api/v1/binance/orders. -
apiKeyandsecretKeyvalues are taken from the header. -
Query parameters include
startTime,endTime,symbol,orderId,singleOrderId,type, andorderStatus:startTime: The date from which we want to fetch the data.endTime: The date until which we want to fetch the data.symbol: The symbol pair for which we placed the order (e.g., BTCUSDT).orderId: Used to filter by a specific order ID.singleOrderId: Used to filter by a single order ID.type: Possible values are spot, margin, imargin, ufutures, and cfutures. For Usd Futures Open Orders, ufutures should be selected.orderStatus: IforderStatusis “open”, it fetches Open Orders; if “closed”, it fetches Closed Orders.
-
Limiter:
- Each API endpoint has a specific Request Weight assigned. The Request Weight for Usd Futures Open Orders is 10.
Coin Futures Orders
-
The Base Endpoint is
dapiUrl(dapi.binance.com). -
The Endpoint used is
/dapi/v1/allOrders. -
The RCXT Endpoint is
api/v1/binance/orders. -
apiKeyandsecretKeyvalues are taken from the header. -
Query parameters include
startTime,endTime,symbol,orderId,singleOrderId,type, andorderStatus:startTime: The date from which we want to fetch the data.endTime: The date until which we want to fetch the data.symbol: The symbol pair for which we placed the order (e.g., BTCUSDT).orderId: Used to filter by a specific order ID.singleOrderId: Used to filter by a single order ID.type: Possible values are spot, margin, imargin, ufutures, and cfutures. For Coin Futures Orders, cfutures should be selected.orderStatus: IforderStatusis “open”, it fetches Open Orders; if “closed”, it fetches Closed Orders.
-
Limiter:
- Each API endpoint has a specific Request Weight assigned. The Request Weight for Coin Futures Orders is 50.
- A maximum of 100 records can be retrieved per page.
Coin Futures Open Orders
-
The Base Endpoint is
dapiUrl(dapi.binance.com). -
The Endpoint used is
/dapi/v1/openOrders. -
The RCXT Endpoint is
api/v1/binance/orders. -
apiKeyandsecretKeyvalues are taken from the header. -
Query parameters include
startTime,endTime,symbol,orderId,singleOrderId,type, andorderStatus:startTime: The date from which we want to fetch the data.endTime: The date until which we want to fetch the data.symbol: The symbol pair for which we placed the order (e.g., BTCUSDT).orderId: Used to filter by a specific order ID.singleOrderId: Used to filter by a single order ID.type: Possible values are spot, margin, imargin, ufutures, and cfutures. For Coin Futures Open Orders, cfutures should be selected.orderStatus: IforderStatusis “open”, it fetches Open Orders; if “closed”, it fetches Closed Orders.
-
Limiter:
- Each API endpoint has a specific Request Weight assigned. The Request Weight for Coin Futures Open Orders is 50.
Response Example:
{
"orders": [
{
"orderId": "226664511", #orderId
"symbol": "ACAUSDT", #symbol
"type": "MARKET", #type
"price": "0", #price
"side": "SELL", #side
"time": 1737552748284, #time
"status": "CLOSED", #status
"executedQuantity": "199.90000000", #executedQty
"quantity": "199.90000000" #origQty
}
],
"cursor": ""
}Fetch DepositsWithdrawals
FiatBuy FiatSell
-
The Base Endpoint is
apiUrl(api.binance.com). -
The Endpoint used is
/sapi/v1/fiat/payments. -
The RCXT Endpoint is
api/v1/binance/deposit-withdraw-history. -
apiKeyandsecretKeyvalues are taken from the header. -
Query parameters include
startTime,offset,page, andtype:startTime: The date from which we want to fetch the data.offset: A parameter specifying how many records to skip in the transaction list. This is used for pagination.page: Used for pagination, specifies which page to retrieve.type: Possible values are fiatbuy, fiatsell, deposit, withdrawal, transferIn, and transferOut. For FiatBuy, fiatbuy should be selected, and for FiatSell, fiatsell should be selected.
-
Limiter:
- Each API endpoint has a specific Request Weight assigned. The Request Weight for FiatBuyFiatSell is 1.
- A maximum of 100 records can be retrieved per page.
Fiat DepositsWithdrawals
-
The Base Endpoint is
apiUrl(api.binance.com). -
The Endpoint used is
/sapi/v1/fiat/orders. -
The RCXT Endpoint is
api/v1/binance/deposit-withdraw-history. -
apiKeyandsecretKeyvalues are taken from the header. -
Query parameters include
startTime,offset,page, andtype:startTime: The date from which we want to fetch the data.offset: A parameter specifying how many records to skip in the transaction list. This is used for pagination.page: Used for pagination, specifies which page to retrieve.type: Possible values are fiatbuy, fiatsell, deposit, withdrawal, transferIn, and transferOut. For Deposit, deposit should be selected, and for Withdrawal, withdrawal should be selected.
-
Limiter:
- Each API endpoint has a specific Request Weight assigned. The Request Weight (UID) for DepositWithdrawals is 90000.
- A maximum of 500 records can be retrieved per page.
TransferIn
-
The Base Endpoint is
apiUrl(api.binance.com). -
The Endpoint used is
/sapi/v1/capital/deposit/hisrec. -
The RCXT Endpoint is
api/v1/binance/deposit-withdraw-history. -
apiKeyandsecretKeyvalues are taken from the header. -
Query parameters include
startTime,offset,page, andtype:startTime: The date from which we want to fetch the data.offset: A parameter specifying how many records to skip in the transaction list. This is used for pagination.page: Used for pagination, specifies which page to retrieve.type: Possible values are fiatbuy, fiatsell, deposit, withdrawal, transferIn, and transferOut. For Transfer In, transferIn should be selected.
-
Limiter:
- Each API endpoint has a specific Request Weight assigned. The Request Weight for TransferIn is 1.
- A maximum of 1000 records can be retrieved per page.
TransferOut
-
The Base Endpoint is
apiUrl(api.binance.com). -
The Endpoint used is
/sapi/v1/capital/withdraw/history. -
The RCXT Endpoint is
api/v1/binance/deposit-withdraw-history. -
apiKeyandsecretKeyvalues are taken from the header. -
Query parameters include
startTime,offset,page, andtype:startTime: The date from which we want to fetch the data.offset: A parameter specifying how many records to skip in the transaction list. This is used for pagination.page: Used for pagination, specifies which page to retrieve.type: Possible values are fiatbuy, fiatsell, deposit, withdrawal, transferIn, and transferOut. For Transfer Out, transferOut should be selected.
-
Limiter:
- Each API endpoint has a specific Request Weight assigned. The Request Weight (UID) for TransferOut is 18000.
- A maximum of 1000 records can be retrieved per page.
Response Example:
{
"depositWithdrawals": [
{
"fiatCurrency": "", #fiatCurrency
"cryptoCurrency": "ACA", #cryptoCurrency , coin
"fiatAmount": "", #amount , sourceAmount
"cryptoAmount": "199.9", #amount , obtainAmount
"price": "", #price
"address": "21Pau9weZ19NtbojGKnjFUDd2RZ4mpMMFqfYeYHmHLxV9ncr", #address
"orderId": "", #orderNo
"transactionId": "4355261931473846528", #id
"fee": "", #totalFee
"network": "ACA", #network
"status": "1", #status
"time": 1737552240000 #insertTime , completeTime
}
],
"cursor": ""
}Fetch Ticker
Ticker
-
The Base Endpoint is
apiUrl(api.binance.com). -
The Endpoint used is
/api/v3/ticker/price. -
The RCXT Endpoint is
api/v1/binance/ticker. -
api.binance.com/api/v3/ticker/price: Returns the symbol and the current price of each cryptocurrency pair. -
The query parameter used is only the
symbolvalue (for example: BTCUSDT).symbol: Specifies the symbol of the cryptocurrency pair.
Response Example:
{
"symbol": "BTCUSDT", #symbol
"price": "104562.53000000" #price
}