Giter VIP home page Giter VIP logo

Comments (27)

dshe avatar dshe commented on July 30, 2024 1

I suggest you try: https://github.com/dshe/YahooQuotesApi

from yahoofinanceapi.

fancyplot avatar fancyplot commented on July 30, 2024 1

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.

from yahoofinanceapi.

sebduu avatar sebduu commented on July 30, 2024 1

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

Ciaoooo

Yes it works again, thank you !!

from yahoofinanceapi.

Callightman avatar Callightman commented on July 30, 2024 1

Using synchronous calls and 1 second delay has solved the problem.

from yahoofinanceapi.

dshe avatar dshe commented on July 30, 2024 1

I suggest you try the new version (5.1): https://github.com/dshe/YahooQuotesApi

from yahoofinanceapi.

fancyplot avatar fancyplot commented on July 30, 2024 1

YahooFinanceApi.zip
This are my changes that I made to the code in master branch. Just replace files in original solution with files from archive and than rebuild.

from yahoofinanceapi.

stagnoman avatar stagnoman commented on July 30, 2024 1

YahooFinanceApi.zip This are my changes that I made to the code in master branch. Just replace files in original solution with files from archive and than rebuild.

Thanks for the Code. Now i experience errors after the change and after several requests:

"Call failed with status code 401 (Unauthorized)"

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.
A 401 error code means the user is unauthorised.

To avoid the error, the method must be synchronous. I use a Thread.Sleep pause of 500 ms,/1s between requests.
Avoid any parallelism.

from yahoofinanceapi.

sebduu avatar sebduu commented on July 30, 2024

Same problem for me....

from yahoofinanceapi.

sebduu avatar sebduu commented on July 30, 2024

I suggest you try: https://github.com/dshe/YahooQuotesApi

My program is in VB.net, can I use a C# Api with?

from yahoofinanceapi.

giorgiovaccarino avatar giorgiovaccarino commented on July 30, 2024

"I suggest you try: https://github.com/dshe/YahooQuotesApi"

give me this problem:

YahooHistory: failure to reset HttpClient.
in YahooQuotesApi.YahooHistoryRequester.d__9.MoveNext() in C:\projects\yahooquotesapi\YahooQuotesApi\History\YahooHistoryRequester.cs: riga 98
in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
in System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
in System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() in YahooQuotesApi.YahooHistoryRequester.<Reset>d__8.MoveNext() in C:\projects\yahooquotesapi\YahooQuotesApi\History\YahooHistoryRequester.cs: riga 67 in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in YahooQuotesApi.YahooHistoryRequester.<Request>d__7.MoveNext() in C:\projects\yahooquotesapi\YahooQuotesApi\History\YahooHistoryRequester.cs: riga 35 in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
in YahooQuotesApi.YahooHistory.d__71.MoveNext() in C:\projects\yahooquotesapi\YahooQuotesApi\History\YahooHistory.cs: riga 65 in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) in System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
in YahooQuotesApi.ParallelProducerCache2.<Get>d__4.MoveNext() in C:\projects\yahooquotesapi\YahooQuotesApi\Utilities\ParallelProducerCache.cs: riga 34 in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) in System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
in YahooQuotesApi.YahooHistory.d__61.MoveNext() in C:\projects\yahooquotesapi\YahooQuotesApi\History\YahooHistory.cs: riga 36 in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) in System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
in YahooQuotesApi.YahooQuotes.<b__12_0>d.MoveNext() in C:\projects\yahooquotesapi\YahooQuotesApi\YahooQuotes.cs: riga 142
in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
in System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
in System.Runtime.CompilerServices.ValueTaskAwaiter.GetResult()
in System.Threading.Tasks.Parallel.<>c__501.<<ForEachAsync>b__50_0>d.MoveNext() in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in YahooQuotesApi.YahooQuotes.<AddHistoryToSecurities>d__12.MoveNext() in C:\projects\yahooquotesapi\YahooQuotesApi\YahooQuotes.cs: riga 157 in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in YahooQuotesApi.YahooQuotes.<GetSecuritiesAsync>d__10.MoveNext() in C:\projects\yahooquotesapi\YahooQuotesApi\YahooQuotes.cs: riga 93 in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
in YahooQuotesApi.YahooQuotes.d__9.MoveNext() in C:\projects\yahooquotesapi\YahooQuotesApi\YahooQuotes.cs: riga 68
in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
in System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
in System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() in YahooQuotesApi.YahooQuotes.<GetAsync>d__7.MoveNext() in C:\projects\yahooquotesapi\YahooQuotesApi\YahooQuotes.cs: riga 45 in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
in YahooQuotesApi.YahooQuotes.d__6.MoveNext() in C:\projects\yahooquotesapi\YahooQuotesApi\YahooQuotes.cs: riga 29
in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
in System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
in System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
in Ts.Core.MarketData.YahooConnector2.<>c__DisplayClass6_0.<b__0>d.MoveNext() in C:\Users\giorg\source\repos\TS\Ts.Core\MarketData\YahooConnector2.cs: riga 34

