目次
当サイト実行環境
仮想通貨取引所:Binance(バイナンス)
プログラム言語:Python3 (Anaconda ディストリビューション)
Binance(バイナンス)の口座開設方法は下記をご参照ください。
https://仮想通貨取引.jp/binance-entry/
get_orderbook_ticker(Python-Binance API) サンプルコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
#全通貨ペアの板情報を取得 get_orderbook_ticker from binance.client import Client ##======================= #api_key = "XXX" #api_secret = "XXX" ##======================= #cliant インスタンス client = Client(api_key, api_secret) #全通貨ペアの板情報 obtickers = client.get_orderbook_ticker() # 0番目の通貨ペアの板情報を出力 print("output obtickers-0:") print(obtickers[0]) print("") #全通貨ペアの板情報を出力 print("output obtickers:") print(obtickers) print("") |
get_orderbook_ticker (Python-Binance API) 実行結果
{‘symbol’: ‘ETHBTC’, ‘bidPrice’: ‘0.03088600’, ‘bidQty’: ‘0.91800000’, ‘askPrice’: ‘0.03089800’, ‘askQty’: ‘2.00000000’}
output obtickers:
[{‘symbol’: ‘ETHBTC’, ‘bidPrice’: ‘0.03088600’, ‘bidQty’: ‘0.91800000’, ‘askPrice’: ‘0.03089800’, ‘askQty’: ‘2.00000000’}, {‘symbol’: ‘LTCBTC’, ‘bidPrice’: ‘0.01304200’, ‘bidQty’: ‘0.15000000’, ‘askPrice’: ‘0.01304700’, ‘askQty’: ‘1.84000000’}, {‘symbol’: ‘BNBBTC’, ‘bidPrice’: ‘0.00384330’, ‘bidQty’: ‘23.54000000’, ‘askPrice’: ‘0.00384550’, ‘askQty’: ‘74.85000000’}, {‘symbol’: ‘NEOBTC’, ‘bidPrice’: ‘0.00138800’, ‘bidQty’: ‘3706.18000000’, ‘askPrice’: ‘0.00138900’, ‘askQty’: ‘231.03000000’}, {‘symbol’: ‘QTUMETH’, ‘bidPrice’: ‘0.01176500’, ‘bidQty’: ‘19.78000000’, ‘askPrice’: ‘0.01181200’, ‘askQty’: ‘20.20000000’}, {‘symbol’: ‘EOSETH’, ‘bidPrice’: ‘0.02932000’, ‘bidQty’: ‘81.32000000’, ‘askPrice’: ‘0.02933800’, ‘askQty’: ‘48.62000000’}, {‘symbol’: ‘SNTETH’, ‘bidPrice’: ‘0.00011153’, ‘bidQty’: ‘2129.00000000’, ‘askPrice’: ‘0.00011261’, ‘askQty’: ‘781.00000000’}, {‘symbol’: ‘BNTETH’, ‘bidPrice’: ‘0.00281900’, ‘bidQty’: ‘0.15000000’, ‘askPrice’: ‘0.00283000’, ‘askQty’: ‘2069.97000000’}, {‘symbol’: ‘BCCBTC’, ‘bidPrice’: ‘0.00000000’, ‘bidQty’: ‘0.00000000’, ・・・
コメントを残す