Skip to content
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

If this happens consistently, Yahoo output has changed and you should open a bug report. #88

Open
DIVYA-19 opened this issue Dec 27, 2022 · 2 comments

Comments

@DIVYA-19
Copy link

DIVYA-19 commented Dec 27, 2022

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);
    })
@gadicc
Copy link
Collaborator

gadicc commented Dec 29, 2022

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
]

@DIVYA-19
Copy link
Author

DIVYA-19 commented Jan 2, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants