Options¶
End of Day Options¶
End of day options prices are available through the top-level function
get_eod_options
for a single symbol.
- iexfinance.stocks.get_eod_options(symbol, expiration=None, option_side=None, **kwargs)¶
End of Day Options
Returns a list of option expiration dates for a given symbol
Reference: https://iexcloud.io/docs/api/#end-of-day-options
- symbol: str
A valid symbol
- expiration: str, optional
A valid expiration date
- option_side: str, optional
Option side -
put
orcall
will return only those types of contracts
List of Expiration Dates¶
To obtain a list of all options expiration dates for a symbol, simply call get_eod_options
with a symbol only:
In [1]: from iexfinance.stocks import get_eod_options
In [2]: get_eod_options("AAPL", output_format='pandas').head()
Out[2]:
0
0 20210522
1 20210605
2 20210617
3 20210623
4 20210702
Options For A Single Date¶
To obtain the end-of-day prices of options contracts for a single expiration date (in the form YYYYMM
):
get_eod_options("AAPL", "201906")
Calls/Puts Only¶
It is possible to limit option results to calls or puts only:
get_eod_options("AAPL", "201906", "calls")
or:
get_eod_options("AAPL", "201906", "puts")