I'm trying to read and display the current Bitcoin market price in Python, using the yfinance module/library.
It works fine for currency pairs or market indices but BTC-USD doesn't seem to have any returned data which contains the current price.
For other indices there's a bid/ask price and I just take the average but I guess BTC has no spread...but I can't figure out which field has the 'current market price'
Suggestions please.
Thanks,
This code works but it's showing the opening price, not the current market price:
BTC = yF.Ticker("BTC-GBP")print("Bitcoin Current : ", round(BTC.info['open'],0))print(" Day : ", round(BTC.info['dayLow'], 0), "-", round(BTC.info['dayHigh'], 0))print(" 52 Week : ", round(BTC.info['fiftyTwoWeekLow'], 0), "-", round(BTC.info['fiftyTwoWeekHigh'], 0))