import pybitflyer
import time
from datetime import datetime
from pytz import timezone
from dateutil import parser
BOARD_KEYS = ["asks",
"bids",]
API_KEY = "XXXXXXXXXXXXXXXXXXXXXXX" #bitflyer Get from my page
API_SECRET = "XXXXXXXXXXXXXXXXXXXXXXX" #bitflyer Get from my page
def to_jst(datestr):
return parser.parse(datestr).astimezone(timezone('Asia/Tokyo'))
if __name__ == '__main__':
api = pybitflyer.API(api_key = API_KEY, api_secret = API_SECRET)
board = api.board(product_code="BTC_JPY")
for board_key in BOARD_KEYS:
print(board_key + " : " + str(board[board_key][:5])) #Show only 5
asks : [{'size': 0.11494513, 'price': 444899.0}, {'size': 0.0418758, 'price': 444900.0}, {'size': 0.00975, 'price': 444998.0}, {'size': 0.94526412, 'price': 444999.0}, {'size': 10.1291162, 'price': 445000.0}]
bids : [{'size': 2.51806335, 'price': 444350.0}, {'size': 0.0035, 'price': 444300.0}, {'size': 0.496, 'price': 444274.0}, {'size': 0.01, 'price': 444100.0}, {'size': 0.01193694, 'price': 444000.0}]
Recommended Posts