Open Shanu2092 opened 1 year ago
final_dataframe = pd.DataFrame(columns = mycolumns)
for stock in stocks['Ticker']: api_url = f'https://sandbox.iexapis.com/stable/stock/{stock}/quote/?token=sk_b92781ff259841bead23d3012a9f8cf3' data = requests.get(api_url)
if data.status_code == 200: data = data.json() final_dataframe = final_dataframe.append( pd.Series( [stock, data['latestPrice'], data['marketCap'], 'N/A'], index = mycolumns ), ignore_index = True ) else: print(f'An error occurred, status code: {data.status_code}')
me2!!!! still dont know how to fix this
Let me know if you guys find something!
I think the solution have already been solved
Okay, it has not been solved. Instead, IEX Cloud seems to have updated over the years
final_dataframe = pd.DataFrame(columns = mycolumns)
for stock in stocks['Ticker']: api_url = f'https://sandbox.iexapis.com/stable/stock/{stock}/quote/?token=sk_b92781ff259841bead23d3012a9f8cf3' data = requests.get(api_url)