node-yahoo-finance2 icon indicating copy to clipboard operation
node-yahoo-finance2 copied to clipboard

chart api fails when stock ticker contains a period such as BRK.B

Open craigrs84 opened this issue 1 year ago • 1 comments

Bug Report

Describe the bug

api fails when stock ticker contains a period such as BRK.B

Minimal Reproduction

await yfinance.chart('BRK.B', { period1: new Date(), period2: new Date() - 100, interval: '1d' });

Environment

Browser or Node: node Node version (if applicable): latest LTS version Npm version: Browser verion (if applicable): Library version (e.g. 1.10.1):

Additional Context

craigrs84 avatar Feb 17 '25 01:02 craigrs84

I just had the same error today.

I fixed it when I realized that yahoo finance uses BRK-B instead of BRK.B on their page.

See https://finance.yahoo.com/quote/BRK-B

YannickDot avatar Feb 22 '25 13:02 YannickDot

Hi all, thanks, yes, as @YannickDot said, there is no such symbol BRK.B on Yahoo and you probably meant BRK-B, so, the error:

Error: Uncaught (in promise) Error: No data found, symbol may be delisted

is accurate. Chart API works fine for sybols with dots / periods.

gadicc avatar Aug 25 '25 10:08 gadicc