How to Get yfinance Python Real-Time Quotes and Percentage Change for Stocks?

18 Replies, 1150 Views

Hey! I’ve been using yfinance python real time quotes and percentage change for a while, and yeah, the delay is a bit annoying. But for free, it’s not bad.

Here’s how I handle percentage change:
```python
import yfinance as yf

ticker = yf.Ticker("NFLX")
data = ticker.history(period="1d", interval="1m")
data['Pct_Change'] = data['Close'].pct_change() * 100
print(data[['Close', 'Pct_Change']])
```
If you need better real-time data, maybe try Robinhood’s API or Webull. They’ve got some decent options.

Messages In This Thread



Users browsing this thread: 1 Guest(s)