node-yahoo-finance
node-yahoo-finance copied to clipboard
If this happens consistently, Yahoo output has changed and you should open a bug report.
Getting this message on a get request
If this happens consistently, Yahoo output has changed and you should open a bug report.
code
yahooFinance.historical({
symbol: "AAPL",
from: '2012-01-01',
to: '2022-12-31'
}, function (err, quotes) {
console.log(quotes);
})
Hey @DIVYA-19, thanks for reporting.
Can you try with yahoo-finance2
? (You'll need to read UPGRADING.md first).
This works for me (using yahoo-finance2):
$ yahoo-finance historical AAPL '{"period1":"2012-01-01","period2":"2022-12-31"}'
[
{
date: 2012-01-03T00:00:00.000Z,
open: 14.621429,
high: 14.732143,
low: 14.607143,
close: 14.686786,
adjClose: 12.51928,
volume: 302220800
},
// ... about 2700 results
]
I am getting below error when I used yahoo-finance2
Uncaught (in promise) TypeError: URLSearchParams is not a constructor
Any idea why I am seeing this error?