get_historical_klines ( "BNBBTC", Client. get_deposit_address ( coin = 'BTC' ) # get historical kline data from any date range # fetch 1 minute klines for the last day up until now klines = client. get_withdraw_history ( coin = 'ETH' ) # get a deposit address for BTC address = client. get_withdraw_history () # fetch list of ETH withdrawals eth_withdraws = client. withdraw ( asset = 'ETH', address = '', amount = 100 ) except BinanceAPIException as e : print ( e ) else : print ( "Success" ) # fetch list of withdrawals withdraws = client. get_all_tickers () # withdraw 100 ETH # check docs for assumptions around withdrawals from binance.exceptions import BinanceAPIException try : result = client. ORDER_TYPE_MARKET, quantity = 100 ) # get all symbol prices prices = client. create_test_order ( symbol = 'BNBBTC', side = Client. get_order_book ( symbol = 'BNBBTC' ) # place a test market buy order, to place an actual order use the create_order function order = client. pip install python-binanceįrom binance import Client, ThreadedWebsocketManager, ThreadedDepthCacheManager client = Client ( api_key, api_secret ) # get market depth depth = client. Pass testnet=True when creating the client. To use the Spot or Vanilla Options Testnet, ![]() ![]() ![]() If you are using an exchange from the US, Japan or other TLD then make sure pass tld=’us’ when creating the Generate an API Key and assign relevant permissions.
0 Comments
Leave a Reply. |