Skip to content

Instantly share code, notes, and snippets.

symbol="AAPL" #AAPL is the symbol for Apple Inc.
d = "22/03/2022"
timestamp=time.mktime(datetime.datetime.strptime(d, "%d/%m/%Y").timetuple())
URL=('https://yfapi.net/v7/finance/options/'
'{}?'
'date={}'
)
URL=URL.format(symbol,"{timestamp}")
header = {