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
HTTPError: 401 Client Error: Unauthorized for url #1592
Comments
same issue here just now... python 3.10, latest yfinance version, windows... |
It seems "v10 quoteSummary" also needs cookie and crumb. |
Same here, from yesterday (12th July, 2023)... |
I have the same problem... |
Yes, witnessing the same problem. |
I have the same issue, it came on Thusday, on Wednesday morning my script was working and now again. Hope that can be fixed. |
I also have the same problem since this morning. 401 Client Error: Unauthorized for url: https://query2.finance.yahoo.com/v10/finance/quoteSummary/EPAM?modules=summaryProfile%2CfinancialData%2CquoteType%2CdefaultKeyStatistics%2CassetProfile%2CsummaryDetail&ssl=true It would be great if we could find a solution. Thanks! |
history work 👍 but not Info 👎 |
Well obviously this is a problem. Let's keep thread tidy and constructive now. @lapis42 You know that because you have it working with cookie and crumb? |
If I use the URL in the original message Using
If I do the same in a browser that has a logged in session to Yahoo! finance it returns:
|
@decadecity I have code that can extract crumb, might help. I've never used it in requests. import requests, re, json
def get_crumb():
response = requests.get("https://finance.yahoo.com")
pat = re.compile(r'window\.YAHOO\.context = ({.*?});', re.DOTALL)
match = re.search(pat, response.text)
if match:
js_dict = json.loads(match.group(1))
return js_dict.get('crumb')
return None |
Done a bit of digging around with |
I had already noticed these errors on the infos, when asking for example, for crypto currencies, like BTC-USD |
@ValueRaider Yes, I was able to retrieve the data after providing crumb with cookie. |
I cannot understand what solution has to be done. Is this solved as I am having the same problem? It says invalid crumb. |
@lapis42 @decadecity Could you 2 elaborate on how you obtained and provided cookie & crumb? |
I got the cookie by visiting With those two I could then put them into a command line
I've not looked into how to do this in Python. |
@decadecity With a basic free Yahoo account? |
@ValueRaider Initially yes but once I'd used that to figure out the minimum information required I was able to do it anonymously in a private browsing window with a completely clean session. |
@ValueRaider @signifer-geo v0.2.23 is working for me 👍🏻 |
Not for me :-( Maybe value is close ??? |
@pbenaim You're right, |
@ValueRaider I used curl to check, and I was able to retrieve the data. To get the crumb: To get the data: |
I was able to fix it by upgrading yfinance: |
Yes, upgrading to 0.2.23 works !!!
…On Fri, Jul 14, 2023 at 9:55 AM pedrochassin ***@***.***> wrote:
I was able to fix it by upgrading yfinance: pip install --upgrade yfinance
hope it works for someone
—
Reply to this email directly, view it on GitHub
<#1592 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGDCBJP6UGZ4WFQFD5VUAGTXQDC3NANCNFSM6AAAAAA2ICGYHU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Is anyone able to pull the same number of fields with .23 version as they did with .22 version? I need the other fundamentals fields such as revenue and margins whcih the .23 veraion does not provide anymore. import yfinance as yf |
Does no one read anymore? #1592 (comment) <- click it |
May be we should use this: |
How's this:
Results in:
|
I've fixed it. Can I have permission to push to the repo? thanks. |
Why are people fixing this instead of reading the thread? I've already fixed it, just waiting for someone to verify. Am I muted? |
coz the code on the branch doesn't work re missing info values, at least for me... |
@emmaai My branch does that, see main...hotfix/info-missing-values . And for me this appears to fix, many more values now, I just wanted confirmation in case still problems. |
@ValueRaider Apologies, I misunderstood you: I thought that was your WIP branch but as there was no PR raised for it I thought you were still looking for a fix. My bad. As the
|
Hello all, |
@decadecity Your experience is uniquely interesting, because 0.2.23 should only be returning "summaryDetail" module = ~37 values instead of ~130 Anyway I've created a PR #1603 |
@ValueRaider on |
The 23 version does not work anymore. I now get error with 24 version - which was uploaded an hour ago- as well. |
What error I extracted sucessfully data that needed for my report with version 24 |
Working fine for me also, tested just now. |
updating yfinance worked.thanks |
it works for me by upgrading the finance to 0.2.24. thanks everyone! |
It works, thank you! |
version 0.2.24 works fine! |
I'm on yfinance version 0.2.22 (Python 3.9.10 on macOS 12.6.3), and since today, I keep getting the following error (e.g. on calling
yf.Ticker('AAPL').info
):HTTPError: 401 Client Error: Unauthorized for url: https://query2.finance.yahoo.com/v10/finance/quoteSummary/AAPL?modules=summaryProfile%2CfinancialData%2CquoteType%2CdefaultKeyStatistics%2CassetProfile%2CsummaryDetail&ssl=true
Is this a known/global issue at the moment?
@ValueRaider hijacking top post
Please only post if you have something useful
The text was updated successfully, but these errors were encountered: