problem with yfinance
according to chatgpt:
These are some of the challenges users run into:
-
Yahoo changed parts of its site / API / encryption
-
Yahoo Finance’s official data API was shut down years ago. yfinance works around that by scraping web-pages. Stack Overflow+2Rana Roussi+2
-
But Yahoo sometimes changes how data is encrypted or presented, so yfinance may break or partially lose functionality until it’s updated. Quantra+1
-
-
Rate-limiting, requests blocked, missing data
-
Some endpoints (or types of data) may be no longer available or harder to access. E.g. fundamental data or historical data may be partially disrupted. Reddit+3Quantra+3Reddit+3
-
Also, many users report “Too many requests”, being rate-limited, or certain ticker data failing. Reddit+2Reddit+2
-
-
Dependence on Yahoo’s public site
-
Because it scrapes the site (not using an official stable API), any UX changes, HTML structure changes, or Yahoo policy changes (e.g. making some data behind paywalls or stopping CSV/historical downloads) can break parts of yfinance.
-
我自己因為以前沒用過 Python, 我是自動從Yahoo history 網頁抓取HTML, 然後取出其中的數據,剛開始半年一切正常,後來發現有時Yahoo 禁止自動抓取,後來幹脆用收費的數據,eodhd的daily only 數據,每年約200美元,用起來蠻好,也沒太多限製。