|
Binance C++ Connector 2.0.0
Official C++ connectors for the Binance APIs
|
Spot REST API client. More...
#include <rest_api.hpp>
Public Member Functions | |
| RestApi (common::RestApiConfig configuration) | |
| Throws common::ConfigError if the configuration is invalid. | |
| const common::RestApiConfig & | configuration () const noexcept |
| template<class T> | |
| common::RestApiResponse< T > | send_request (std::string endpoint, common::HttpMethod method, common::Params query={}, common::Params body={}) const |
| Calls an endpoint the SDK does not wrap yet. T may be boost::json::value. | |
| template<class T> | |
| common::RestApiResponse< T > | send_signed_request (std::string endpoint, common::HttpMethod method, common::Params query={}, common::Params body={}) const |
| Like send_request, but signed (adds timestamp and signature). | |
| template<class T, class CompletionToken> | |
| auto | async_send_request (std::string endpoint, common::HttpMethod method, common::Params query, common::Params body, CompletionToken &&token) const |
| template<class T, class CompletionToken> | |
| auto | async_send_signed_request (std::string endpoint, common::HttpMethod method, common::Params query, common::Params body, CompletionToken &&token) const |
| common::RestApiResponse< AccountCommissionResponse > | account_commission (const AccountCommissionParams ¶ms) const |
| Query Commission Rates (USER_DATA). | |
| template<class CompletionToken> | |
| auto | async_account_commission (const AccountCommissionParams ¶ms, CompletionToken &&token) const |
| Asynchronous account_commission(). | |
| common::RestApiResponse< std::vector< AllOrderListResponseInner > > | all_order_list (const AllOrderListParams ¶ms={}) const |
| Query all Order lists (USER_DATA). | |
| template<class CompletionToken> | |
| auto | async_all_order_list (const AllOrderListParams ¶ms, CompletionToken &&token) const |
| Asynchronous all_order_list(). | |
| common::RestApiResponse< std::vector< AllOrdersResponseInner > > | all_orders (const AllOrdersParams ¶ms) const |
| All orders (USER_DATA). | |
| template<class CompletionToken> | |
| auto | async_all_orders (const AllOrdersParams ¶ms, CompletionToken &&token) const |
| Asynchronous all_orders(). | |
| common::RestApiResponse< GetAccountResponse > | get_account (const GetAccountParams ¶ms={}) const |
| Account information (USER_DATA). | |
| template<class CompletionToken> | |
| auto | async_get_account (const GetAccountParams ¶ms, CompletionToken &&token) const |
| Asynchronous get_account(). | |
| common::RestApiResponse< std::vector< GetOpenOrdersResponseInner > > | get_open_orders (const GetOpenOrdersParams ¶ms={}) const |
| Current open orders (USER_DATA). | |
| template<class CompletionToken> | |
| auto | async_get_open_orders (const GetOpenOrdersParams ¶ms, CompletionToken &&token) const |
| Asynchronous get_open_orders(). | |
| common::RestApiResponse< GetOrderResponse > | get_order (const GetOrderParams ¶ms) const |
| Query order (USER_DATA). | |
| template<class CompletionToken> | |
| auto | async_get_order (const GetOrderParams ¶ms, CompletionToken &&token) const |
| Asynchronous get_order(). | |
| common::RestApiResponse< GetOrderListResponse > | get_order_list (const GetOrderListParams ¶ms={}) const |
| Query Order list (USER_DATA). | |
| template<class CompletionToken> | |
| auto | async_get_order_list (const GetOrderListParams ¶ms, CompletionToken &&token) const |
| Asynchronous get_order_list(). | |
| common::RestApiResponse< std::vector< MyAllocationsResponseInner > > | my_allocations (const MyAllocationsParams ¶ms) const |
| Query Allocations (USER_DATA). | |
| template<class CompletionToken> | |
| auto | async_my_allocations (const MyAllocationsParams ¶ms, CompletionToken &&token) const |
| Asynchronous my_allocations(). | |
| common::RestApiResponse< MyFiltersResponse > | my_filters (const MyFiltersParams ¶ms) const |
| Query relevant filters (USER_DATA). | |
| template<class CompletionToken> | |
| auto | async_my_filters (const MyFiltersParams ¶ms, CompletionToken &&token) const |
| Asynchronous my_filters(). | |
| common::RestApiResponse< std::vector< MyPreventedMatchesResponseInner > > | my_prevented_matches (const MyPreventedMatchesParams ¶ms) const |
| Query Prevented Matches (USER_DATA). | |
| template<class CompletionToken> | |
| auto | async_my_prevented_matches (const MyPreventedMatchesParams ¶ms, CompletionToken &&token) const |
| Asynchronous my_prevented_matches(). | |
| common::RestApiResponse< std::vector< MyTradesResponseInner > > | my_trades (const MyTradesParams ¶ms) const |
| Account trade list (USER_DATA). | |
| template<class CompletionToken> | |
| auto | async_my_trades (const MyTradesParams ¶ms, CompletionToken &&token) const |
| Asynchronous my_trades(). | |
| common::RestApiResponse< std::vector< OpenOrderListResponseInner > > | open_order_list (const OpenOrderListParams ¶ms={}) const |
| Query Open Order lists (USER_DATA). | |
| template<class CompletionToken> | |
| auto | async_open_order_list (const OpenOrderListParams ¶ms, CompletionToken &&token) const |
| Asynchronous open_order_list(). | |
| common::RestApiResponse< std::vector< OrderAmendmentsResponseInner > > | order_amendments (const OrderAmendmentsParams ¶ms) const |
| Query Order Amendments (USER_DATA). | |
| template<class CompletionToken> | |
| auto | async_order_amendments (const OrderAmendmentsParams ¶ms, CompletionToken &&token) const |
| Asynchronous order_amendments(). | |
| common::RestApiResponse< std::vector< RateLimitOrderResponseInner > > | rate_limit_order (const RateLimitOrderParams ¶ms={}) const |
| Query Unfilled Order Count (USER_DATA). | |
| template<class CompletionToken> | |
| auto | async_rate_limit_order (const RateLimitOrderParams ¶ms, CompletionToken &&token) const |
| Asynchronous rate_limit_order(). | |
| common::RestApiResponse< ExchangeInfoResponse > | exchange_info (const ExchangeInfoParams ¶ms={}) const |
| Exchange information. | |
| template<class CompletionToken> | |
| auto | async_exchange_info (const ExchangeInfoParams ¶ms, CompletionToken &&token) const |
| Asynchronous exchange_info(). | |
| common::RestApiResponse< ExecutionRulesResponse > | execution_rules (const ExecutionRulesParams ¶ms={}) const |
| Query Execution Rules. | |
| template<class CompletionToken> | |
| auto | async_execution_rules (const ExecutionRulesParams ¶ms, CompletionToken &&token) const |
| Asynchronous execution_rules(). | |
| common::RestApiResponse< boost::json::value > | ping () const |
| Test connectivity. | |
| template<class CompletionToken> | |
| auto | async_ping (CompletionToken &&token) const |
| Asynchronous ping(). | |
| common::RestApiResponse< TimeResponse > | time () const |
| Check server time. | |
| template<class CompletionToken> | |
| auto | async_time (CompletionToken &&token) const |
| Asynchronous time(). | |
| common::RestApiResponse< std::vector< AggTradesResponseInner > > | agg_trades (const AggTradesParams ¶ms) const |
| Compressed/Aggregate trades list. | |
| template<class CompletionToken> | |
| auto | async_agg_trades (const AggTradesParams ¶ms, CompletionToken &&token) const |
| Asynchronous agg_trades(). | |
| common::RestApiResponse< AvgPriceResponse > | avg_price (const AvgPriceParams ¶ms) const |
| Current average price. | |
| template<class CompletionToken> | |
| auto | async_avg_price (const AvgPriceParams ¶ms, CompletionToken &&token) const |
| Asynchronous avg_price(). | |
| common::RestApiResponse< DepthResponse > | depth (const DepthParams ¶ms) const |
| Order book. | |
| template<class CompletionToken> | |
| auto | async_depth (const DepthParams ¶ms, CompletionToken &&token) const |
| Asynchronous depth(). | |
| common::RestApiResponse< std::vector< GetTradesResponseInner > > | get_trades (const GetTradesParams ¶ms) const |
| Recent trades list. | |
| template<class CompletionToken> | |
| auto | async_get_trades (const GetTradesParams ¶ms, CompletionToken &&token) const |
| Asynchronous get_trades(). | |
| common::RestApiResponse< std::vector< HistoricalBlockTradesResponseInner > > | historical_block_trades (const HistoricalBlockTradesParams ¶ms) const |
| Historical Block Trades (MARKET_DATA). | |
| template<class CompletionToken> | |
| auto | async_historical_block_trades (const HistoricalBlockTradesParams ¶ms, CompletionToken &&token) const |
| Asynchronous historical_block_trades(). | |
| common::RestApiResponse< std::vector< GetTradesResponseInner > > | historical_trades (const HistoricalTradesParams ¶ms) const |
| Old trade lookup. | |
| template<class CompletionToken> | |
| auto | async_historical_trades (const HistoricalTradesParams ¶ms, CompletionToken &&token) const |
| Asynchronous historical_trades(). | |
| common::RestApiResponse< std::vector< std::vector< KlinesItemInner > > > | klines (const KlinesParams ¶ms) const |
| Kline/Candlestick data. | |
| template<class CompletionToken> | |
| auto | async_klines (const KlinesParams ¶ms, CompletionToken &&token) const |
| Asynchronous klines(). | |
| common::RestApiResponse< ReferencePriceResponse > | reference_price (const ReferencePriceParams ¶ms) const |
| Query Reference Price. | |
| template<class CompletionToken> | |
| auto | async_reference_price (const ReferencePriceParams ¶ms, CompletionToken &&token) const |
| Asynchronous reference_price(). | |
| common::RestApiResponse< ReferencePriceCalculationResponse > | reference_price_calculation (const ReferencePriceCalculationParams ¶ms) const |
| Query Reference Price Calculation. | |
| template<class CompletionToken> | |
| auto | async_reference_price_calculation (const ReferencePriceCalculationParams ¶ms, CompletionToken &&token) const |
| Asynchronous reference_price_calculation(). | |
| common::RestApiResponse< TickerResponse > | ticker (const TickerParams ¶ms={}) const |
| Rolling window price change statistics. | |
| template<class CompletionToken> | |
| auto | async_ticker (const TickerParams ¶ms, CompletionToken &&token) const |
| Asynchronous ticker(). | |
| common::RestApiResponse< Ticker24hrResponse > | ticker24hr (const Ticker24hrParams ¶ms={}) const |
| 24hr ticker price change statistics | |
| template<class CompletionToken> | |
| auto | async_ticker24hr (const Ticker24hrParams ¶ms, CompletionToken &&token) const |
| Asynchronous ticker24hr(). | |
| common::RestApiResponse< TickerBookTickerResponse > | ticker_book_ticker (const TickerBookTickerParams ¶ms={}) const |
| Symbol order book ticker. | |
| template<class CompletionToken> | |
| auto | async_ticker_book_ticker (const TickerBookTickerParams ¶ms, CompletionToken &&token) const |
| Asynchronous ticker_book_ticker(). | |
| common::RestApiResponse< TickerPriceResponse > | ticker_price (const TickerPriceParams ¶ms={}) const |
| Symbol price ticker. | |
| template<class CompletionToken> | |
| auto | async_ticker_price (const TickerPriceParams ¶ms, CompletionToken &&token) const |
| Asynchronous ticker_price(). | |
| common::RestApiResponse< TickerTradingDayResponse > | ticker_trading_day (const TickerTradingDayParams ¶ms={}) const |
| Trading Day Ticker. | |
| template<class CompletionToken> | |
| auto | async_ticker_trading_day (const TickerTradingDayParams ¶ms, CompletionToken &&token) const |
| Asynchronous ticker_trading_day(). | |
| common::RestApiResponse< std::vector< std::vector< KlinesItemInner > > > | ui_klines (const UiKlinesParams ¶ms) const |
| UIKlines. | |
| template<class CompletionToken> | |
| auto | async_ui_klines (const UiKlinesParams ¶ms, CompletionToken &&token) const |
| Asynchronous ui_klines(). | |
| common::RestApiResponse< std::vector< DeleteOpenOrdersResponseInner > > | delete_open_orders (const DeleteOpenOrdersParams ¶ms) const |
| Cancel All Open Orders on a Symbol (TRADE). | |
| template<class CompletionToken> | |
| auto | async_delete_open_orders (const DeleteOpenOrdersParams ¶ms, CompletionToken &&token) const |
| Asynchronous delete_open_orders(). | |
| common::RestApiResponse< DeleteOrderResponse > | delete_order (const DeleteOrderParams ¶ms) const |
| Cancel order (TRADE). | |
| template<class CompletionToken> | |
| auto | async_delete_order (const DeleteOrderParams ¶ms, CompletionToken &&token) const |
| Asynchronous delete_order(). | |
| common::RestApiResponse< NewOrderResponse > | new_order (const NewOrderParams ¶ms) const |
| New order (TRADE). | |
| template<class CompletionToken> | |
| auto | async_new_order (const NewOrderParams ¶ms, CompletionToken &&token) const |
| Asynchronous new_order(). | |
| common::RestApiResponse< DeleteOrderListResponse > | delete_order_list (const DeleteOrderListParams ¶ms) const |
| Cancel Order list (TRADE). | |
| template<class CompletionToken> | |
| auto | async_delete_order_list (const DeleteOrderListParams ¶ms, CompletionToken &&token) const |
| Asynchronous delete_order_list(). | |
| common::RestApiResponse< OrderAmendKeepPriorityResponse > | order_amend_keep_priority (const OrderAmendKeepPriorityParams ¶ms) const |
| Order Amend Keep Priority (TRADE). | |
| template<class CompletionToken> | |
| auto | async_order_amend_keep_priority (const OrderAmendKeepPriorityParams ¶ms, CompletionToken &&token) const |
| Asynchronous order_amend_keep_priority(). | |
| common::RestApiResponse< OrderCancelReplaceResponse > | order_cancel_replace (const OrderCancelReplaceParams ¶ms) const |
| Cancel an Existing Order and Send a New Order (TRADE). | |
| template<class CompletionToken> | |
| auto | async_order_cancel_replace (const OrderCancelReplaceParams ¶ms, CompletionToken &&token) const |
| Asynchronous order_cancel_replace(). | |
| common::RestApiResponse< OrderListOcoResponse > | order_list_oco (const OrderListOcoParams ¶ms) const |
| New Order list - OCO (TRADE). | |
| template<class CompletionToken> | |
| auto | async_order_list_oco (const OrderListOcoParams ¶ms, CompletionToken &&token) const |
| Asynchronous order_list_oco(). | |
| common::RestApiResponse< OrderListOpoResponse > | order_list_opo (const OrderListOpoParams ¶ms) const |
| New Order List - OPO (TRADE). | |
| template<class CompletionToken> | |
| auto | async_order_list_opo (const OrderListOpoParams ¶ms, CompletionToken &&token) const |
| Asynchronous order_list_opo(). | |
| common::RestApiResponse< OrderListOpocoResponse > | order_list_opoco (const OrderListOpocoParams ¶ms) const |
| New Order List - OPOCO (TRADE). | |
| template<class CompletionToken> | |
| auto | async_order_list_opoco (const OrderListOpocoParams ¶ms, CompletionToken &&token) const |
| Asynchronous order_list_opoco(). | |
| common::RestApiResponse< OrderListOtoResponse > | order_list_oto (const OrderListOtoParams ¶ms) const |
| New Order list - OTO (TRADE). | |
| template<class CompletionToken> | |
| auto | async_order_list_oto (const OrderListOtoParams ¶ms, CompletionToken &&token) const |
| Asynchronous order_list_oto(). | |
| common::RestApiResponse< OrderListOtocoResponse > | order_list_otoco (const OrderListOtocoParams ¶ms) const |
| New Order list - OTOCO (TRADE). | |
| template<class CompletionToken> | |
| auto | async_order_list_otoco (const OrderListOtocoParams ¶ms, CompletionToken &&token) const |
| Asynchronous order_list_otoco(). | |
| common::RestApiResponse< OrderOcoResponse > | order_oco (const OrderOcoParams ¶ms) const |
| New OCO - Deprecated (TRADE). | |
| template<class CompletionToken> | |
| auto | async_order_oco (const OrderOcoParams ¶ms, CompletionToken &&token) const |
| Asynchronous order_oco(). | |
| common::RestApiResponse< OrderTestResponse > | order_test (const OrderTestParams ¶ms) const |
| Test new order (TRADE). | |
| template<class CompletionToken> | |
| auto | async_order_test (const OrderTestParams ¶ms, CompletionToken &&token) const |
| Asynchronous order_test(). | |
| common::RestApiResponse< SorOrderResponse > | sor_order (const SorOrderParams ¶ms) const |
| New order using SOR (TRADE). | |
| template<class CompletionToken> | |
| auto | async_sor_order (const SorOrderParams ¶ms, CompletionToken &&token) const |
| Asynchronous sor_order(). | |
| common::RestApiResponse< SorOrderTestResponse > | sor_order_test (const SorOrderTestParams ¶ms) const |
| Test new order using SOR (TRADE). | |
| template<class CompletionToken> | |
| auto | async_sor_order_test (const SorOrderTestParams ¶ms, CompletionToken &&token) const |
| Asynchronous sor_order_test(). | |
Static Public Member Functions | |
| static RestApi | from_config (common::RestApiConfig config) |
| A client for config.base_path, production when it is not set. | |
| static RestApi | production (common::RestApiConfig config) |
| A client for production (Spot REST API). | |
| static RestApi | testnet (common::RestApiConfig config) |
| A client for the testnet. | |
| static RestApi | demo (common::RestApiConfig config) |
| A client for the demo environment. | |
Spot REST API client.
Cheap to copy: copies share one common::RestClient (connection pool and executor).
Every endpoint has a blocking form (name(params)) and an asynchronous form (async_name(params, token)) that accepts any Asio completion token.
|
explicit |
Throws common::ConfigError if the configuration is invalid.
|
staticnodiscard |
A client for config.base_path, production when it is not set.
|
staticnodiscard |
A client for production (Spot REST API).
|
staticnodiscard |
A client for the testnet.
|
staticnodiscard |
A client for the demo environment.
|
nodiscardnoexcept |
|
inlinenodiscard |
Calls an endpoint the SDK does not wrap yet. T may be boost::json::value.
|
inlinenodiscard |
Like send_request, but signed (adds timestamp and signature).
|
inline |
|
inline |
|
inlinenodiscard |
Query Commission Rates (USER_DATA).
GET /api/v3/account/commission.
Get current account commission rates.
Weight(IP): 20
Security Type: USER_DATA
Notes: Data Source: Database
|
inline |
Asynchronous account_commission().
|
inlinenodiscard |
Query all Order lists (USER_DATA).
GET /api/v3/allOrderList.
Retrieves all order lists based on provided optional parameters.
Note that the time between startTime and endTime can't be longer than 24 hours.
Weight(IP): 20
Security Type: USER_DATA
Notes: Data Source: Database
|
inline |
Asynchronous all_order_list().
|
inlinenodiscard |
All orders (USER_DATA).
GET /api/v3/allOrders.
Get all account orders; active, canceled, or filled.
Weight(IP): 20
Security Type: USER_DATA
Notes: Data Source: Database
Response Notes: Note: The payload above does not show all fields that can appear. Please refer to Conditional fields in Order Responses.
|
inline |
Asynchronous all_orders().
|
inlinenodiscard |
Account information (USER_DATA).
GET /api/v3/account.
Get current account information.
Weight(IP): 20
Security Type: USER_DATA
Notes: Data Source: Memory => Database
|
inline |
Asynchronous get_account().
|
inlinenodiscard |
Current open orders (USER_DATA).
GET /api/v3/openOrders.
Get all open orders on a symbol. Careful when accessing this with no symbol.
Weight: 6 for a single symbol; 80 when the symbol parameter is omitted
Security Type: USER_DATA
Notes: Data Source: Memory => Database
Response Notes: Note: The payload above does not show all fields that can appear. Please refer to Conditional fields in Order Responses.
|
inline |
Asynchronous get_open_orders().
|
inlinenodiscard |
Query order (USER_DATA).
GET /api/v3/order.
Check an order's status.
Weight(IP): 4
Security Type: USER_DATA
Notes: Data Source: Memory => Database
Response Notes: Note: The payload above does not show all fields that can appear. Please refer to Conditional fields in Order Responses.
|
inline |
Asynchronous get_order().
|
inlinenodiscard |
Query Order list (USER_DATA).
GET /api/v3/orderList.
Retrieves a specific order list based on provided optional parameters.
Weight(IP): 4
Security Type: USER_DATA
Notes: Data Source: Database
|
inline |
Asynchronous get_order_list().
|
inlinenodiscard |
Query Allocations (USER_DATA).
GET /api/v3/myAllocations.
Retrieves allocations resulting from SOR order placement.
Weight(IP): 20
Security Type: USER_DATA
Notes: Data Source: Database" Supported parameter combinations: <table class="markdownTable"> <tr class="markdownTableHead"> <th class="markdownTableHeadNone"> Parameters
Response
symbol
allocations from oldest to newest
symbol + startTime
oldest allocations since startTime
symbol + endTime
newest allocations until endTime
symbol + startTime + endTime
allocations within the time range
symbol + fromAllocationId
allocations by allocation ID
symbol + orderId
allocations related to an order starting with
oldest | symbol + orderId + fromAllocationId | allocations related to an order by allocation ID |
Note: The time between startTime and endTime can't be longer than 24 hours.
|
inline |
Asynchronous my_allocations().
|
inlinenodiscard |
Query relevant filters (USER_DATA).
GET /api/v3/myFilters.
Retrieves the list of filters relevant to an account on a given symbol. This is the only endpoint that shows if an account has MAX_ASSET filters applied to it.
Weight(IP): 40
Security Type: USER_DATA
Notes: Data Source: Memory
|
inline |
Asynchronous my_filters().
|
inlinenodiscard |
Query Prevented Matches (USER_DATA).
GET /api/v3/myPreventedMatches.
Displays the list of orders that were expired due to STP.
These are the combinations supported:
| Weight: Case | Weight |
|---|---|
| If symbol is invalid | 2 |
| Querying by preventedMatchId | 2 |
| Querying by orderId | 20 |
Security Type: USER_DATA
Notes: Data Source: Database
|
inline |
Asynchronous my_prevented_matches().
|
inlinenodiscard |
Account trade list (USER_DATA).
GET /api/v3/myTrades.
Get trades for a specific account and symbol.
| Weight: Condition | Weight |
|---|---|
| Without orderId | 20 |
| With orderId | 5 |
Security Type: USER_DATA
Notes: Data Source: Memory => Database
Notes::
|
inline |
Asynchronous my_trades().
|
inlinenodiscard |
Query Open Order lists (USER_DATA).
GET /api/v3/openOrderList.
Query Open Order lists
Weight(IP): 6
Security Type: USER_DATA
Notes: Data Source: Memory -> Database
|
inline |
Asynchronous open_order_list().
|
inlinenodiscard |
Query Order Amendments (USER_DATA).
GET /api/v3/order/amendments.
Queries all amendments of a single order.
Weight(IP): 4
Security Type: USER_DATA
Notes: Data Source: Database
|
inline |
Asynchronous order_amendments().
|
inlinenodiscard |
Query Unfilled Order Count (USER_DATA).
GET /api/v3/rateLimit/order.
Displays the user's unfilled order count for all intervals.
Weight(IP): 40
Security Type: USER_DATA
Notes: Data Source: Memory
|
inline |
Asynchronous rate_limit_order().
|
inlinenodiscard |
Exchange information.
GET /api/v3/exchangeInfo.
Current exchange trading rules and symbol information
Weight(IP): 20
Security Type: NONE
Notes: Data Source: Memory
Notes:
Examples of Symbol Permissions Interpretation from the Response:
|
inline |
Asynchronous exchange_info().
|
inlinenodiscard |
Query Execution Rules.
GET /api/v3/executionRules.
Query execution rules for symbols.
| Weight: Parameter | Weight |
|---|---|
| symbol | 2 |
| symbols | 2 for each symbol, capped at a max of 40 |
| symbolStatus | 40 |
| None | 40 |
Security Type: NONE
Notes: Data Source: Memory
Note:: No combination of multiple parameters is allowed.
|
inline |
Asynchronous execution_rules().
|
inlinenodiscard |
Test connectivity.
GET /api/v3/ping.
Test connectivity to the Rest API.
Weight(IP): 1
Security Type: NONE
Notes: Data Source: Memory
See https://developers.binance.com/en/docs/catalog/core-trading-spot-trading/api/rest-api/general#ping
|
inline |
Asynchronous ping().
|
inlinenodiscard |
Check server time.
GET /api/v3/time.
Test connectivity to the Rest API and get the current server time.
Weight(IP): 1
Security Type: NONE
Notes: Data Source: Memory
See https://developers.binance.com/en/docs/catalog/core-trading-spot-trading/api/rest-api/general#time
|
inline |
Asynchronous time().
|
inlinenodiscard |
Compressed/Aggregate trades list.
GET /api/v3/aggTrades.
Get compressed, aggregate trades. Trades that fill at the time, from the same taker order, with the same price will have the quantity aggregated.
Weight(IP): 4
Security Type: NONE
Notes: Data Source: Database
|
inline |
Asynchronous agg_trades().
|
inlinenodiscard |
Current average price.
GET /api/v3/avgPrice.
Current average price for a symbol.
Weight(IP): 2
Security Type: NONE
Notes: Data Source: Memory
|
inline |
Asynchronous avg_price().
|
inlinenodiscard |
Order book.
GET /api/v3/depth.
Order book
Weight: Adjusted based on the limit:
| Limit | Request Weight |
|---|---|
| 1-100 | 5 |
| 101-500 | 25 |
| 501-1000 | 50 |
| 1001-5000 | 250 |
| 5001-7500 | 500 |
Security Type: NONE
Notes: Data Source: Memory
See https://developers.binance.com/en/docs/catalog/core-trading-spot-trading/api/rest-api/market#depth
|
inline |
Asynchronous depth().
|
inlinenodiscard |
Recent trades list.
GET /api/v3/trades.
Get recent trades.
Weight(IP): 25
Security Type: NONE
Notes: Data Source: Memory
|
inline |
Asynchronous get_trades().
|
inlinenodiscard |
Historical Block Trades (MARKET_DATA).
GET /api/v3/historicalBlockTrades.
Get block trades.
Weight(IP): 25
Security Type: MARKET_DATA
Notes: Data Source: Database
|
inline |
Asynchronous historical_block_trades().
|
inlinenodiscard |
Old trade lookup.
GET /api/v3/historicalTrades.
Get older trades.
Weight(IP): 25
Security Type: NONE
Notes: Data Source: Database
|
inline |
Asynchronous historical_trades().
|
inlinenodiscard |
Kline/Candlestick data.
GET /api/v3/klines.
Kline/candlestick bars for a symbol. Klines are uniquely identified by their open time.
Weight(IP): 2
Security Type: NONE
Notes: Data Source: Database
Supported kline intervals (case-sensitive):
| Interval | interval value |
|---|---|
| seconds | 1s |
| minutes | 1m, 3m, 5m, 15m, 30m |
| hours | 1h, 2h, 4h, 6h, 8h, 12h |
| days | 1d, 3d |
| weeks | 1w |
| months | 1M |
Notes:
See https://developers.binance.com/en/docs/catalog/core-trading-spot-trading/api/rest-api/market#klines
|
inline |
Asynchronous klines().
|
inlinenodiscard |
Query Reference Price.
GET /api/v3/referencePrice.
Query the reference price for a symbol.
Weight(IP): 2
Security Type: NONE
Notes: Data Source: Memory
If the symbol has never had a reference price set, the request is rejected with:
|
inline |
Asynchronous reference_price().
|
inlinenodiscard |
Query Reference Price Calculation.
GET /api/v3/referencePrice/calculation.
Describes how reference price is calculated for a given symbol.
Weight(IP): 2
Security Type: NONE
Notes: Data Source: Memory
|
inline |
Asynchronous reference_price_calculation().
|
inlinenodiscard |
Rolling window price change statistics.
GET /api/v3/ticker.
Note: This endpoint differs from GET /api/v3/ticker/24hr.
The statistical time range of this endpoint can be up to 59999ms longer than the requested windowSize.
openTime starts at the beginning of a minute, while the end time is the current time. Therefore, the actual interval can be up to 59999ms longer than the requested window.
For example, if closeTime is 1641287867099 (January 04, 2022 09:17:47:099 UTC) and windowSize is 1d, then openTime is 1641201420000 (January 3, 2022, 09:17:00 UTC).
Weight: 4 for each requested symbol regardless of windowSize.
The weight for this request will cap at 200 once the number of symbols in the request is more than 50.
Security Type: NONE
Notes: Data Source: Database
See https://developers.binance.com/en/docs/catalog/core-trading-spot-trading/api/rest-api/market#ticker
|
inline |
Asynchronous ticker().
|
inlinenodiscard |
24hr ticker price change statistics
GET /api/v3/ticker/24hr.
24 hour rolling window price change statistics. Careful when accessing this with no symbol.
Weight:
Security Type: NONE
Notes: Data Source: Memory
|
inline |
Asynchronous ticker24hr().
|
inlinenodiscard |
Symbol order book ticker.
GET /api/v3/ticker/bookTicker.
Best price/qty on the order book for a symbol or symbols.
Weight: |Parameter|Symbols Provided|Weight| |—|—|—| |symbol| 1 |2| | |omitted| 4| |symbols| Any |4|
Security Type: NONE
Notes: Data Source: Memory
|
inline |
Asynchronous ticker_book_ticker().
|
inlinenodiscard |
Symbol price ticker.
GET /api/v3/ticker/price.
Latest price for a symbol or symbols.
Weight: |Parameter|Symbols Provided|Weight| |—|—|—| |symbol| 1 |2| | |omitted| 4| |symbols| Any |4|
Security Type: NONE
Notes: Data Source: Memory
|
inline |
Asynchronous ticker_price().
|
inlinenodiscard |
Trading Day Ticker.
GET /api/v3/ticker/tradingDay.
Price change statistics for a trading day.
Weight: 4 for each requested symbol. The weight for this request will cap at 200 once the number of symbols in the request is more than 50.
Security Type: NONE
Notes: Data Source: Database
Notes::
|
inline |
Asynchronous ticker_trading_day().
|
inlinenodiscard |
UIKlines.
GET /api/v3/uiKlines.
The request is similar to klines having the same parameters and response.
uiKlines return modified kline data, optimized for presentation of candlestick charts.
Weight(IP): 2
Security Type: NONE
Notes: Data Source: Database
|
inline |
Asynchronous ui_klines().
|
inlinenodiscard |
Cancel All Open Orders on a Symbol (TRADE).
DELETE /api/v3/openOrders.
Cancels all active orders on a symbol. This includes orders that are part of an order list.
Weight(IP): 1
Security Type: TRADE
Notes: Data Source: Matching Engine
|
inline |
Asynchronous delete_open_orders().
|
inlinenodiscard |
Cancel order (TRADE).
DELETE /api/v3/order.
Cancel an active order.
Weight(IP): 1
Security Type: TRADE
Notes: Data Source: Matching Engine
Response Notes: Notes:
Regarding cancelRestrictions
|
inline |
Asynchronous delete_order().
|
inlinenodiscard |
New order (TRADE).
POST /api/v3/order.
Send in a new order.
This adds 1 order to the EXCHANGE_MAX_ORDERS filter and the MAX_NUM_ORDERS filter.
Weight(IP): 1
Unfilled Order Count: 1
Security Type: TRADE
Notes: Data Source: Matching Engine
Some additional mandatory parameters based on order type:
Type | Additional mandatory parameters | Additional Information ---------— | ---------—| ---— LIMIT | timeInForce, quantity, price| MARKET | quantity or quoteOrderQty| MARKET orders using the quantity field specifies the amount of the base asset the user wants to buy or sell at the market price. E.g. 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 quoteOrderQty. E.g. Using the symbol BTCUSDT: BUY side, the order will buy as many BTC as quoteOrderQty USDT can. SELL side, the order will sell as much BTC needed to receive quoteOrderQty USDT. STOP_LOSS | quantity, stopPrice or trailingDelta| This will execute a MARKET order when the conditions are met. (e.g. stopPrice is met or trailingDelta is activated) STOP_LOSS_LIMIT | timeInForce, quantity, price, stopPrice or trailingDelta TAKE_PROFIT | quantity, stopPrice or trailingDelta | This will execute a MARKET order when the conditions are met. (e.g. stopPrice is met or trailingDelta is activated) TAKE_PROFIT_LIMIT | timeInForce, quantity, price, stopPrice or trailingDelta | LIMIT_MAKER | quantity, price| This is a LIMIT order that will be rejected if the order immediately matches and trades as a taker. This is also known as a POST-ONLY order.
Notes on using parameters for Pegged Orders:
Other info:
|
inline |
Asynchronous new_order().
|
inlinenodiscard |
Cancel Order list (TRADE).
DELETE /api/v3/orderList.
Cancel an entire Order list
Weight(IP): 1
Security Type: TRADE
Notes: Data Source: Matching Engine
Notes:
|
inline |
Asynchronous delete_order_list().
|
inlinenodiscard |
Order Amend Keep Priority (TRADE).
PUT /api/v3/order/amend/keepPriority.
Reduce the quantity of an existing open order.
This adds 0 orders to the EXCHANGE_MAX_ORDERS filter and the MAX_NUM_ORDERS filter.
Read Order Amend Keep Priority FAQ to learn more.
Weight(IP): 4
Unfilled Order Count: 0
Security Type: TRADE
Notes: Data Source: Matching Engine
Response Notes: Note: The payload above does not show all fields that can appear. Please refer to Conditional fields in Order Responses.
|
inline |
Asynchronous order_amend_keep_priority().
|
inlinenodiscard |
Cancel an Existing Order and Send a New Order (TRADE).
POST /api/v3/order/cancelReplace.
Weight(IP): 1
Unfilled Order Count: 1
Security Type: TRADE
Notes: Data Source: Matching Engine
Similar to POST /api/v3/order, additional mandatory parameters are determined by type. Response format varies depending on whether the processing of the message succeeded, partially succeeded, or failed.
Response Notes: Notes:
|
inline |
Asynchronous order_cancel_replace().
|
inlinenodiscard |
New Order list - OCO (TRADE).
POST /api/v3/orderList/oco.
Send in an one-cancels-the-other (OCO) pair, where activation of one order immediately cancels the other.
Weight(IP): 1
Unfilled Order Count: 2
Security Type: TRADE
Notes: Data Source: Matching Engine
|
inline |
Asynchronous order_list_oco().
|
inlinenodiscard |
New Order List - OPO (TRADE).
POST /api/v3/orderList/opo.
Place an OPO.
Weight(IP): 1
Unfilled Order Count: 2
Security Type: TRADE
Notes: Data Source: Matching Engine
Response Notes: Note: The payload above does not show all fields that can appear. Please refer to Conditional fields in Order Responses.
|
inline |
Asynchronous order_list_opo().
|
inlinenodiscard |
New Order List - OPOCO (TRADE).
POST /api/v3/orderList/opoco.
Place an OPOCO.
Weight(IP): 1
Unfilled Order Count: 3
Security Type: TRADE
Notes: Data Source: Matching Engine
Response Notes: Note: The payload above does not show all fields that can appear. Please refer to Conditional fields in Order Responses.
|
inline |
Asynchronous order_list_opoco().
|
inlinenodiscard |
New Order list - OTO (TRADE).
POST /api/v3/orderList/oto.
Place an OTO.
Weight(IP): 1
Unfilled Order Count: 2
Security Type: TRADE
Notes: Data Source: Matching Engine
Mandatory parameters based on pendingType or workingType
Depending on the pendingType or workingType, some optional parameters will become mandatory.
|Type |Additional mandatory parameters|Additional information| |-— |-— |---— |workingType = LIMIT |workingTimeInForce | |pendingType = LIMIT |pendingPrice, pendingTimeInForce | |pendingType = STOP_LOSS or TAKE_PROFIT |pendingStopPrice and/or pendingTrailingDelta| |pendingType = STOP_LOSS_LIMIT or TAKE_PROFIT_LIMIT|pendingPrice, pendingStopPrice and/or pendingTrailingDelta, pendingTimeInForce|
Response Notes: Note: The payload above does not show all fields that can appear. Please refer to Conditional fields in Order Responses.
|
inline |
Asynchronous order_list_oto().
|
inlinenodiscard |
New Order list - OTOCO (TRADE).
POST /api/v3/orderList/otoco.
Place an OTOCO.
Weight(IP): 1
Unfilled Order Count: 3
Security Type: TRADE
Notes: Data Source: Matching Engine
Mandatory parameters based on pendingAboveType, pendingBelowType or workingType
Depending on the pendingAboveType/pendingBelowType or workingType, some optional parameters will become mandatory.
|Type |Additional mandatory parameters|Additional information| |-— |-— |---— |workingType = LIMIT |workingTimeInForce | |pendingAboveType= LIMIT_MAKER |pendingAbovePrice | |pendingAboveType = STOP_LOSS/TAKE_PROFIT |pendingAboveStopPrice and/or pendingAboveTrailingDelta| |pendingAboveType=STOP_LOSS_LIMIT/TAKE_PROFIT_LIMIT |pendingAbovePrice, pendingAboveStopPrice and/or pendingAboveTrailingDelta, pendingAboveTimeInForce| |pendingBelowType= LIMIT_MAKER |pendingBelowPrice | |pendingBelowType= STOP_LOSS/TAKE_PROFIT |pendingBelowStopPrice and/or pendingBelowTrailingDelta| |pendingBelowType=STOP_LOSS_LIMIT/TAKE_PROFIT_LIMIT |pendingBelowPrice, pendingBelowStopPrice and/or pendingBelowTrailingDelta, pendingBelowTimeInForce|
Response Notes: Note: The payload above does not show all fields that can appear. Please refer to Conditional fields in Order Responses.
|
inline |
Asynchronous order_list_otoco().
|
inlinenodiscard |
New OCO - Deprecated (TRADE).
POST /api/v3/order/oco.
Send in a new OCO.
Weight(IP): 1
Unfilled Order Count: 2
Security Type: TRADE
Notes: Data Source: Matching Engine
Deprecated: this endpoint may be removed in a future version.
|
inline |
Asynchronous order_oco().
|
inlinenodiscard |
Test new order (TRADE).
POST /api/v3/order/test.
Test new order creation and signature/recvWindow long.
Creates and validates a new order but does not send it into the matching engine.
Weight: |Condition|Weight| |—|—| |Without computeCommissionRates|1| |With computeCommissionRates|20|
Security Type: TRADE
Notes: Data Source: Memory
|
inline |
Asynchronous order_test().
|
inlinenodiscard |
New order using SOR (TRADE).
POST /api/v3/sor/order.
Places an order using smart order routing (SOR).
This adds 1 order to the EXCHANGE_MAX_ORDERS filter and the MAX_NUM_ORDERS filter.
Read SOR FAQ to learn more.
Weight(IP): 1
Unfilled Order Count: 1
Security Type: TRADE
Notes: Data Source: Matching Engine
Note: POST /api/v3/sor/order only supports LIMIT and MARKET orders. quoteOrderQty is not supported.
|
inline |
Asynchronous sor_order().
|
inlinenodiscard |
Test new order using SOR (TRADE).
POST /api/v3/sor/order/test.
Test new order creation and signature/recvWindow using smart order routing (SOR). Creates and validates a new order but does not send it into the matching engine.
Weight: |Condition|Weight| |—|—| |Without computeCommissionRates|1| |With computeCommissionRates|20|
Security Type: TRADE
Notes: Data Source: Memory
|
inline |
Asynchronous sor_order_test().