tyrauber / stock_quote

A ruby gem that retrieves stock quotes from IEX
MIT License
211 stars 55 forks source link

Yahoo Finance is back online #68

Closed snex closed 1 year ago

snex commented 2 years ago

The Yahoo Finance API is back online. Are there any plans to include it in this gem? The IEX one has numerous problems such as constantly banning VPNs, inconsistent update times of previous day's quotes, inability to get prior day's close price after the market as opened, and likely others. The Yahoo one always worked great. If you are not planning to do this yourself, I could probably fork and make a pull req when I have some free time if you are willing to pull it in. Please let me know.

tyrauber commented 2 years ago

Cool. I was unaware that the Yahoo Finance API is back online. Is this what you are referring to https://www.yahoofinanceapi.com/ Is this even affiliated with Yahoo? I see no copyright or terms and conditions?

I've rewritten this gem a half a dozen times over the last few years, switching between yahoo, google, yahoo again, google again, and IEX. I am wary of switching again. It is very difficult to not introduce breaking changes when you switch between data sources.

With that being said, after multiple rewrites, I came up with a very simple structure of meta programming in one class that could easily be applied to multiple endpoints, through inheritance, for example StockQuote:Yahoo and 1StockQuote:IEX`. I could easily see adapting this class to support multiple api endpoints. If this is in fact, a legal yahoo api service.

snex commented 2 years ago

Oh good catch. I did a whois on the domain and it looks like it's owned by somebody in Russia. I still would like to get away from IEX if possible, so I will continue to keep an eye out.

snex commented 2 years ago

Just to add some salt to this thread, IEX has now decided to drop mutual funds entirely. This makes them completely useless for my project and no doubt countless others. I know it's not the fault of this gem's author but it really speaks as to how important it is for there to be alternative APIs in this space. And somehow, there are... none. It's like they want us all to go back to reading the morning paper or something.