-
Notifications
You must be signed in to change notification settings - Fork 66
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
quoteCombine
for quoteSummary
function ?
#114
Comments
quoteCombine
for quoteSummary
functionquoteCombine
for quoteSummary
function ?
I don't think so, since the yahoo finance API's endpoint doesn't support multiple symbols at once. The whole point of combining network calls would be lost. What do you think, @gadicc? |
Hey @RoXioTD, thanks for the issue. @PythonCreator27 is correct, To get started (this will become part of the docs soon): const symbols = ['TSLA', 'MSFT', 'AAPL'];
// Will perform one request at a time, one after the other
const data = [];
for (let symbol of symbols)
data.push(await yahooFinance.quoteSummary(symbol));
// Will perform all requests simultaneously (not great for > ~8 symbols)
const data = Promise.all(symbols.map(symbol => yahooFinance.quoteSummary(symbol))); Both approaches return an identical result, the only different is that the 2nd method performs all requests at the same time. You can use something like p-limit to limit the number of simultaneous requests to something like 8 or whatever is appropriate for your network. I'm currently working on baking this in with #76, so you can watch that space. That will make it easier to limit the total concurrent calls across different functions or callbacks, which has the same convenience of Hope that all makes sense and let me know if you have any more questions. The code above is not tested but should be good 😅 |
@PythonCreator27 @gadicc Thx for your answers and explanantions. Sounds good to me. |
Currently its possible to combine multiple
quote
calls into a single call viaquoteCombine
, see also QuoteCombine docs.I was wondering if it would make sense to offer the exact same functionality for the
quoteSummary
function?The text was updated successfully, but these errors were encountered: