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

Add expiration date to the query for loading option chains #175

Closed
MiErnst opened this issue May 16, 2021 · 4 comments · Fixed by #186
Closed

Add expiration date to the query for loading option chains #175

MiErnst opened this issue May 16, 2021 · 4 comments · Fixed by #186
Labels
enhancement New feature or request released

Comments

@MiErnst
Copy link

MiErnst commented May 16, 2021

Feature Request

When using the API I'm unable to pass in the expiration date of the option chain to query. By default it currently loads the option chain of the nearest expiration.

Wanted Feature

Add support for the query parameter "date" which accepts a timestamp like in this example: https://query1.finance.yahoo.com/v7/finance/options/X?date=1622160000

The available timestamps are available in the result of the default statement when using the API as is:

expirationDates: [
1621555200,
1622160000,
1622764800,
...
]

Use Cases

  • Querying options chains for a specific expiration would allow me to implement my trade management for the expirations I have chosen. Only having access to the nearest option chain does not help.
  • Without the argument, the API doesn't seem to make sense for me.

Potential Example Usage

This feature could be used in the following way:

  const queryOptions = { lang: 'en-US', formatted: false, region: 'US', date: 1622160000};
  const result = await yahooFinance.options('TSLA', queryOptions);
@MiErnst MiErnst added the enhancement New feature or request label May 16, 2021
@advaiyalad
Copy link
Contributor

My fault. I forgot to add this when I created the module. Will send PR soon.

@gadicc
Copy link
Owner

gadicc commented May 26, 2021

@MiErnst, this will be in the next release. There'll be an automatic message here once it's available via npm.

That might only be in another week or two so you're invited to run the development version of the library until then if you like and feel comfortable with it, as described in CONTRIBUTING.md. Please report back if you do.

@MiErnst
Copy link
Author

MiErnst commented May 26, 2021

Thanks for the support.

@gadicc
Copy link
Owner

gadicc commented Jun 1, 2021

🎉 This issue has been resolved in version 1.11.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gadicc gadicc added the released label Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants