Hello,
When using yfinance in research env I get this 443 error, is there a workaround?
import yfinance as yf
yf.Ticker("MSFT").info
> ProxyError: HTTPSConnectionPool(host='fc.yahoo.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Unable to connect to proxy', OSError('Tunnel connection failed: 403 Forbidden')))
However, using download for the same host works:
qb = QuantBook()
qb.Download("fc.yahoo.com")
Mia Alissi
To address the issue of using
yfinance
in the QuantConnect research environment and encountering a proxy error, here are some suggestions and alternatives:QuantBook.download Method: The
QuantBook.download
method works without proxy issues, as you've noted. This method allows you to download data directly from a specified URL, which can be a workaround for fetching data from external sources like Yahoo Finance.Alternative Data Sources: QuantConnect offers a variety of alternative datasets that can be used for universe selection and analysis. Some of these include:
These datasets can provide valuable insights and might serve as a substitute for the data you intended to fetch using
yfinance
.Proxy Settings: The proxy settings in the QuantConnect research environment might be causing the issue with
yfinance
. Unfortunately, these settings are not configurable by users, so using theQuantBook.download
method or alternative datasets is recommended.Custom Data Sources: If you need specific data not available through QuantConnect's datasets, consider creating a custom data source. This involves defining a data class that specifies how to fetch and parse the data. An example of this is the custom Bitcoin data class that uses Quandl data.
By leveraging these alternatives and methods, you can continue your research and analysis without relying on
yfinance
directly. If you have further questions or need assistance with implementing any of these solutions, feel free to ask!Sources: Key Concepts - QuantConnect.com, Alternative Data - QuantConnect.com, Requesting Data - QuantConnect.com
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Ahmedengu
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!