I’m following this freecodecamp tutorial on algorithmic trading and at 40:56 he fixes the API call from a previous omission that resulted in a 404 code. I also get the 404 code but when I add the /stable/ part of the url that was missing, I get a response 403 from this code :
symbol = 'AAPL'
api_url = f'https://sandbox.iexapis.com/stable/stock/{symbol}/quote?token={IEX_CLOUD_API_TOKEN}'
data = requests.get(api_url)
print(data)
I checked for spelling errors, tried to input the token directly instead of using an f string but no luck. I think it might come from an authorization problem but i don’t know how to fix that
Willytom Rigaud is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
5