Market Data Endpoints¶
Get Market Depth¶
depth = client.get_order_book(symbol='BNBBTC')
Get Recent Trades¶
trades = client.get_recent_trades(symbol='BNBBTC')
Get Historical Trades¶
trades = client.get_historical_trades(symbol='BNBBTC')
Get Aggregate Trades¶
trades = client.get_aggregate_trades(symbol='BNBBTC')
Get Kline/Candlesticks¶
candles = client.get_klines(symbol='BNBBTC', interval=Client.KLINE_INTERVAL_30MINUTE)
Get Historical Kline/Candlesticks¶
Fetch klines for any date range and interval
# fetch 1 minute klines for the last day up until now
klines = client.get_historical_klines("BNBBTC", Client.KLINE_INTERVAL_1MINUTE, "1 day ago UTC")
# fetch 30 minute klines for the last month of 2017
klines = client.get_historical_klines("ETHBTC", Client.KLINE_INTERVAL_30MINUTE, "1 Dec, 2017", "1 Jan, 2018")
# fetch weekly klines since it listed
klines = client.get_historical_klines("NEOBTC", KLINE_INTERVAL_1WEEK, "1 Jan, 2017")
Get 24hr Ticker¶
tickers = client.get_ticker()
Get Orderbook Tickers¶
Get first bid and ask entry in the order book for all markets.
tickers = client.get_orderbook_tickers()