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

Parameters
  • symbol (str) – A valid symbol

  • expiration (str, optional) – A valid expiration date

  • option_side (str, optional) – Option side - put or call 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  20201217
1  20201218
2  20201224
3  20201231
4  20210103

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")