Open MehbubRashid opened 3 years ago
Not sure if this is possible, but keep an eye on https://github.com/pilwon/node-yahoo-finance/pull/76.
Otherwise maybe through the chart data but we don't have an API for that (yet).
1) Got a question while looking into the library. What is period "v"?
if (!_.includes(['d', 'w', 'm', 'v'], options.period)) { throw new Error('"options.period" must be "d", "w", "m", or "v".'); }
d - day w - week m - month v - what is v ?
2) And, is there any way to indicate what currency the data is?
@jasonjason1207 if you look a few lines further down you'll see:
// Convert to yahoo v7 API
switch (options.period) {
case 'd': options.period = '1d'; break;
case 'w': options.period = '1wk'; break;
case 'm': options.period = '1mo'; break;
case 'v': options.period = '1d'; options.events = 'div'; break;
// No default case needed, options are sanitized above.
}
So actually the 'v' option is from the previous Yahoo API but was kept for consistency so as to not introduce a breaking change into the current major version of node-yahoo-finance. It sets the period to 1d
and requests that Dividend events be included in the history.
And, is there any way to indicate what currency the data is?
Not in the history request, but you can map this later to a quote
request after.
If you're just starting off, check out https://github.com/gadicc/node-yahoo-finance2 which is the beta release of what will likely be our next major release. The quote
API there is a little more developed and you can query all the symbols in a single network request.
How can i get historical data of last hour?