-
Notifications
You must be signed in to change notification settings - Fork 58
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
Exception: Failure to create client #52
Comments
I suggest you try: https://github.com/dshe/YahooQuotesApi |
Same problem for me.... |
My program is in VB.net, can I use a C# Api with? |
give me this problem: YahooHistory: failure to reset HttpClient. |
Hi all, |
I had same problem getting history data from Yahoo on both YahooFinanceAPI and YahooQuotesAPI. Did yahoo change something to break the code? Did windows have an update that broke the code? Both work to get current quotes - just not the history. I can get yahoo history data using python's pandas_datareader without a problem but I need it from C#, |
honestly speaking, I had no time to deeply investigate the problem yet. I believe it is protocol http client request vs yahoo server but I am not sure. (maybe ... HTTP2 vs HTTP1) |
For some reason, pandas datareader still works to get Yahoo data. And I had code to get data from Tiingo though it has data limits. I normally use Norgate data for most of what I do but need Yahoo for mutual fund data.
From: stagnoman ***@***.***>
Sent: Saturday, April 30, 2022 12:41 PM
To: karlwancl/YahooFinanceApi ***@***.***>
Cc: DonWM ***@***.***>; Comment ***@***.***>
Subject: Re: [karlwancl/YahooFinanceApi] Exception: Failure to create client (Issue #52)
honestly speaking, I had no time to deeply investigate the problem yet. I believe it is protocol http client request vs yahoo server but I am not sure. (maybe ... HTTP2 vs HTTP1)
For the time being, I solved the problem using yfinance that is widely supported and used in the community. It is easy to wrap into a C# project without any performance loss.
—
Reply to this email directly, view it on GitHub <#52 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AHQQC4NRZF6KABZNUBAUPELVHWEC5ANCNFSM5UT2IF3A> .
You are receiving this because you commented. <https://github.com/notifications/beacon/AHQQC4L4CZ7OTSVRZLSW7C3VHWEC5A5CNFSM5UT2IF3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIJTPGLQ.gif> Message ID: ***@***.*** ***@***.***> >
|
Hi, I looked into the code. The problem is that now cookies are empty in response from yahoo finance and that's why it doesn't pass the check that cookies shouldn't be empty. This is the code where it fails https://github.com/karlwancl/YahooFinanceApi/blob/master/YahooFinanceApi/YahooClientFactory.cs. I removed that check and also modified the code for retrieving a crumb. For me now it works fine. I'd push the branch but seems I don't have access rights on doing this. |
Great thks! I modified the dll removing check too, It works perfectly! |
good news ! Can someone explain how to remove the check? I'm not familiar with this kind of programation. |
hi, |
Hi pls disregard the previous dll attached. It doesn't work. |
Pls replace your old YahooFinanceApi.dll with this attached below. Ciaoooo |
Is this YahooFinanceApi.dll now ok?
Will there be a normal upgrade through NuGet for this - a new version 2.1.3?
There is also an a 3.0.0-beta3 but is has lots of changes and isn’t very compatible with 2.1.2. I’ve avoided using this so far since it is so different.
Thanks,
Don
From: stagnoman ***@***.***>
Sent: Wednesday, May 4, 2022 5:53 AM
To: karlwancl/YahooFinanceApi ***@***.***>
Cc: DonWM ***@***.***>; Comment ***@***.***>
Subject: Re: [karlwancl/YahooFinanceApi] Exception: Failure to create client (Issue #52)
good news ! Can someone explain how to remove the check? I'm not familiar with this kind of programation.
Pls replace your old YahooFinanceApi.dll with this attached below.
YahooFinanceApi.zip <https://github.com/karlwancl/YahooFinanceApi/files/8620456/YahooFinanceApi.zip>
Ciaoooo
—
Reply to this email directly, view it on GitHub <#52 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AHQQC4L2CZPWVLFLPXIM54LVIJXLHANCNFSM5UT2IF3A> .
You are receiving this because you commented. <https://github.com/notifications/beacon/AHQQC4JDI2ERAV42MDS7KBDVIJXLHA5CNFSM5UT2IF3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIKME4DQ.gif> Message ID: ***@***.*** ***@***.***> >
|
Yes it works again, thank you !! |
Is this YahooFinanceApi.dll now ok? Yes, it works. There is also an a 3.0.0-beta3 but is has lots of changes and isn’t very compatible with 2.1.2. I’ve avoided using this so far since it is so different. Dll above is still net 2.0 |
For me it does'nt work after 5-6 querry it responds with 401 error |
The 401 error was also happening with old dll. Yahoo has implemented some kind of time out defense against sever overloading and potential ddos attacks by tracking the number / frequency of requests from a specific ip address. To avoid the error, the method must be synchronous. I use a Thread.Sleep pause of 500 ms,/1s between requests. |
Using synchronous calls and 1 second delay has solved the problem. |
@lucastagnitta thanks for your dll but i have a problem. Assembly errors with Flurl |
In the past, I got some troubles as well, I am using the following version, installed manually |
I suggest you try the new version (5.1): https://github.com/dshe/YahooQuotesApi |
Could you please show your exact changes in "YahooClientFactory.cs"? Would be very helpful. Thank you! |
YahooFinanceApi.zip |
Thanks for the Code. Now i experience errors after the change and after several requests:
Do you experienced the same problem? |
yes, the 401 error was also happening with old dll. Yahoo has implemented some kind of time out defense against sever overloading and potential ddos attacks by tracking the number / frequency of requests from a specific ip address. To avoid the error, the method must be synchronous. I use a Thread.Sleep pause of 500 ms,/1s between requests. |
Hi there,
I have always successfully used YahooFinanceApi. Today I am getting the following exception using "GetHistoricalAsync": Exception: Failure to create client. Could you kindly tell me what I can do to resolve the exception?
Many Thks for your help
Regards
LUCA
The text was updated successfully, but these errors were encountered: