nickmccullum / algorithmic-trading-python

The repository for freeCodeCamp's YouTube course, Algorithmic Trading in Python
2.35k stars 2.37k forks source link

batch api URL #52

Open inaG17 opened 1 year ago

inaG17 commented 1 year ago

batch api url changes

inaG17 commented 1 year ago

split stocks to 20

symbol_groups = list(chunks(stocks['Ticker'], 20)) symbol_strings = [] for i in range(0, len(symbol_groups)): symbol_strings.append(','.join(symbol_groups[i])

final_dataframe = pd.DataFrame(columns = my_columns)

for symbol_string in symbol_strings[:1]:

batch_api_call_url = f'https://cloud.iexapis.com/stable/stock/market/batch/types=quote&symbols{symbol_string}&token={IEX_CLOUD_API_TOKEN}'
print(batch_api_call_url)
rohitx01 commented 1 year ago

For all the Batch API call errors Follow this thread ------> https://github.com/nickmccullum/algorithmic-trading-python/issues/53#issuecomment-1495485369 I have answered all the errors/changes occuring

Hongyac commented 1 year ago

batch_api_call_url = https://cloud.iexapis.com/v1/stock/market/batch?symbols={symbol_string}&types=quote&token={IEX_CLOUD_API_TOKEN}

This works for me. Following this links: https://stackoverflow.com/questions/56806064/how-to-call-multiple-quotes-from-iex-cloud-api