Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep getting Failed to resolve 'fc.yahoo.com' or BTC-BTC or BTC-USD possibly delisted; no price data found #2210

Open
ronsonntag54 opened this issue Jan 7, 2025 · 1 comment

Comments

@ronsonntag54
Copy link

Describe bug

Get the following error when requesting historical data for BTC-USD (also tried BTC and BTC-BTC):

D:\Documents\BTC>python "Test YFinance.py"
0.2.51
Failed to get ticker 'BTC-BTC' reason: HTTPSConnectionPool(host='fc.yahoo.com', port=443): Max retries exceeded with url: / (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x0000013E6D8B6900>: Failed to resolve 'fc.yahoo.com' ([Errno 11004] getaddrinfo failed)"))
$BTC-BTC: possibly delisted; no price data found (period=1mo)

Simple code that reproduces your problem

import yfinance as yf
print(yf.version)

Fetch historical market data for the last 30 days

StockInfo = yf.Ticker('BTC-BTC')
historical_data = StockInfo.history(period="1mo")

Debug log

D:\Documents\BTC>python "Test YFinance.py"
0.2.51
DEBUG Entering history()
DEBUG Entering _fetch_ticker_tz()
DEBUG Entering get()
DEBUG Entering _make_request()
DEBUG url=https://query2.finance.yahoo.com/v8/finance/chart/BTC-BTC
DEBUG params=frozendict.frozendict({'range': '1d', 'interval': '1d'})
DEBUG Entering _get_cookie_and_crumb()
DEBUG cookie_mode = 'basic'
DEBUG Entering _get_cookie_and_crumb_basic()
ERROR Failed to get ticker 'BTC-BTC' reason: HTTPSConnectionPool(host='fc.yahoo.com', port=443): Max retries exceeded with url: / (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x000002414C5B6900>: Failed to resolve 'fc.yahoo.com' ([Errno 11004] getaddrinfo failed)"))
DEBUG Exiting _fetch_ticker_tz()
DEBUG Entering history()
DEBUG BTC-BTC: Yahoo GET parameters: {'range': '1mo', 'interval': '1d', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG Entering get()
DEBUG Entering _make_request()
DEBUG url=https://query2.finance.yahoo.com/v8/finance/chart/BTC-BTC
DEBUG params={'range': '1mo', 'interval': '1d', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG Entering _get_cookie_and_crumb()
DEBUG cookie_mode = 'basic'
DEBUG Entering _get_cookie_and_crumb_basic()
ERROR $BTC-BTC: possibly delisted; no price data found (period=1mo)
DEBUG Exiting history()
DEBUG Exiting history()

Bad data proof

No response

yfinance version

0.2.51

Python version

3.13.0

Operating system

Windows 10 Pro - fully updated

@oluca
Copy link

oluca commented Jan 7, 2025

I get the same error for stock tickers as well

UPDATE 8. Jan 2025: Works again for the stock tickers

@R5dan R5dan mentioned this issue Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants