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

401 Client Error: Unauthorized for url: #1952

Open
KingTurbo opened this issue May 29, 2024 · 9 comments
Open

401 Client Error: Unauthorized for url: #1952

KingTurbo opened this issue May 29, 2024 · 9 comments

Comments

@KingTurbo
Copy link

Describe bug

An issue occurs when attempting to fetch stock information using the yfinance library. The request results in a 401 Client Error: Unauthorized.

import yfinance as yf

msft = yf.Ticker("MSFT")

get all stock info

msft.info

401 Client Error: Unauthorized for url: https://query2.finance.yahoo.com/v10/finance/quoteSummary/MSFT?modules=financialData%2CquoteType%2CdefaultKeyStatistics%2CassetProfile%2CsummaryDetail&corsDomain=finance.yahoo.com&formatted=false&symbol=MSFT&crumb=2abgHhN2kUC

Environment:

Operating System: Windows 10, Windows 11
Region: Europe
both current yfinance version

Simple code that reproduces your problem

import yfinance as yf

msft = yf.Ticker("MSFT")

get all stock info

msft.info

Debug log

...

Bad data proof

No response

yfinance version

0.2.40

Python version

Python 3.11.4

Operating system

W10/11

@SC8198
Copy link

SC8198 commented May 29, 2024

Having same issues.

Operating system
Linux

Region: USA

yfinance version
0.2.40

@ValueRaider ValueRaider pinned this issue May 29, 2024
@justmessingaround
Copy link

Same issue also.

@apenake
Copy link

apenake commented May 29, 2024

Same issue - worked fine a few days ago. Upgrading yfinance does not solve:
OS: Mac 13.2.1
Region: USA
Python: 3.11.4
yfinance: 0.2.40

@stan-artemyev
Copy link

Same issue - worked earlier today.
OS: Mac 14.5
Python: 3.12.3
yfinance: latest 0.2.40

@GongXiangbo
Copy link

Same issue - worked fine few hours ago

OS: Windows 11
Region: Italy
Python: 3.12.3
yfinance: 0.2.40

@gustavph
Copy link

Same issue - worked last week

OS: Windows 11
Region: Brazil
Python: 3.12
yfinance: 0.2.40

@jrkong
Copy link

jrkong commented May 30, 2024

The issue ties back to the crumb. It's likely Yahoo changed something with their cookies or how they expect to receive the crumb.

@fpsy
Copy link

fpsy commented May 30, 2024

I had the same issue yesterday, but now it works again.

@justmessingaround
Copy link

its randomly back working for me too

@ValueRaider ValueRaider unpinned this issue Jun 8, 2024
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

9 participants