gadicc / node-yahoo-finance2

Unofficial API for Yahoo Finance
https://www.npmjs.com/package/yahoo-finance2
MIT License
373 stars 62 forks source link

Getting multiple "missing property" errors when searching for Hong Kong Stock Exchange Tickers #749

Closed GiorgioBaz closed 6 months ago

GiorgioBaz commented 6 months ago

Bug Report

Describe the bug

I'm currently using the .quote method to query yahoo on an array of a couple hundred stock tickers, but multiple are coming back with errors in the form of

{
[0]       instancePath: '/10',
[0]       schemaPath: '#/definitions/QuoteEtf/required',
[0]       keyword: 'required',
[0]       params: { missingProperty: 'gmtOffSetMilliseconds' },
[0]       message: "must have required property 'gmtOffSetMilliseconds'",
[0]       data: {
[0]         language: 'en-US',
[0]         region: 'US',
[0]         quoteType: 'ETF',
[0]         typeDisp: 'ETF',
[0]         triggerable: false,
[0]         customPriceAlertConfidence: 'LOW',
[0]         longName: 'Listed Index Fund FTSE Jpn Green Chip 35',
[0]         esgPopulated: false,
[0]         hasPrePostMarketData: false,
[0]         priceHint: 2,
[0]         tradeable: false,
[0]         cryptoTradeable: false,
[0]         symbol: '1347'
[0]       }

Minimal Reproduction

let stockTickers = [80020, 3900, 1347, 1548, 1308]
await yahooFinance.quote(stockTickers)

Environment

Node Node version (if applicable): v18.16.0 Npm version: 9.5.1 Library version (e.g. 1.10.1): yahoo-finance2 v2.9.0

GiorgioBaz commented 6 months ago

Whoops, seems to fix itself if you add the .hk to the end of the stock tickers, mb mb