dpguthrie / dpguthrie/yahooquery

Some contracts missing in option_chain

Open
#306 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
920
Forks
164
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
There appears to be some contracts that show up on the Yahoo website but not when querying with yahooquery.

**To Reproduce**

https://finance.yahoo.com/quote/%5ESPX/options/?date=1742515200&strike=5900

shows `SPX250321C05900000`:

https://finance.yahoo.com/quote/SPX250321C05900000/

But when querying this:

```python
>>> option_chain = yahooquery.Ticker('^SPX').option_chain
>>> option_chain.loc[lambda df: df["contractSymbol"] == 'SPX250321C05900000']
Empty DataFrame
Columns: [contractSymbol, strike, currency, lastPrice, change, percentChange, openInterest, bid, ask, contractSize, lastTradeDate, impliedVolatility, inTheMoney, volume]
Index: []
>>> option_chain.loc[lambda df: df["contractSymbol"].str.startswith('SPX250321C059')]
contractSymbol strike currency lastPrice change percentChange openInterest bid ask contractSize lastTradeDate impliedVolatility inTheMoney volume
symbol expiration optionType
^SPX 2025-03-21 calls SPX250321C05905000 5905.0 USD 235.20 0.000000 0.000000 1455 276.5 280.4 REGULAR 2024-12-20 16:06:49 0.176964 True 2073.0
calls SPX250321C05910000 5910.0 USD 240.00 0.000000 0.000000 1717 272.1 276.5 REGULAR 2024-12-23 21:04:05 0.176098 True 201.0
calls SPX250321C05915000 5915.0 USD 218.00 0.000000 0.000000 1276 269.9 272.6 REGULAR 2024-12-20 15:41:52 0.175219 True 1074.0
calls SPX250321C05920000 5920.0 USD 228.32 0.000000 0.000000 0 264.9 268.7 REGULAR 2024-12-20 16:12:55 0.174327 True 1338.0
...

```

**Expected behavior**
5900 strike price should show up above, but it only starts from 5905.

**Screenshots**
![Screenshot_25-12-2024_13039_finance yahoo com](https://github.com/user-attachments/assets/317efe39-59f8-4d27-9850-31c8fca1bdbc)
![Screenshot_25-12-2024_125847_finance yahoo com](https://github.com/user-attachments/assets/2b166d0f-91e5-4ffc-9d60-bf8ee703ff48)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.