Replies: 21 comments 13 replies
-
Issues with YahooJSON Quote SourceRecent issues with the source used by the YahooJSON.pm module, there is a need to explore new data sources in case Yahoo blocks access to all of its URLs that return JSON. At some point in the future the module may need to be replaced by one that does a web scrape of pages such as https://finance.yahoo.com/quote/F?p=F&.tsrc=fin-srch. Other sources such as the Marketstack API may be considered. Those users with trading accounts with brokers like E*Trade may benefit from modules that utilize their APIs. These are a bit more complicated, since access mechanisms like SAML may be required. This would likely require access credentials that users would need to configure locally and securely. |
Beta Was this translation helpful? Give feedback.
-
Some APIs to check out |
Beta Was this translation helpful? Give feedback.
-
All four of these examples are similar to IEXCloud - API key + REST API + json response. One interesting thing is Marketstack free tier doesn't support https - so if a user subscribes to the service, it would be nice to use the secure endpoint. This fits into the "feature" concept with Marketstack having both an "API_KEY" and "USE_HTTPS" feature field. Any opinion on which of these sources to try first? I'm happy to open a PR for one of them. |
Beta Was this translation helpful? Give feedback.
-
I haven't looked too deeply into them yet. In my opinion which ever has the best free offering with respect to maximum number of queries and minimal throttling would be a good choice. Some time ago I started a World Trading Data module, and WTD was then renamed or acquired by Marketstack. But rather than exploring new sources, maybe look at one of the two recent issues of modules recently not working. The Bourso one is likely a quick fix, just removing spaces from the "last" value. Tradeville is a bit more involved. Change of URL and likely a much different parse/extraction logic of the HTML. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Just posting this here so its handy. The v11 Yahoo API has multiple modules. Need to use more than one to get other data currently returned from the v6 API.
To replace the v6 URL we would not need all of these, but for EPS in addition to basic price data at least two are needed (I think summaryProfile and financialData). |
Beta Was this translation helpful? Give feedback.
-
I happened to look at FTfunds.pm this morning and I think with a bit of attention it might be usable for more than just UK Unit Trusts. If I do get it tidied I reckon it'll take at least 2 years for the people in charge here to implement the changes so no chance of it being overused :) (See Alphavantege.pm in issues) |
Beta Was this translation helpful? Give feedback.
-
There is at least one further issue, the providers of data don't know that F::Q is a once-a-day. Yahoo don't mind me getting data from them multiple times a day using their app or their website. I see adverts, news articles, etc and get the prices for free. Other projects have presumed prices per second are a right, AlphaVantage have reacted, Yahoo are reacting. How do we get back to "I want one price a day, hope that's OK" in the face of multiple hits per second from other projects ? |
Beta Was this translation helpful? Give feedback.
-
@vincentl, et al, Currently for AlphaVantage and the yet to be added TwelveData modules, we force throttling whether a user has a free or premium key. Maybe another parameter could be passed to those module, |
Beta Was this translation helpful? Give feedback.
-
Just a thought. I'm expecting Yahoo to pull the plug on using the v10/v11 URLs sometime down the road. Anybody want to start work on YahooWeb.pm that uses HTML::TableExtract and/or HTML::TreeBuilder (or other modules) to grab the needed data from URLs such as https://finance.yahoo.com/quote/AAPL?p=AAPL? |
Beta Was this translation helpful? Give feedback.
-
@vincentl - I am going to delete most, if not all, of the stale branches that are around 10 years old or more. Unless you can think of a really good reason to keep them around. Too bad GitHub did not have an "archive" option for branches. Although I can do something like:
|
Beta Was this translation helpful? Give feedback.
-
@vincentl, et al., I stumbled across MarketWatch as a viable candidate for relatively easy screen scraping.
The rest of the HTML contains a unordered list with other useful data:
|
Beta Was this translation helpful? Give feedback.
-
I have begun looking at screen scraping |
Beta Was this translation helpful? Give feedback.
-
Yahoo appears to have closed the door on access to the finance.yahoo.com/v?? URLs that return JSON. Sadly this means that the YahooJSON modules (there is one for currency rates) are going to be removed from the next release of F::Q. I am going to be scarce the next couple weeks and not be much, if any, work on Finance::Quote. Sorry. |
Beta Was this translation helpful? Give feedback.
-
Longtime F::Q (via GnuCash) user here. Thank you. Now that Yahoo has pulled the plug, I guess in the interim I'll revert to Alphavantage and deal with throttling. I'm willing to put some work into developing better alternatives. I'm not fluent in Perl (despite sharing an office with Larry Wall at JPL around 1990) and don't know much about F::Q internals, but if someone sets up a stub that queries a source for something, I can do the grunt work to add whatever else it needs to get. |
Beta Was this translation helpful? Give feedback.
-
I forked the repo and set up a little test rig set up so I can make changes to GoogleWeb.pm and inspect the JSON returned by some simple queries. The last close, day range, etc. appear in blocks like this:
I don't know anything about front-end code. Are those class attributes stable? Would it make sense to find all divs with class="ghFHrc" and build a hash mapping titles (e.g., "Previous close") to values (e.g., "$60.81") and then transforming as necessary to map to the F::Q result hash? |
Beta Was this translation helpful? Give feedback.
-
So I added a simple way to count the amount of times each fetch method was called in Quote.pm. It was in the v1.57 release. Since then here is the running count for the month of July 2023. Please note however, that early on I discovered that a single address was hitting the
|
Beta Was this translation helpful? Give feedback.
-
How goes the testing? If you want to get your hands dirty working on something that would be helpful, have a look at #324. The Bloomberg module recently broke due to web site changes. Aside from need to get and use cookies, the format of the HTML has changed. Thanks. |
Beta Was this translation helpful? Give feedback.
-
I did some poking around MarketStack. Contrary to what @vincentl said earlier, the MarketStack API is available through HTTPS. While the free tier 100 requests per month may seem limiting at first, they do offer a end-of day API that allows multiple symbols. many F::Q users (including GnuCash users) only update stock prices once a day. Thirty or thirty-One requests per month falls way below the 100 per month limitation. |
Beta Was this translation helpful? Give feedback.
-
I have no idea whether they provide a convenient API, but a website I find very useful for both funds and stocks is finanzen.net. |
Beta Was this translation helpful? Give feedback.
-
Checked today, and Marketwatch.com no longer works... It looks like stockdata.org is may be a decent API Key based source. Their free plan is 100 requests daily. If there are no volunteers, I may start cobbling a module together next week. |
Beta Was this translation helpful? Give feedback.
-
Another possible API source with 100 daily requests - https://www.marketdata.app/#pricing |
Beta Was this translation helpful? Give feedback.
-
General discussion about exploring new sources for quote data.
Beta Was this translation helpful? Give feedback.
All reactions