Skip to content

Commit 1f28008

Browse files
committed
Added all endpoints under quoting interface
1 parent a1f6800 commit 1f28008

File tree

1 file changed

+123
-1
lines changed

1 file changed

+123
-1
lines changed

binance/client.py

Lines changed: 123 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5856,7 +5856,12 @@ def enable_fast_withdraw_switch(self, **params):
58565856
"""
58575857
return self._request_margin_api('post', 'enableFastWithdrawSwitch', True, data=params)
58585858

5859-
# Options API
5859+
"""
5860+
====================================================================================================================
5861+
Options API
5862+
====================================================================================================================
5863+
"""
5864+
# Quoting interface endpoints
58605865

58615866
def options_ping(self):
58625867
"""Test connectivity to the REST API
@@ -5865,3 +5870,120 @@ def options_ping(self):
58655870
58665871
"""
58675872
return self._request_options_api('get', 'ping')
5873+
5874+
def options_time(self):
5875+
"""Get server time
5876+
5877+
https://binance-docs.github.io/apidocs/voptions/en/#get-server-time
5878+
5879+
"""
5880+
return self._request_options_api('get', 'time')
5881+
5882+
def options_info(self):
5883+
"""Get current trading pair info
5884+
5885+
https://binance-docs.github.io/apidocs/voptions/en/#get-current-trading-pair-info
5886+
5887+
"""
5888+
return self._request_options_api('get', 'optionInfo')
5889+
5890+
def options_exchange_info(self):
5891+
"""Get current limit info and trading pair info
5892+
5893+
https://binance-docs.github.io/apidocs/voptions/en/#get-current-limit-info-and-trading-pair-info
5894+
5895+
"""
5896+
return self._request_options_api('get', 'exchangeInfo')
5897+
5898+
def options_index_price(self, **params):
5899+
"""Get the spot index price
5900+
5901+
https://binance-docs.github.io/apidocs/voptions/en/#get-the-spot-index-price
5902+
5903+
:param underlying: mandatory - Spot pair(Option contract underlying asset)- BTCUSDT
5904+
:type underlying: str
5905+
5906+
"""
5907+
return self._request_options_api('get', 'index', data=params)
5908+
5909+
def options_price(self, **params):
5910+
"""Get the latest price
5911+
5912+
https://binance-docs.github.io/apidocs/voptions/en/#get-the-latest-price
5913+
5914+
:param symbol: optional - Option trading pair - BTC-200730-9000-C
5915+
:type symbol: str
5916+
5917+
"""
5918+
return self._request_options_api('get', 'ticker', data=params)
5919+
5920+
def options_mark_price(self, **params):
5921+
"""Get the latest mark price
5922+
5923+
https://binance-docs.github.io/apidocs/voptions/en/#get-the-latest-mark-price
5924+
5925+
:param symbol: optional - Option trading pair - BTC-200730-9000-C
5926+
:type symbol: str
5927+
5928+
"""
5929+
return self._request_options_api('get', 'mark', data=params)
5930+
5931+
def options_depth(self, **params):
5932+
"""Depth information
5933+
5934+
https://binance-docs.github.io/apidocs/voptions/en/#depth-information
5935+
5936+
:param symbol: mandatory - Option trading pair - BTC-200730-9000-C
5937+
:type symbol: str
5938+
:param limit: optional - Default:100 Max:1000.Optional value:[10, 20, 50, 100, 500, 1000] - 100
5939+
:type limit: int
5940+
5941+
"""
5942+
return self._request_options_api('get', 'depth', data=params)
5943+
5944+
def options_klines(self, **params):
5945+
"""Candle data
5946+
5947+
https://binance-docs.github.io/apidocs/voptions/en/#candle-data
5948+
5949+
:param symbol: mandatory - Option trading pair - BTC-200730-9000-C
5950+
:type symbol: str
5951+
:param interval: mandatory - Time interval - 5m
5952+
:type interval: str
5953+
:param startTime: optional - Start Time - 1592317127349
5954+
:type startTime: int
5955+
:param endTime: optional - End Time - 1592317127349
5956+
:type endTime: int
5957+
:param limit: optional - Number of records Default:500 Max:1500 - 500
5958+
:type limit: int
5959+
5960+
"""
5961+
return self._request_options_api('get', 'klines', data=params)
5962+
5963+
def options_recent_trades(self, **params):
5964+
"""Recently completed Option trades
5965+
5966+
https://binance-docs.github.io/apidocs/voptions/en/#recently-completed-option-trades
5967+
5968+
:param symbol: mandatory - Option trading pair - BTC-200730-9000-C
5969+
:type symbol: str
5970+
:param limit: optional - Number of records Default:100 Max:500 - 100
5971+
:type limit: int
5972+
5973+
"""
5974+
return self._request_options_api('get', 'trades', data=params)
5975+
5976+
def options_historical_trades(self, **params):
5977+
"""Query trade history
5978+
5979+
https://binance-docs.github.io/apidocs/voptions/en/#query-trade-history
5980+
5981+
:param symbol: mandatory - Option trading pair - BTC-200730-9000-C
5982+
:type symbol: str
5983+
:param fromId: optional - The deal ID from which to return. The latest deal record is returned by default - 1592317127349
5984+
:type fromId: int
5985+
:param limit: optional - Number of records Default:100 Max:500 - 100
5986+
:type limit: int
5987+
5988+
"""
5989+
return self._request_options_api('get', 'historicalTrades', data=params)

0 commit comments

Comments
 (0)