algorithmic-trading-python
algorithmic-trading-python copied to clipboard
Getting error 403,Tried replacing token with a new one, used try except clause
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