-
Notifications
You must be signed in to change notification settings - Fork 62
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
Invalid Crumb / Yahoo disables API access to quotes data #764
Comments
I thought, I was only one to get this error. If someone has an solution to this drop it here. It will be useful for us. |
From the Link in the yahoo error message: Inofficial API Access might be over... |
I would strongly encourage everyone to go to that link and fill out the form. https://bit.ly/yahoo-finance-api-feedback This project has always done its best to respect Yahoo's policies and while many efforts have been made to keep up-to-date with their technical requirements, we will never blatantly help to side-step their policies. Both for legal reasons but also out of great respect and appreciation for the data they have been providing us at no cost (!) until now. The above form is an amazing step by Yahoo to try better understand developers who are using their API. Many serious users of this project (myself included) have looked at alternative (paid) options and found them inferior in many areas. Whereas in the past, Yahoo has mostly just ignored developers using their platform, it now looks like they're looking to seriously engage us and (perhaps) better address our needs. The possibility of having a official API support from Yahoo is a big deal, and would result in much more stable use without us having to constantly ship updates for the frequent changes they make to their existing and basically internal API. I think having a small free plan for personal use with sensible limits would be amazing, as would a paid option which opens up the possibility for developers to monetize their hard work (alongside any local regulatory requirements). So, again, I really encourage everyone to complete the form and see where this process leads. As users of this library, you may have enjoyed a reasonably stable experience (if you keep the library up-to-date), but as developers, keeping things working (and working correctly) against a constantly changing service is a huge effort and massive energy drain. Something official from Yahoo would be absolutely incredibly for all involved, so again, I encourage you take advantage of this opportunity and keep your fingers crossed. |
Thanks also to everyone above for reporting the issue, and for your input and feedback. I know this is a huge pain and inconvenience, but I really believe that Yahoo asking for developer feedback rather than just blocking us is a very positive step that could lead somewhere good for all of us. |
This message from yahoo has been provided since many months. The API was still accessible using the node-yahoo-finance2 library, because it deals with cookies. However, the "Invalid Crumb" error is new, as of last week. The API responded last Tuesday, using the version 2.9.0 of the library. |
I am able to get a positive response from the API |
The library (v.2.11.1) works from my console: |
Just started getting this error today. Sad to see this library not working anymore due to Yahoo disabling their API. Hopefully they open their API up even if its not free. I'd pay for it if needed. |
Confirmed not working on my side too. Hope Yahoo reopens as a paid service. |
As mentioned above, the library works from the console. I've modified my Google Cloud function to use axios and make direct requests to the quote API. The API works fine. You need to retrieve a crumb using your YF cookie and use it as an API parameter. |
I tried it. doesnt work for me. The library doesn't even work from the console for me.
|
Welp, I filled out the form... Back to Selenium I go 😔 If anybody has any other simple stock/crypto price feeds you know about, let me know |
This form first appeared last year around May or so, so it's definitely not a new thing they just made and set out - but who knows about any new API since the new Yahoo Finance interface is public now. I assume this is just a different cookie/crumb/useragent thing to fix - for me it's working fine on my deployed site but not in dev (maybe because prod has an older crumb?) so I'll be looking into the issue on my end as well. |
Can you explain this in more detail? Specifically how you retrieved a crumb? |
Getting same issues. Additionally, |
https://github.com/achannarasappa/ticker this package is still standing strong. It's not exactly the same but provide stock relation info using yahoo finance api's only. Any effort to incorporate the implementation detail from that package into this one? |
I just ran the tests and all test cases passed. Does it actually access the Yahoo API for any request in |
Can you provide the code for you solution? It would be very much appreciated! |
When removing some cached results the test cases are passed. Access to the API is working with fetching new results in the test cases. |
Using the URL I've just analyzed the network activity when searching for AAPL on the YF site and made the same requests. The API works. UPD: for getcrumb request you also need to set the User-Agent header, otherwise it will respond with "too many requests". |
@programmishka in my logs i see that the crumb is retrieved which indicates that |
Hey all. Firstly, thanks everyone for chiming in. And wow, I personally had never seen the form until now, so thanks for letting me know it's been around for some time. A few comments:
I guess that's encouraging that probably this issue could be worked around, but a) I unfortunately don't have any time to look at this now, and b) we need to be very careful of any legal implications (I'm thinking at least, requiring an extra step from the developer to acknowledge the situation with a link to yahoo's form).
Anyway, let's see what we can do as a community. As I said, I won't have a chance to investigate this now, but maybe others in the community might have some luck in the meantime. Thanks again to everyone above who has posted their findings so far - you guys are awesome! - and also to all users for your understanding of the situation and our stance. P.S. Probably quickest workaround would be to access and accept all terms from your web browser, and then for us to have a good way to import the cookie/crumb for yf2. With the appropriate warnings, acknowledgements and links I mentioned above. Lastly, one big thanks again to this awesome community! 🙏 ❤️ |
@gadicc thanks for the feedback. |
@nocodehummel, my pleasure, thanks for your interest in this :)
|
Some modules (endpoints) are actually working (e.g. calendar and time-series data), while others are not (e.g. quoteSummary).
|
Ah yeah sorry, I thought you meant for new fetches (non-cached). Thanks. Quick update: had a quick chance to look at this now. Using their |
Thanks for the help. After tons of errors finally I got an response as a text and finally I parsed it as JSON. |
Hi all, a fix is building now and there will be an automated message here when the release is published. Thanks to @AbhigyanBafna who first reported the issue and @nocodehummel, @programmishka, @Yhprum who helped to investigate and work towards a fix.
@nocodehummel, this is a great find! And a great compromise that I'm happy to publish. I wasn't willing to ship something that falsified the user-agent, and had intended to provide some explanations and general directions on manually overriding the user-agent by hand. So, on behalf of all our users, thanks for figuring out something that works out the box! Thanks again to everyone who contributed above. The magic of open source remains awesome and keeps helping everyone 🙏 ❤️ |
## [2.11.2](v2.11.1...v2.11.2) (2024-04-17) ### Bug Fixes * **getCrumb:** use getcrumb endpoint to get the crumb (fixes [#764](#764)) ([db0151c](db0151c))
🎉 This issue has been resolved in version 2.11.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
It appears it's broken again since this morning (5/30/2024):
|
Try upgrade to the latest version, it helped me |
OK, the latest version (2.11.3) works. I was using 2.11.2 and it worked until yesterday. Thank you very much, DDushkin. |
version 2.11.3 is not working for me |
I updated the package in the |
Yes, it started working for me again after I upgraded from However, I just realized I'm still getting the same error when running command line |
Thanks everyone for your comments and helping each other out 🙏 @miliu99, you might have a bad cookie stored in your |
After deleting .yf2-cookies.json, I got this:
|
@miliu99 are you sure you're definitely on what does the version field say in |
I just took a closer look at this...
When I check the folder at |
@miliu99 What about performing a clean install of yahoo-finance2 entirely with the latest flag? npm i yahoo-finance2@latest Or if you are using this in a project, you could just modify the package.json -
|
@AbhigyanBafna As I mentioned earlier, it works fine in my project, but I was having trouble with |
Bug Report
Describe the bug
Quote and Quote summary stopped working recently due to invalid crumbs. First encountered it on my NextJS server and was able to reproduce the bug in CLI as well.
Minimal Reproduction
npx yahoo-finance2 quote AAPL
Environment
Node
Node version (if applicable):
v21.6.1
Npm version:
9.5.1
Additional Context
The text was updated successfully, but these errors were encountered: