algorithmic-trading-python
algorithmic-trading-python copied to clipboard
Keep getting 404 response error on getting API requests
hi I just start learning coding. while getting the API requests i keep getting the 404 error """symbol = 'APPL' api_url =f'https://sandbox.iexapis.com/stable/stock/{symbol}/quote?token={IEX_CLOUD_API_TOKEN}' print(api_url) data = requests.get(api_url) print(data)"""
Can anyone help to spot where is wrong? I have already tried clearing my computer cache and cookies. But i just keep getting stuck here :(
Thanks
hi Panda, Please give the correct ticker name - 'AAPL' 👍
Hi, Please I am also getting this 404 response: 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)
and when I go ahead to try: symbol = 'AAPL' api_url = f'https://sandbox.iexapis.com/stable/stock/{symbol}/quote/?token{IEX_CLOUD_API_TOKEN}' data = requests.get(api_url).json() print(data)
it gives me this error: {'error': '"tokenTpk_059b97af715d417d9f49f50b51b1c448" is not allowed'}
Could anyone please help me find what I am getting wrong?
many thanks.
Hi @Alaidanengia ,
You are missing an = sign in your api_url string between ?token and {IEX_CLOUD_API_TOKEN}:
api_url = f'https://sandbox.iexapis.com/stable/stock/{symbol}/quote/?token{IEX_CLOUD_API_TOKEN}'
Should be:
api_url = f'https://sandbox.iexapis.com/stable/stock/{symbol}/quote/?token={IEX_CLOUD_API_TOKEN}'
Woww..thanks a lot @dphugo :
I have made the correction and it has worked.
So grateful
symbol='AAPL' api_url = f'https://sandbox.iexapis.com/stable/stock/{symbol}/quote/?token={IEX_CLOUD_API_TOKEN}' data = requests.get(api_url) data
i am getting response<403>
how i can solve
pi_url = f'https://sandbox.iexapis.com/stable/stock/{symbol}/quote/?token={IEX_CLOUD_API_TOKEN}'
have you solved getting same error .
I haven't used this repo, so I'm not familiar with the endpoints, but try:
pi_url =f 'https://sandbox.iexapis.com/stable/stock/{symbol}/quote?token={IEX_CLOUD_API_TOKEN}'
Hi I am getting 403 error here please help to rectify ''' 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.status_code) ''' output:-403
@ArpitSharma08,
permission issue: known user, but without privileges. see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
@Ayush-sacri I have contacted the iexapis and they said that they have discontinued sandbox api now only paid version is available or 7 days trial else you can use other financial apis