pip install pybitflyer
API Document
https://lightning.bitflyer.jp/docs?lang=ja&_ga=2.242195781.679665938.1503589602-1417182779.1500704462#資産残高を取得
import pybitflyer
import time
from datetime import datetime
from pytz import timezone
from dateutil import parser
BALANCE_KEYS = ["currency_code",
"amount",
"available"]
API_KEY = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
API_SECRET = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
if __name__ == '__main__':
api = pybitflyer.API(api_key = API_KEY, api_secret = API_SECRET)
balances = api.getbalance(product_code="BTC_JPY")
for balance in balances:
for balance_key in BALANCE_KEYS:
print(balance_key + " : " + str(balance[balance_key]))
print("=================================================")
currency_code : JPY
amount : 2793972636.0
available : 2793972636.0
=================================================
currency_code : BTC
amount : 600.2235
available : 600.2235
=================================================
currency_code : BCH
amount : 600.0685
available : 600.0685
=================================================
currency_code : ETH
amount : 0.0
available : 0.0
=================================================
currency_code : ETC
amount : 0.0
available : 0.0
=================================================
currency_code : LTC
amount : 0.0
available : 0.0
=================================================
Recommended Posts