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

ScreenerResult #852

Open
kreimben opened this issue Dec 29, 2024 · 0 comments
Open

ScreenerResult #852

kreimben opened this issue Dec 29, 2024 · 0 comments
Labels
bug Something isn't working validation Issues related to validation

Comments

@kreimben
Copy link

Validation Error

Minimal Reproduction

yahooFinance.screener({
  scrIds: scrIds as z.infer<typeof ScreenerInputSchema>['scrIds'],
  count: Number(count),
  lang: lang,
  region: region
})
.then((result) => res.json(result))
.catch((error) => {
  throw new ApiError(
    'Failed to fetch screener data',
    error instanceof Error ? error.message : 'Unknown error',
    500
  );
});

Symbol(s) that it happened for

Error Message

Server is running on http://localhost:3000
[Validate] Request query: { scrIds: 'growth_technology_stocks', count: '15' }
[Validate] Validation success: {
  success: true,
  data: {
    scrIds: 'growth_technology_stocks',
    count: 15,
    lang: 'en-US',
    region: 'US'
  }
}
Please consider completing the survey at https://bit.ly/yahoo-finance-api-feedback if you haven't already; for more info see https://github.com/gadicc/node-yahoo-finance2/issues/764#issuecomment-2056623851.  This will only be shown once, but you can suppress this message in future with `yahooFinance.suppressNotices(['yahooSurvey'])`.
Fetching crumb and cookies from https://finance.yahoo.com/quote/AAPL...
(node:25794) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)
We expected a redirect to guce.yahoo.com, but got https://finance.yahoo.com/quote/AAPL/
We'll try to continue anyway - you can safely ignore this if the request succeeds
Success. Cookie expires on Mon Dec 29 2025 18:35:13 GMT+0900 (Korean Standard Time)
fetch https://query1.finance.yahoo.com/v1/test/getcrumb
New crumb: gLNwnnG1LgW
{
  "type": 45,
  "schema": {
    "type": "string"
  },
  "path": "/quotes/11/longName",
  "message": "Expected required property"
}

    This may happen intermittently and you should catch errors appropriately.
    However:  1) if this recently started happening on every request for a symbol
    that used to work, Yahoo may have changed their API.  2) If this happens on
    every request for a symbol you've never used before, but not for other
    symbols, you've found an edge-case (OR, we may just be protecting you from
    "bad" data sometimes stored for e.g. misspelt symbols on Yahoo's side).
    Please see if anyone has reported this previously:
    
      https://github.com/gadicc/node-yahoo-finance2/issues?q=is%3Aissue+ScreenerResult
    
    or open a new issue (and mention the symbol):  yahoo-finance2 v2.13.3
    
      https://github.com/gadicc/node-yahoo-finance2/issues/new?labels=bug%2C+validation&template=validation.md&title=ScreenerResult
    
    For information on how to turn off the above logging or skip these errors,
    see https://github.com/gadicc/node-yahoo-finance2/tree/devel/docs/validation.md.
    
    At the end of the doc, there's also a section on how to
    [Help Fix Validation Errors](https://github.com/gadicc/node-yahoo-finance2/blob/devel/docs/validation.md#help-fix)
    in case you'd like to contribute to the project.  Most of the time, these
    fixes are very quick and easy; it's just hard for our small core team to keep up,
    so help is always appreciated!
    
ApiError: Failed to fetch screener data
    at /Users/kreimben/Repository/FinScope-YFinance/src/routers/screener/screener.router.ts:67:15
    at processTicksAndRejections (node:internal/process/task_queues:105:5) {
  statusCode: 500,
  details: 'Failed Yahoo Schema validation'
}
[nodemon] app crashed - waiting for file changes before starting...

Environment

Browser or Node:
Node version (if applicable): v23.5.0
Npm version: 10.9.2
Browser version (if applicable):
Library version (e.g. 1.10.1): 2.13.3

Additional Context

@kreimben kreimben added bug Something isn't working validation Issues related to validation labels Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working validation Issues related to validation
Projects
None yet
Development

No branches or pull requests

1 participant