-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Description
symbol_groups = list(chunks(stocks['Ticker'], 100))
symbol_strings = []
for i in range(0, len(symbol_groups)):
symbol_strings.append(','.join(symbol_groups[i]))
final_dataframe = pd.DataFrame(columns=my_col)
for symbol_string in symbol_strings:
batch_api_call_url = f'https://cloud.iexapis.com/stable/stock/market/batch/types=quote&symbols={symbol_string}&token={IEX_CLOUD_API_TOKEN}'
data = requests.get(batch_api_call_url).json()
for symbol in data:
if data[symbol]['quote']:
final_dataframe = final_dataframe.append(
pd.Series([symbol,
data[symbol]['quote']['latestPrice'],
data[symbol]['quote']['marketCap'],
'N/A'],
index=my_col),
ignore_index=True)
Metadata
Metadata
Assignees
Labels
No labels