from yahoofinanceapi.

stagnoman avatar stagnoman commented on July 30, 2024

Hi all,
thks a lot
in case YahooFinanceApi doesn't work anymore, I will switch to yfinance

from yahoofinanceapi.

DonWM avatar DonWM commented on July 30, 2024

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#,

from yahoofinanceapi.

stagnoman avatar stagnoman commented on July 30, 2024

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.

from yahoofinanceapi.

DonWM avatar DonWM commented on July 30, 2024

from yahoofinanceapi.

stagnoman avatar stagnoman commented on July 30, 2024

Great thks! I modified the dll removing check too, It works perfectly!

from yahoofinanceapi.

sebduu avatar sebduu commented on July 30, 2024

good news ! Can someone explain how to remove the check? I'm not familiar with this kind of programation.

from yahoofinanceapi.

stagnoman avatar stagnoman commented on July 30, 2024

good news ! Can someone explain how to remove the check? I'm not familiar with this kind of programation.

hi,
1\ open your program in visual studio
2\ go in references, remove existing YahooFinanceApi.dll,
2\ unzip attached dll. Then in references: right mouse button, add reference and use YahooFinanceApi.dll unzipped
3\ rebuild solution

from yahoofinanceapi.

stagnoman avatar stagnoman commented on July 30, 2024

good news ! Can someone explain how to remove the check? I'm not familiar with this kind of programation.

Hi pls disregard the previous dll attached. It doesn't work.
I am working on it.
I will send you late afternoon
Ciao

from yahoofinanceapi.

stagnoman avatar stagnoman commented on July 30, 2024

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

Ciaoooo

from yahoofinanceapi.

DonWM avatar DonWM commented on July 30, 2024

from yahoofinanceapi.

stagnoman avatar stagnoman commented on July 30, 2024

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: @.*** @.***> >

Is this YahooFinanceApi.dll now ok? Yes, it works.
Will there be a normal upgrade through NuGet for this - a new version 2.1.3? No, in Nuget there is the old one. You have to replace the old dll with mine attached above manually in VS, build the program then.

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

from yahoofinanceapi.

Callightman avatar Callightman commented on July 30, 2024

For me it does'nt work after 5-6 querry it responds with 401 error

from yahoofinanceapi.

stagnoman avatar stagnoman commented on July 30, 2024

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.
A 401 error code means the user is unauthorised.

To avoid the error, the method must be synchronous. I use a Thread.Sleep pause of 500 ms,/1s between requests.
Avoid any parallelism.

from yahoofinanceapi.

brutm avatar brutm commented on July 30, 2024

@lucastagnitta thanks for your dll but i have a problem. Assembly errors with Flurl

from yahoofinanceapi.

stagnoman avatar stagnoman commented on July 30, 2024

@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
Flurl 2.5.2
Flurl.Http 2.1.0

from yahoofinanceapi.

kyi87 avatar kyi87 commented on July 30, 2024

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.

Could you please show your exact changes in "YahooClientFactory.cs"? Would be very helpful. Thank you!

from yahoofinanceapi.

kyi87 avatar kyi87 commented on July 30, 2024

YahooFinanceApi.zip This are my changes that I made to the code in master branch. Just replace files in original solution with files from archive and than rebuild.

Thanks for the Code. Now i experience errors after the change and after several requests:

"Call failed with status code 401 (Unauthorized)"

Do you experienced the same problem?

from yahoofinanceapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.