OpenAPI specification for Binance exchange - Options API
The binance.options package is automatically generated by the OpenAPI Generator project:
Please do not edit the generated code manually, but rather regenerate it from OpenXAPI.
- API version: 0.3.0
- Package version: 0.3.0
Python 3.8+
pip install openxapi-binance
In your own code, to use this library to connect and interact with binance.options, you can run the following:
import binance.options
from binance.options.rest import ApiException
from binance.options.auth import BinanceAuth
from pprint import pprint
# Defining the host is optional and defaults to https://eapi.binance.com
# See configuration.py for a list of all supported configuration parameters.
configuration = binance.options.Configuration(
host = "https://eapi.binance.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
configuration = binance.options.Configuration(
auth=binance.options.BinanceAuth(
api_key=os.getenv("BINANCE_API_KEY"),
# secret_key=os.getenv("BINANCE_SECRET_KEY"), # if you want to use HMAC auth
private_key_path="/path/to/private_key.pem", # Automatically detects RSA/Ed25519 private keys
),
)
# Enter a context with an instance of the API client
with binance.options.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = binance.options.MarketMakerBlockTradeApi(api_client)
legs = ['legs_example'] # List[str] |
liquidity = '' # str | (default to '')
price = '' # str | (default to '')
quantity = '' # str | (default to '')
side = '' # str | (default to '')
symbol = '' # str | (default to '')
timestamp = 56 # int |
recv_window = 56 # int | (optional)
try:
# New Block Trade Order (TRADE)
api_response = api_instance.create_block_order_create_v1(legs, liquidity, price, quantity, side, symbol, timestamp, recv_window=recv_window)
print("The response of MarketMakerBlockTradeApi->create_block_order_create_v1:\n")
pprint(api_response)
except ApiException as e:
print("Exception when calling MarketMakerBlockTradeApi->create_block_order_create_v1: %s\n" % e)All URIs are relative to https://eapi.binance.com
| Class | Method | HTTP request | Description |
|---|---|---|---|
| MarketMakerBlockTradeApi | create_block_order_create_v1 | POST /eapi/v1/block/order/create | New Block Trade Order (TRADE) |
| MarketMakerBlockTradeApi | delete_block_order_create_v1 | DELETE /eapi/v1/block/order/create | Cancel Block Trade Order (TRADE) |
| OptionsApi | create_batch_orders_v1 | POST /eapi/v1/batchOrders | Place Multiple Orders(TRADE) |
| OptionsApi | create_block_order_execute_v1 | POST /eapi/v1/block/order/execute | Accept Block Trade Order (TRADE) |
| OptionsApi | create_countdown_cancel_all_heart_beat_v1 | POST /eapi/v1/countdownCancelAllHeartBeat | Auto-Cancel All Open Orders (Kill-Switch) Heartbeat (TRADE) |
| OptionsApi | create_countdown_cancel_all_v1 | POST /eapi/v1/countdownCancelAll | Set Auto-Cancel All Open Orders (Kill-Switch) Config (TRADE) |
| OptionsApi | create_listen_key_v1 | POST /eapi/v1/listenKey | Start User Data Stream (USER_STREAM) |
| OptionsApi | create_mmp_reset_v1 | POST /eapi/v1/mmpReset | Reset Market Maker Protection Config (TRADE) |
| OptionsApi | create_mmp_set_v1 | POST /eapi/v1/mmpSet | Set Market Maker Protection Config (TRADE) |
| OptionsApi | create_order_v1 | POST /eapi/v1/order | New Order (TRADE) |
| OptionsApi | delete_all_open_orders_by_underlying_v1 | DELETE /eapi/v1/allOpenOrdersByUnderlying | Cancel All Option Orders By Underlying (TRADE) |
| OptionsApi | delete_all_open_orders_v1 | DELETE /eapi/v1/allOpenOrders | Cancel all Option orders on specific symbol (TRADE) |
| OptionsApi | delete_batch_orders_v1 | DELETE /eapi/v1/batchOrders | Cancel Multiple Option Orders (TRADE) |
| OptionsApi | delete_listen_key_v1 | DELETE /eapi/v1/listenKey | Close User Data Stream (USER_STREAM) |
| OptionsApi | delete_order_v1 | DELETE /eapi/v1/order | Cancel Option Order (TRADE) |
| OptionsApi | get_account_v1 | GET /eapi/v1/account | Option Account Information(TRADE) |
| OptionsApi | get_bill_v1 | GET /eapi/v1/bill | Account Funding Flow (USER_DATA) |
| OptionsApi | get_block_order_execute_v1 | GET /eapi/v1/block/order/execute | Query Block Trade Details (USER_DATA) |
| OptionsApi | get_block_order_orders_v1 | GET /eapi/v1/block/order/orders | Query Block Trade Order (TRADE) |
| OptionsApi | get_block_trades_v1 | GET /eapi/v1/blockTrades | Recent Block Trades List |
| OptionsApi | get_block_user_trades_v1 | GET /eapi/v1/block/user-trades | Account Block Trade List (USER_DATA) |
| OptionsApi | get_countdown_cancel_all_v1 | GET /eapi/v1/countdownCancelAll | Get Auto-Cancel All Open Orders (Kill-Switch) Config (TRADE) |
| OptionsApi | get_depth_v1 | GET /eapi/v1/depth | Order Book |
| OptionsApi | get_exchange_info_v1 | GET /eapi/v1/exchangeInfo | Exchange Information |
| OptionsApi | get_exercise_history_v1 | GET /eapi/v1/exerciseHistory | Historical Exercise Records |
| OptionsApi | get_exercise_record_v1 | GET /eapi/v1/exerciseRecord | User Exercise Record (USER_DATA) |
| OptionsApi | get_historical_trades_v1 | GET /eapi/v1/historicalTrades | Old Trades Lookup (MARKET_DATA) |
| OptionsApi | get_history_orders_v1 | GET /eapi/v1/historyOrders | Query Option Order History (TRADE) |
| OptionsApi | get_income_asyn_id_v1 | GET /eapi/v1/income/asyn/id | Get Option Transaction History Download Link by Id (USER_DATA) |
| OptionsApi | get_income_asyn_v1 | GET /eapi/v1/income/asyn | Get Download Id For Option Transaction History (USER_DATA) |
| OptionsApi | get_index_v1 | GET /eapi/v1/index | Symbol Price Ticker |
| OptionsApi | get_klines_v1 | GET /eapi/v1/klines | Kline/Candlestick Data |
| OptionsApi | get_margin_account_v1 | GET /eapi/v1/marginAccount | Option Margin Account Information (USER_DATA) |
| OptionsApi | get_mark_v1 | GET /eapi/v1/mark | Option Mark Price |
| OptionsApi | get_mmp_v1 | GET /eapi/v1/mmp | Get Market Maker Protection Config (TRADE) |
| OptionsApi | get_open_interest_v1 | GET /eapi/v1/openInterest | Open Interest |
| OptionsApi | get_open_orders_v1 | GET /eapi/v1/openOrders | Query Current Open Option Orders (USER_DATA) |
| OptionsApi | get_order_v1 | GET /eapi/v1/order | Query Single Order (TRADE) |
| OptionsApi | get_ping_v1 | GET /eapi/v1/ping | Test Connectivity |
| OptionsApi | get_position_v1 | GET /eapi/v1/position | Option Position Information (USER_DATA) |
| OptionsApi | get_ticker_v1 | GET /eapi/v1/ticker | 24hr Ticker Price Change Statistics |
| OptionsApi | get_time_v1 | GET /eapi/v1/time | Check Server Time |
| OptionsApi | get_trades_v1 | GET /eapi/v1/trades | Recent Trades List |
| OptionsApi | get_user_trades_v1 | GET /eapi/v1/userTrades | Account Trade List (USER_DATA) |
| OptionsApi | update_block_order_create_v1 | PUT /eapi/v1/block/order/create | Extend Block Trade Order (TRADE) |
| OptionsApi | update_listen_key_v1 | PUT /eapi/v1/listenKey | Keepalive User Data Stream (USER_STREAM) |
- APIError
- CreateBlockOrderExecuteV1Resp
- CreateBlockOrderExecuteV1RespLegsInner
- CreateCountdownCancelAllHeartBeatV1Resp
- CreateCountdownCancelAllV1Resp
- CreateListenKeyV1Resp
- CreateMmpResetV1Resp
- CreateMmpSetV1Resp
- DeleteAllOpenOrdersByUnderlyingV1Resp
- DeleteAllOpenOrdersV1Resp
- DeleteOrderV1Resp
- GetAccountV1Resp
- GetAccountV1RespAssetInner
- GetAccountV1RespGreekInner
- GetBillV1RespItem
- GetBlockOrderExecuteV1Resp
- GetBlockOrderOrdersV1RespItem
- GetBlockTradesV1RespItem
- GetBlockUserTradesV1RespItem
- GetBlockUserTradesV1RespItemLegsInner
- GetCountdownCancelAllV1Resp
- GetDepthV1Resp
- GetExerciseHistoryV1RespItem
- GetExerciseRecordV1RespItem
- GetHistoricalTradesV1RespItem
- GetHistoryOrdersV1RespItem
- GetIncomeAsynIdV1Resp
- GetIncomeAsynV1Resp
- GetIndexV1Resp
- GetKlinesV1RespItem
- GetMarginAccountV1Resp
- GetMarginAccountV1RespAssetInner
- GetMarkV1RespItem
- GetMmpV1Resp
- GetOpenInterestV1RespItem
- GetOpenOrdersV1RespItem
- GetOrderV1Resp
- GetPositionV1RespItem
- GetTickerV1RespItem
- GetTimeV1Resp
- GetTradesV1RespItem
- GetUserTradesV1RespItem
- OptionsCreateBatchOrdersV1ReqOrdersItem
- OptionsCreateBatchOrdersV1RespInner
- OptionsCreateBatchOrdersV1RespItem
- OptionsCreateBlockOrderCreateV1Resp
- OptionsCreateOrderV1Resp
- OptionsDeleteBatchOrdersV1RespInner
- OptionsDeleteBatchOrdersV1RespItem
- OptionsGetExchangeInfoV1Resp
- OptionsGetExchangeInfoV1RespOptionAssetsInner
- OptionsGetExchangeInfoV1RespOptionContractsInner
- OptionsGetExchangeInfoV1RespOptionSymbolsInner
- OptionsGetExchangeInfoV1RespRateLimitsInner
- OptionsSymbolFilter
- UpdateBlockOrderCreateV1Resp
Authentication schemes defined for the API:
- Type: API key
- API key parameter name: X-MBX-APIKEY
- Location: HTTP header