I'm a beginner Python coder. I've been trying to get the opening stock price for a range of dates using the IEX API.
My json values are showing:
{'AAPL': {'2017-02-09': {'open': 129.1019, 'high': 129.8815, 'low': 128.5821, 'close': 129.8569, 'volume': 28349859.0}, '2017-02-10': {'open': 129.8962, 'high': 130.3669, 'low': 129.4941, 'close': 129.5628, 'volume': 20065458.0}, '2017-02-13': {'open': 130.5042, 'high': 131.2299, 'low': 130.1806, 'close': 130.7101, 'volume': 23035421.0}}}
If I only want to show only the 'open' prices for all the dates, how do I do that?
I've been googling lists and dictionaries but couldn't find anything useful...
from iexfinance import get_historical_data
from datetime import datetime
import json
start = datetime(2017, 2, 9)
end = datetime(2017, 2, 13)
f = get_historical_data("AAPL", start, end, output_format='json')
json_string = json.dumps(f)
json_read = json.loads(json_string)
print(json_read)